Created
February 3, 2018 10:36
-
-
Save ooade/0cfa588535b15be1a6bf11f41d4baf03 to your computer and use it in GitHub Desktop.
Program to wish unknown users happy birthday
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Program to wish an unknown user a happy birthday | |
section .text | |
global _start | |
_start: | |
; write | |
mov eax, 4 | |
mov ebx, 1 ;std_out | |
mov ecx, msg | |
mov edx, msg_len | |
int 0x80 | |
; get input from keyboard | |
mov eax, 3 | |
mov ebx, 0 ;std_in | |
mov ecx, user | |
mov edx, 5 | |
int 0x80 | |
; output | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, res | |
mov edx, res_len | |
int 0x80 | |
; output | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, [user] | |
mov edx, 5 | |
int 0x80 | |
exit: | |
mov eax, 1 | |
int 0x80 | |
section .bss | |
user resw 5 | |
section .data | |
msg db "Enter celebrant's name: " | |
msg_len equ $ - msg | |
res db "Happy birthday, " | |
res_len equ $ - msg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment