Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io.inc"
- extern printf
- section .data
- before_format db "before %s", 13, 10, 0
- after_format db "after %s", 13, 10, 0
- mystring db "abcdefghij", 0
- section .text
- global CMAIN
- toupper:
- push ebp
- mov ebp, esp
- ; TODO
- mov eax, dword [ebp + 8]
- xor ecx, ecx
- test_one_byte:
- mov bl, byte [eax]
- test bl, bl
- je out
- sub bl, 0x20
- mov byte [eax], bl
- inc eax
- jmp test_one_byte
- out:
- leave
- ret
- CMAIN:
- push ebp
- mov ebp, esp
- push mystring
- push before_format
- call printf
- add esp, 8
- push mystring
- call toupper
- add esp, 4
- push mystring
- push after_format
- call printf
- add esp, 8
- leave
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement