SHARE
TWEET

Untitled

a guest Jan 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #; LICZENIE DUZYCH LITEREK
  2.  
  3. .intel_syntax noprefix
  4. .global main
  5. .text
  6.     main:
  7.         mov eax, offset messg
  8.         push eax
  9.         call policz
  10.         add esp, 4
  11.         push eax
  12.         mov eax, offset printf_arg1
  13.         push eax
  14.         call printf
  15.         add esp, 8
  16.     exit:
  17.         mov eax, 0
  18.         ret
  19.  
  20.     policz:
  21.         push ecx
  22.         push edx
  23.         xor ecx, ecx
  24.         dec eax
  25.  
  26.     nastepny:
  27.         inc eax
  28.         mov dl, [eax]
  29.         cmp dl, 0      
  30.         je koniec
  31.         sub dl, 'A'
  32.         cmp dl, 'Z'-'A'
  33.         jbe duza
  34.         jmp nastepny
  35.  
  36.     duza:
  37.         inc ecx
  38.         jmp nastepny
  39.  
  40.     koniec:
  41.         mov eax, ecx        #; ustawiam wynik
  42.         pop edx             #; przywracam edx
  43.         pop ecx             #; przywracam ecx
  44.         ret
  45.  
  46. .data
  47.     messg: .asciz "PrZyklADowy tekst"
  48.     printf_arg1: .asciz "%i\n"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top