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

17 lines
504 B
Text

# /* $begin cjr-ys */
# Code to generate a combination of not-taken branch and ret
irmovq Stack, %rsp
irmovq rtnp,%rax
pushq %rax # Set up return pointer
xorq %rax,%rax # Set Z condition code
jne target # Not taken (First part of combination)
irmovq $1,%rax # Should execute this
halt
target: ret # Second part of combination
irmovq $2,%rbx # Should not execute this
halt
rtnp: irmovq $3,%rdx # Should not execute this
halt
.pos 0x40
Stack:
# /* $end cjr-ys */