Advertisement
Guest User

count

a guest
May 7th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Program template
  2. INCLUDE Irvine32.inc
  3.  
  4. .data
  5.     ; declare variables here
  6.     HelloTxt        BYTE        "Hello World!", 0ah, 0
  7.     A           DWORD   5
  8. .code
  9. main proc
  10.     ; write your code here
  11.    
  12.    
  13.     CALL countChars
  14.     CALL WriteInt
  15.     CALL Crlf
  16.  
  17.  
  18.     invoke ExitProcess,0
  19. main endp
  20.  
  21. countChars proc
  22.     MOV ESI, OFFSET HelloTxt
  23.     MOV EBX, 0
  24.  
  25.     ciklus:
  26.         MOV AL, [ESI]
  27.         CMP AL, 0
  28.         JE vege
  29.         INC EBX
  30.         INC ESI
  31.         JMP ciklus
  32.  
  33.     vege:
  34.  
  35.     MOV EAX, EBX
  36.     ret
  37.  
  38. countChars endp
  39.  
  40. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement