org 100h push word '1' push dword 01234567h call hexout mov ax, 4c00h int 21h hexout: push eax push edx push cx push bp mov bp, sp mov ax, 900h mov dx, hexmsg int 21h mov ax, 200h mov dl, [bp+18] int 21h mov ax, 900h mov dx, hexmsg2 int 21h mov eax, dword [bp+14] mov cx, 8 hoh: rol eax, 4 mov edx, eax and dl, 0Fh add dl, '0' cmp dl, '9' jng hona add dl, 'A'-'9'-1 hona: push ax mov ax, 200h int 21h pop ax loop hoh mov ax, 900h mov dx, hexmsg3 int 21h pop bp pop cx pop edx pop eax ret 6 hexmsg db '$' hexmsg2 db ': ','$' hexmsg3 db 13,10,'$'