当我在16位汇编中添加两个值时,将结果打印到控制台的最佳方法是什么?
目前我有以下代码:
目前我有以下代码:
;;---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---;;
我认为dl值应该是ASCII码,但我不确定如何将加法后的ax值转换为ASCII。