presentations/highlight-js/test/detect/mipsasm/default.txt

23 lines
487 B
Text
Raw Permalink Normal View History

2018-12-07 08:48:05 -06:00
.text
.global AckermannFunc
# Preconditions:
# 1st parameter ($a0) m
# 2nd parameter ($a1) n
# Postconditions:
# result in ($v0) = value of A(m,n)
AckermannFunc:
addi $sp, $sp, -8
sw $s0, 4($sp)
sw $ra, 0($sp)
# move the parameter registers to temporary - no, only when nec.
LABEL_IF: bne $a0, $zero, LABEL_ELSE_IF
addi $v0, $a1, 1
# jump to LABEL_DONE
j LABEL_DONE