CAP/TP01/riscv/minmax.s

27 lines
413 B
ArmAsm
Raw Normal View History

2024-09-12 10:02:16 +02:00
.text
.globl main
main:
addi sp,sp,-16
sd ra,8(sp)
## TODO Your assembly code there
2024-09-23 13:39:04 +02:00
addi t0, zero, 17
addi t1, zero, 12
blt t0, t1, inf
sb zero, t1, min
j end
inf:
sb zero, t2, min
2024-09-12 10:02:16 +02:00
## END TODO End of user assembly code
2024-09-23 13:39:04 +02:00
end:
2024-09-12 10:02:16 +02:00
ld ra,8(sp)
addi sp,sp,16
ret
# Data comes here
.section .data
mydata:
.dword 7
.dword 42
min:
2024-09-23 13:39:04 +02:00
.dword 8