org 100h
mov ax,0027h
mov bx,0001h
add ax,bx
aad
adc ax,0010h
sub ax,0002h
sbb ax,0002h
mov bl,02h
div bl
idiv bl
mul bl
imul bl
call print_ax ; unsigned decimal.
ret
print_ax proc
cmp ax, 0
jne print_ax_r
push ax
mov al, '0'
mov ah, 0eh
int 10h
pop ax
ret
print_ax_r:
pusha
mov dx, 0
cmp ax, 0
je pn_done
mov bx, 10
div bx
call print_ax_r
mov ax, dx
add al, 30h
mov ah, 0eh
int 10h
jmp pn_done
pn_done:
popa
ret
endp 0
Tidak ada komentar:
Posting Komentar