Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;numbers.asm
- .386
- option casemap :none
- include \masm32\include\masm32rt.inc
- includelib \masm32\lib\masm32rt.lib
- .data
- inputStr db "Hello WORLD_5ÄöÖüÜ-0123456789", 0
- numCount dword 0
- delCount dword 0
- .data?
- endStr db 256 dup (?)
- .code
- start:
- push ebx
- push esi
- mov esi, 0
- mov eax, 0
- mov ebx, 0
- mov ecx, 0
- _loop:
- mov ebx, offset inputStr
- mov al, [ebx+esi]
- cmp al, 0
- jz _ende
- cmp al, 48
- jb _notNum
- cmp al, 57
- ja _notNum
- jmp _isNum
- _notNum:
- inc delCount
- inc esi
- jmp _loop
- _isNum:
- mov ebx, offset endStr
- mov ecx, numCount
- mov [ebx+ecx], al
- inc numCount
- inc esi
- jmp _loop
- _ende:
- invoke StdOut, addr endStr
- pop esi
- pop ebx
- invoke ExitProcess, 0
- end start
Add Comment
Please, Sign In to add comment