我是这里的初学者,我的div.asm分工不起作用。当我将div改为mul时,乘法工作。我应该编辑哪一部分?以及如何使它显示余数? 此外,我有另一个关于将低级转换为大写的作业,如果没有大写字符,则显示原始字符。我无法使显示原始字符与第一部分一起工作,即将小写字母转换为大写字母。
mov ax,@data
mov ds,ax
lea dx,msg ;print msg
mov ah,9
int 21h
mov ah,1 ;save input to num2
int 21h
sub al,30h
mov num2,al
lea dx,msg2 ;print msg2
mov ah,9
int 21h
mov ah,1 ;save input to num1
int 21h
sub al,30h
mov num1,al
div num2 ;divide num1 using num2
mov result,al ;store answer to result
aam ;aam converts the result into BCD form and 1st digit save in ah and 2nd digit save in al
add ah,30h ;print data storess in ah and al which is in ascii code, 30h convert to decimal
add al,30h
mov bx,ax ;stores the result in ah and al register to bx
lea dx,msg3 ;print msg3
mov ah,9
int 21h
mov ah,2 ;print data in bh
mov dl,bh
int 21h
mov ah,2 ;write character on console present in bl register
mov dl,bl
int 21h
mov ah,4ch ;exit
int 21h