.386 Code16 segment para public use16 assume cs:Code16 public WriteHexa public WriteHexa32 WriteHexa32 PROC NEAR ; Affiche les 8 chiffres hexa de EAX push eax push ebx push ecx push edx mov ebx,eax ; On sauve EAX dans EBX and eax,0f0000000h mov cl,28 shr eax,cl call WriteHex mov eax,ebx and eax,0f000000h mov cl,24 shr eax,cl call WriteHex mov eax,ebx and eax,0f00000h mov cl,20 shr eax,cl call WriteHex mov eax,ebx and eax,0f0000h mov cl,16 shr eax,cl call WriteHex mov eax,ebx and eax,0F000h mov cl,12 shr eax,cl CALL WriteHex mov eax,ebx ; On restore EAX depuis EBX and eax,0f00h mov cl,8 shr eax,cl call WriteHex mov eax,ebx and eax,0f0h mov cl,4 shr eax,cl Call WriteHex mov eax,ebx and eax,0fh call WriteHex pop edx pop ecx pop ebx pop eax ret WriteHexa32 ENDP WriteHexa PROC NEAR ; Affiche les 4 chiffres hexa de AX push ax push bx push cx mov bx,ax and ax,0F000h mov cl,12 shr ax,cl CALL WriteHex mov ax,bx and ax,0f00h mov cl,8 shr ax,cl call WriteHex mov ax,bx and ax,0f0h mov cl,4 shr ax,cl Call WriteHex mov ax,bx and ax,0fh call WriteHex pop cx pop bx pop ax ret WriteHexa ENDP WriteHex PROC NEAR ; Affiche les 4 bits de AL push ax push dx cmp al,10; jb W4Chiffre add al,"A"-10 jmp W4Affiche W4Chiffre: add al,"0" W4Affiche: mov dl,al mov ah,2 int 21h pop dx pop ax ret WriteHex endp Code16 ends end