csci2021/ArchLab/archlab-handout/sim/y86-code/prog6.ys
Michael Zhang 1fa36db752
f
2018-01-29 17:45:27 -06:00

14 lines
398 B
Text

# Demonstration of return
# /* $begin prog6-ys */
# prog6
irmovq stack,%rsp # Initialize stack pointer
call proc # Procedure call
irmovq $10,%rdx # Return point
halt
.pos 0x20
proc: # proc:
ret # Return immediately
rrmovq %rdx,%rbx # Not executed
.pos 0x30
stack: # stack: Stack pointer
# /* $end prog6-ys */