
Code: Alles auswählen
.data
minutes:
.word 121
.text
lw $a0, minutes
li $t0, 60 # $t0 = commenced hours
div $a0, $t0
mflo $t0
mfhi $t1
sgt $t1, $t1, $zero
add $t0, $t0, $t1
subi $t0, $t0, 2 # $t0 = billable hours
bge $t0, $zero, more_than_two_hours
move $t0, $zero
more_than_two_hours:
li $t1, 2 # $v0 = total parking fee
mul $v0, $t0, $t1
li $t0, 30 # $v0 = capped to max parking fee
ble $v0, $t0, not_over_max
move $v0, $t0
not_over_max: