You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
540 B
31 lines
540 B
.global _start
|
|
_start:
|
|
# Set base value of a0 to 'test failed'
|
|
addi a0, zero, 1
|
|
|
|
# Set A, B values of t0/t1, to test less than
|
|
addi t0, zero, 1
|
|
addi t1, zero, 2
|
|
blt t1, t0, lt0
|
|
|
|
# Inequality passed, now test with jump
|
|
blt t0, t1, lt1
|
|
|
|
# On failure, return
|
|
ebreak
|
|
|
|
ltNeg:
|
|
# All passed
|
|
addi a0, zero, 0
|
|
ebreak
|
|
|
|
lt0:
|
|
# Inequality failed
|
|
ebreak
|
|
|
|
lt1:
|
|
# Inequality passed ; now try with negative numbers
|
|
addi t0, zero, -1
|
|
addi t1, zero, -2
|
|
blt t1, t0, ltNeg
|
|
ebreak
|
|
|