News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Nevermind...

Started by masterori, March 02, 2016, 04:17:43 PM

Previous topic - Next topic

masterori

Nevermind... Please delete

dedndave

i don't know how efficient this is, but....

you could use EDX as an "accumulator"

    mov     esi,offset numeric_string
    xor     eax,eax
    xor     edx,edx

top_of_loop:
    mov     al,[esi]
    cmp     al,"9"
    ja      not_valid

    cmp     al,"0"
    jb      test_end

    imul    edx,10
    inc     esi
    lea     edx,[edx+eax-30]
    jmp     top_of_loop

test_end:
    or      al,al
    jz      end_of_valid_string

not_valid:

;code for set error exit

end_of_valid_string:

;code for valid exit