Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .bss
- c: resb 1
- section .text
- global _start
- _start:
- _loop:
- mov eax, 3 ; read() syscall
- mov ebx, 0 ; read from stdin
- mov ecx, c
- mov edx, 1 ; read one byte at a time
- int 0x80
- cmp eax, 1 ; check number of bytes read
- jne _exit
- mov eax, 341 ; rot 13 stuff
- mov ebx, [c]
- int 0x80
- mov [c], al ; store rot13'd char in c
- mov eax, 4 ; write() syscall
- mov ebx, 1 ; wrie to stdout
- mov ecx, c
- mov edx, 1 ; write one byte at a time
- int 80h
- cmp eax, 1 ; check number of bytes written
- jne _exit
- jmp _loop
- _exit:
- mov eax,1
- int 80h
- ; vim: set ft=nasm:
Add Comment
Please, Sign In to add comment