flat assembler
Message board for the users of flat assembler.
Index
> Windows > edit control, user input & spaces |
Author |
|
shoorick 19 Sep 2008, 10:09
process string with your procedure
|
|||
19 Sep 2008, 10:09 |
|
revolution 19 Sep 2008, 10:41
Yes, indeed, there are no API functions that can do it for you, you will need to have your write your own procedure to scan the buffer and ignore/remove the spaces.
|
|||
19 Sep 2008, 10:41 |
|
dacid 19 Sep 2008, 16:22
ok
i have another problem now, how i can validate user input to be betwen 0-9 & A-F ? Some basic source code appreciated |
|||
19 Sep 2008, 16:22 |
|
LocoDelAssembly 19 Sep 2008, 17:23
Code: proc isValidChar char mov dl, byte [char] movzx eax, dl ; To clear upper 24 bits of EAX so at exit it will be either 0 or 1 sub dl, '0' sub al, 'A' cmp dl, 9 setbe dl cmp al, 5 setbe al or al, dl ret endp |
|||
19 Sep 2008, 17:23 |
|
dacid 19 Sep 2008, 18:13
thx
|
|||
19 Sep 2008, 18:13 |
|
bitRAKE 20 Sep 2008, 01:01
Code: isValidChar: label .char byte at esp+4 movzx eax,[.char] bt [_0123456789ABCDEF],eax setc al retn 4 align 32 ; only load a single cacheline _0123456789ABCDEF dw \ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000001111111111b,\ 0000000001111110b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b,\ 0000000000000000b _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
20 Sep 2008, 01:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.