[asm] afficher un nombre en hexa

Fermé
ivesso Messages postés 98 Date d'inscription samedi 1 novembre 2008 Statut Membre Dernière intervention 5 juillet 2011 - Modifié par ivesso le 26/12/2010 à 22:39
Bonjour,

je voudrais afficher en assembleur x86 un nombre en hexadecimal .
voici le code pour afficher un nombre décimal
 bits 16 ;affich lettr 
org 100h 
segment .data 

res db 56 
t db 10 
segment .bss 
r resb 1 
segment .text 

mov al,[res] 
mov ah,0 
div byte[t] 

mov [r],ah;rest 
mov dl,al;quot 
add dl,48 
mov al,dl 
mov bl,3 
mov bh,0 
mov cx,1 
mov ah,09 
int 10h 
;2 
mov dl,1 ;colon 
mov dh,0 ; ligne 
mov bh,0 
mov ah,02 
int 10h 

add byte[r],48 
mov al,[r] 
mov bl,3 
mov bh,0 
mov cx,1 
mov ah,09 
int 10h 

mov dl,2 
mov dh,1 
mov bh,0 
mov ah,02 
int 10h 

mov dl,2 
mov dh,1 
mov bh,0 
mov ah,02 
int 10h 
mov ax,4c00h 
int 21h