Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
lec6-3
extern printf,scanf section .data msg db "Enter birthyear: ",0 format db '%d',0 msg1 db "In the year %d your age is %d",10,0 section .bss x resd 1 age resd 1 section .text global _start _start: mov rdi,msg ;first parameter mov rax,0 call printf scan: mov rdi, format ;first parameter mov rsi, x ;second parameter mov rax, 0 call scanf mov rax,2020 push rax ;store 2020 on the stack mov rbx,[x] sub rax,rbx ;rax is changed mov [age],rax print: mov rax,0 mov rdi, msg1 pop rsi mov rdx,[age] call printf mov rax, 60 mov rdi, 0 syscall
run
|
edit
|
history
|
help
0
lec4bb.asm
FirstProgram
cmsc313 first Assembly Program Group Lab
Hello
qw
fdfdfdfdf
p1.asm
text.asm
Group Lab 1
lab2_2.asm