flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
coconut 03 Apr 2005, 19:36
|
|||
![]() |
|
kidscracker 03 Apr 2005, 19:47
Here is a code that will work, i tok it from an old 16bit library and adapt it, I forgot the part where it detects if it's and negative number
![]() Code: proc STR_ToLong,lptrString enter push ecx edx esi pushfd cld xor ecx,ecx mov esi,[lptrString] ; .lp: lodsb xor al, '0' cmp al, 10 ja .NotDigit shl ecx, 1 jc .Error mov edx, ecx shl ecx, 1 jc .Error shl ecx, 1 jc .Error add ecx, edx jc .Error add cl, al adc ch, 0 jc .Error jmp .lp ; .NotDigit: mov eax,ecx popfd pop esi edx ecx clc return ; .Error: popfd pop esi edx ecx stc return endp I hope it will be helpufull |
|||
![]() |
|
Pjuu 05 Apr 2005, 10:03
Thanks this has been a big help. I am happy that you have shown me a quicker comparison way in my failed attempts the code was kinda huge
![]() THANKS! _________________ Pjuu ^__^ |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.