flat assembler
Message board for the users of flat assembler.
Index
> Windows > Input an Integer |
Author |
|
coconut 03 Apr 2005, 19:36
|
|||
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 , but i will post it later. te code is:
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 |
|||
03 Apr 2005, 19:47 |
|
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 ^__^ |
|||
05 Apr 2005, 10:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.