Aff db 21 dup(0);
Resultat dt 0
Flag db 1
...
mov si, offset Resultat + 9
mov di, offset Aff
mov cx, 10
boucle:
mov ah, [si]
mov al, ah
shl al, 4
and ah, 0Fh
or al, al
jnz suite1
test byte ptr [Flag], 1
jnz suite3
jmp suite2
suite1:
mov byte ptr [Flag], 0
suite2:
add al, '0'
stosb
suite3:
shl ax, 8
or al, al
jnz suite4
test byte ptr [Flag], 1
jnz suite6
jmp suite5
suite4:
mov byte ptr [Flag], 0
suite5:
add al, '0'
stosb
suite6:
dec si
loop boucle
mov byte ptr [di], '$'
mov ah, 9
mov dx, offset Aff
int 21h
Mais bien sûr il faut que DS et ES pointent sur le segment des données même si c'est CS.
Core Breaker :)