; Affichage de valeurs hexadecimales 32 bits en mode protege ; en accedant directement a l'ecran (qui doit etre en mode 3) ; EAX = valeur a afficher ; X = DL, Y = DH .386 include pm.inc Code32 segment public use32 assume cs:Code32 public WriteHexa4_32 WriteHexa4_32 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 Write32 inc dl mov eax,ebx and eax,0f000000h mov cl,24 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0f00000h mov cl,20 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0f0000h mov cl,16 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0F000h mov cl,12 shr eax,cl call Write32 inc dl mov eax,ebx ; On restore EAX depuis EBX and eax,0f00h mov cl,8 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0f0h mov cl,4 shr eax,cl Call Write32 inc dl mov eax,ebx and eax,0fh call Write32 pop edx pop ecx pop ebx pop eax ret WriteHexa4_32 ENDP public WriteWord_32 WriteWord_32 proc near push eax push ebx push ecx push edx mov ebx,eax ; On sauve EAX dans EBX and eax,0f000h mov cl,12 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0f00h mov cl,8 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0f0h mov cl,4 shr eax,cl call Write32 inc dl mov eax,ebx and eax,0fh call Write32 pop edx pop ecx pop ebx pop eax ret WriteWord_32 endp Write32 PROC NEAR ; Affiche les 4 bits de AL a l'emplacement (x=dl,y=dh) push ebx push ds push ax push edx ; On charge le gros segment de 4Go mov bx,core32_sel mov ds,bx cmp al,10; jb W4Chiffre add al,"A"-10 jmp W4Affiche W4Chiffre: add al,"0" W4Affiche: xor ebx,ebx mov bl,dh imul ebx,160 and edx,0ffh add ebx,edx add ebx,edx add ebx,0b8000h ; Attributs du caractere en mode 3 (carte couleur) or ax,01f00h mov ds:[ebx],ax pop edx pop ax pop ds pop ebx ret Write32 endp Code32 ends end