;在AX中存放有两字节四位十六进制数,将其转换为四字节的 ;ASCII码存放在以s2为首址的四个字节单元中。 data segment s1 dw 3f5ah s2 db 4 dup(?) data ends code segment assume cs:code,ds:data start:mov ax,data mov ds,ax mov ax,s1 lea di,s2 mov ch,4 j1: mov bx,ax and ax,0fh add al,30h cmp al,3ah jb j2 add al,7 j2: mov [di],al inc di mov ax,bx mov cl,4 shr ax,cl dec ch jnz j1 ;--------------------- mov cx,4 l1: dec di mov ah,2 mov dl,[di] int 21h loop l1 mov ah,2 mov dl,'H' int 21h mov ah,4ch int 21h code ends end start