Leange

Untitled

Jan 16th, 2017
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;numbers.asm
  2.  
  3. .386
  4. option casemap :none
  5.  
  6. include \masm32\include\masm32rt.inc
  7. includelib \masm32\lib\masm32rt.lib
  8.  
  9. .data
  10.         inputStr db     "Hello WORLD_5ÄöÖüÜ-0123456789", 0
  11.         numCount dword 0
  12.         delCount dword 0       
  13. .data?
  14.         endStr  db 256 dup (?)
  15. .code
  16. start:
  17.         push ebx
  18.         push esi
  19.         mov esi, 0
  20.         mov eax, 0 
  21.         mov ebx, 0
  22.         mov ecx, 0
  23. _loop:
  24.         mov ebx, offset inputStr
  25.         mov al, [ebx+esi]
  26.         cmp al, 0
  27.         jz _ende
  28.         cmp al, 48
  29.         jb _notNum
  30.         cmp al, 57
  31.         ja _notNum
  32.         jmp _isNum             
  33. _notNum:       
  34.         inc delCount
  35.         inc esi
  36.         jmp _loop
  37. _isNum:    
  38.         mov ebx, offset endStr
  39.         mov ecx, numCount
  40.         mov [ebx+ecx], al
  41.         inc numCount
  42.         inc esi
  43.         jmp _loop
  44. _ende:
  45.         invoke StdOut, addr endStr
  46.         pop esi
  47.         pop ebx
  48.         invoke ExitProcess, 0
  49. end start
Add Comment
Please, Sign In to add comment