Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #; LICZENIE DUZYCH LITEREK
- .intel_syntax noprefix
- .global main
- .text
- main:
- mov eax, offset messg
- push eax
- call policz
- add esp, 4
- push eax
- mov eax, offset printf_arg1
- push eax
- call printf
- add esp, 8
- exit:
- mov eax, 0
- ret
- policz:
- push ecx
- push edx
- xor ecx, ecx
- dec eax
- nastepny:
- inc eax
- mov dl, [eax]
- cmp dl, 0
- je koniec
- sub dl, 'A'
- cmp dl, 'Z'-'A'
- jbe duza
- jmp nastepny
- duza:
- inc ecx
- jmp nastepny
- koniec:
- mov eax, ecx #; ustawiam wynik
- pop edx #; przywracam edx
- pop ecx #; przywracam ecx
- ret
- .data
- messg: .asciz "PrZyklADowy tekst"
- printf_arg1: .asciz "%i\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement