Vous êtes sur la page 1sur 1

td_win32asm_850.

asm
;==============================================================================
;
Test Department's WINDOWS 32 BIT x86 ASSEMBLY example
850
;==============================================================================
.Code
My_StringDecNrtoHexDD:
;don't forget to save register (pushad/popad)
;==============================================================================
; Converts a DECIMAL NUMBER STRING (OFFSET ESI) with max. Character (EAX) into
; a 32 Bit value in EDI.
;-----------------------------------------------------------------------------mov
ecx,eax
dec
ecx
add
esi,ecx
mov
edi,0h
mov
eax,1
My_StringDecNrtoHexDD_Loop:
mov
bl,[esi]
and
bl,0Fh
je
My_StringDecNrtoHexDD_Next
My_StringDecNrtoHexDD_Inc:
add
edi,eax
dec
bl
jne
My_StringDecNrtoHexDD_Inc
My_StringDecNrtoHexDD_Next:
mov
edx,10
mul
edx
dec
esi
dec
ecx
cmp
ecx,0FFFFFFFFh
jne
My_StringDecNrtoHexDD_Loop
ret
;==============================================================================

Page 1

Vous aimerez peut-être aussi