include i:\masm32\include\windows.inc
include i:\masm32\include\user32.inc
include i:\masm32\include\kernel32.inc
includelib i:\masm32\lib\user32.lib
includelib i:\masm32\lib\kernel32.lib
.const
szinput db '输入加数(0-99):',0
szend db '结果是 : %d',0
szexit db '按任意键退出...',0
pop eax
.if al==0dh
pop eax
and eax,0ffh
sub al,30h
mov edx,_addrnum
mov word ptr ds:[edx],ax
.else
pop eax
sub ax,3030h
mov bx,ax
mov cl,10
mul cl
shr bx,8
add ax,bx
mov edx,_addrnum
mov word ptr ds:[edx],ax
.endif