; inizio programma cr equ 0dh lf equ 0ah tp equ '$' stsgm segment para stack dw 12 dup(0) stsgm ends dtsgm segment para 'dati' testo1 db 'INSERIRE UNA WORD (quattro hex-digit) = ',tp spazio db '-$' testcr db cr,lf,tp numhex dw 0 numhexl equ byte ptr numhex numhexh equ numhexl+1 testcn db 'IL SU VALORE DECIMALE =' numdec db 0,0,0,0,0,24h numeri db '0123456789ABCDEF' qz dw 0 qzl equ byte ptr qz qzh equ qzl+1 contin db cr,lf,'Premere un tasto per continuare...$' dtsgm ends ; cods segment para main proc far assume cs:cods,ds:dtsgm,es:dtsgm,ss:stsgm inizio: mov ah,0fh int 10h mov ah,0 int 10h mov ax,dtsgm mov ds,ax mov es,ax ; lea dx,testo1 ;richiesta prima word mov ah,9 int 21H call leggi mov numhexh,al lea dx,spazio mov ah,9 int 21h call leggi mov numhexl,al lea dx,testcr mov ah,9 int 21H ; lea si,numdec+4 mov cx,5 mov bl,0ah pluto: mov ah,0 mov al,numhexh div bl mov qzh,al mov al,numhexl div bl mov qzl,al or ah,30h mov [si],ah dec si mov ax,qz mov numhex,ax loop pluto lea dx,testcn mov ah,9 int 21h ; lea dx,contin mov ah,9 int 21h mov ah,8 int 21h jmp inizio mov ah,4ch int 21h ; main endp ; **************** leggi proc near; Subroutine che legge un byte push bx mov bx,0 mov ah,1 int 21h cmp al,40h jl strip1 add al,9 strip1: and al,0fh mov cl,4 shl al,cl mov bl,al mov ah,1 int 21h cmp al,40h jl strip2 add al,9 strip2: and al,0fh add al,bl pop bx ret leggi endp ; ; ******************* ; convb_a proc near push bx and bx,0fh add bx,offset numeri mov al,[bx] pop bx and bx,0f0h mov cl,4 shr bx,cl add bx,offset numeri mov ah,[bx] ;RISULTATO IN AX ret convb_a endp ; cods ends end main