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

13 lines
430 B
Text

/* $begin ret-hazard-ys */
# Test instruction that modifies %esp followed by ret
irmovq mem,%rbx
mrmovq 0(%rbx),%rsp # Sets %rsp to point to return point
ret # Returns to return point
halt #
rtnpt: irmovq $5,%rsi # Return point
halt
.pos 0x40
mem: .quad stack # Holds desired stack pointer
.pos 0x50
stack: .quad rtnpt # Top of stack: Holds return point
/* $end ret-hazard-ys */