I now come to a small problem in asm.The code is as follows:
data segment 'DATA'
a dw 13
b dw 2
data ends
code segment 'CODE'
main proc far
assume cs:code,ds:data
push ds
sub ax,ax
push ax

mov ax,data
mov ds,ax

mov ax,4
add ax,11
;add ax,30h
mov bx,ax
mov cl,12
push bx ;save BX
ror bx,cl ;left digit to right
mov al,bl ;mov to al
and al,0fh ;mask off left digit
add al,30h ;convert hex to ASCII
cmp al,39h ;is is >9?
jl printit ;jump if digit=0 to 9
add al,7h ;digit is A to F
;mov bx,15
pop bx ;make BX come
mov dl,al ;put ASCII char in DL
mov ah,2 ;display output
int 21h ;call DOS
dec ch ;done 4 digits?
sub cl,4
jns rotate ;not yet
ret ;return to DOS
;mov dx,ax
;mov ah,2
;int 21h
;mov ah,4ch
;int 21h
main endp
code ends
and I don't know where is wrong?Please help me!
Posted on 2003-06-01 11:36:53 by herowc