Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io.inc"
- section .data
- a dd 26
- arr db 'abcdefghijklmnopqrstuvwxyz',0
- section .bss
- s resb 1
- section .text
- global CMAIN
- CMAIN:
- mov ebp, esp; for correct debugging
- GET_DEC 4, edi
- GET_CHAR ecx
- GET_STRING s, 100
- xor ecx, ecx
- PRINT_STRING s
- .loop:
- mov esi, s
- add esi, ecx
- cmp byte[esi], 0
- jz .end
- cmp byte[esi], 'a'
- jl .continue
- cmp byte[esi], 'z'
- jg .continue
- movzx eax, byte[esi]
- sub eax, 'a'
- add eax, edi
- xor edx, edx
- div dword[a]
- mov eax, edx
- mov edx, arr
- add edx, eax
- mov dl, [edx]
- mov byte[esi], dl
- .continue:
- inc ecx
- jmp .loop
- .end:
- NEWLINE
- PRINT_STRING s
- xor eax, eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement