Wenn ich zwei Werte in 16-Bit-Assembly hinzufügen, was ist der beste Weg, um das Ergebnis auf Konsole zu drucken?Drucken Integer zu Konsole in x86-Assembly
Im Moment habe ich diesen Code:
;;---CODE START---;;
mov ax, 1 ;put 1 into ax
add ax, 2 ; add 2 to ax current value
mov ah,2 ; 2 is the function number of output char in the DOS Services.
mov dl, ax ; DL takes the value.
int 21h ; calls DOS Services
mov ah,4Ch ; 4Ch is the function number for exit program in DOS Services.
int 21h ; function 4Ch doesn't care about anything in the registers.
;;---CODE END---;;
Ich denke, dass dl Wert im ASCII-Code sein sollte, aber ich bin nicht sicher, wie Axt Wert nach der Zugabe in ASCII zu konvertieren.