NitePR Format:
MIPS:
lui t0, $0880 // t0 = 0x08800000
lw t1, $0c64(t0) // load value at address 0x08800c64
lw t2, $0c68(t0) // load value at address 0x08800c68
lw t3, $0c5c(t0) // load value at address 0x08800c5c
addiu t4, zero, $0003 /// t4 = 0x00000003
addiu t5, zero, $0000 /// t5 = 0x00000000, reserved for branch commands
bne t3, t4, $08800c28 /// will not branch if value at address 0x08800c5c is 0x00000003
addiu t4, zero, $0002 /// t4 = 0x00000002
div t1, t2 /// t1 divided by t2 = lo / hi if not perfect
mflo t5 /// move lo to t5
bne t3, t4, $08800c38 /// will not branch if value at address 0x08800c5c is 0x00000002
addiu t4, zero, $0001 /// t4 = 0x00000001
mult t1, t2 /// t1 multiply by t2 = lo / hi
mflo t5 /// move lo to t5
bne t3, t4, $08800c44 /// will not branch if value at address 0x08800c5c is 0x00000001
nop
sub t5, t1, t2 /// t1 subtract by t2 = t5
bne t3, zero, $08800c50 /// will not branch if value at address 0x08800c5c is zero or 0x00000000
nop
add t5, t1, t2 /// t1 add by t2 = t5
sw t5, $0c6c(t0) /// store values in t5 to address 0x08800c6c
jr ra /// end
nop
- Code:
#Calculator (Enable)
;Brian-1337-
0x00000098 0x0a200300
0x00000c00 0x3c080880
0x00000c04 0x8d090c64
0x00000c08 0x8d0a0c68
0x00000c0c 0x8d0b0c5c
0x00000c10 0x240c0003
0x00000c14 0x240d0000
0x00000c18 0x156c0003
0x00000c1c 0x240c0002
0x00000c20 0x012a001a
0x00000c24 0x00006812
0x00000c28 0x156c0003
0x00000c2c 0x240c0001
0x00000c30 0x012a0018
0x00000c34 0x00006812
0x00000c38 0x156c0002
0x00000c3c 0x00000000
0x00000c40 0x012a6822
0x00000c44 0x15600002
0x00000c48 0x00000000
0x00000c4c 0x012a6820
0x00000c50 0xad0d0c6c
0x00000c54 0x03e00008
0x00000c58 0x00000000
#Addition
0x00000c5c 0x00000000
#Subtraction
0x00000c5c 0x00000001
#Multiplication
0x00000c5c 0x00000002
#Division
0x00000c5c 0x00000003
#Factor 1
0x00000c64 0x00000000
#Factor 2
0x00000c68 0x00000000
#Result
0x00000c6c 0x00000000
- Code:
_C0 Calculator (Enable)
#Brian-1337-
_M 0x08800098 0x0A200300
_M 0x08800C00 0x3C080880
_M 0x08800C04 0x8D090C64
_M 0x08800C08 0x8D0A0C68
_M 0x08800C0C 0x8D0B0C5C
_M 0x08800C10 0x240C0003
_M 0x08800C14 0x240D0000
_M 0x08800C18 0x156C0003
_M 0x08800C1C 0x240C0002
_M 0x08800C20 0x012A001A
_M 0x08800C24 0x00006812
_M 0x08800C28 0x156C0003
_M 0x08800C2C 0x240C0001
_M 0x08800C30 0x012A0018
_M 0x08800C34 0x00006812
_M 0x08800C38 0x156C0002
_M 0x08800C3C 0x00000000
_M 0x08800C40 0x012A6822
_M 0x08800C44 0x15600002
_M 0x08800C48 0x00000000
_M 0x08800C4C 0x012A6820
_M 0x08800C50 0xAD0D0C6C
_M 0x08800C54 0x03E00008
_M 0x08800C58 0x00000000
_C0 Addition
_M 0x08800C5C 0x00000000
_C0 Subtraction
_M 0x08800C5C 0x00000001
_C0 Multiplication
_M 0x08800C5C 0x00000002
_C0 Division
_M 0x08800C5C 0x00000003
_C0 Factor 1
_M 0x08800C64 0x00000000
_C0 Factor 2
_M 0x08800C68 0x00000000
_C0 Result
_M 0x08800C6C 0x00000000
MIPS:
lui t0, $0880 // t0 = 0x08800000
lw t1, $0c64(t0) // load value at address 0x08800c64
lw t2, $0c68(t0) // load value at address 0x08800c68
lw t3, $0c5c(t0) // load value at address 0x08800c5c
addiu t4, zero, $0003 /// t4 = 0x00000003
addiu t5, zero, $0000 /// t5 = 0x00000000, reserved for branch commands
bne t3, t4, $08800c28 /// will not branch if value at address 0x08800c5c is 0x00000003
addiu t4, zero, $0002 /// t4 = 0x00000002
div t1, t2 /// t1 divided by t2 = lo / hi if not perfect
mflo t5 /// move lo to t5
bne t3, t4, $08800c38 /// will not branch if value at address 0x08800c5c is 0x00000002
addiu t4, zero, $0001 /// t4 = 0x00000001
mult t1, t2 /// t1 multiply by t2 = lo / hi
mflo t5 /// move lo to t5
bne t3, t4, $08800c44 /// will not branch if value at address 0x08800c5c is 0x00000001
nop
sub t5, t1, t2 /// t1 subtract by t2 = t5
bne t3, zero, $08800c50 /// will not branch if value at address 0x08800c5c is zero or 0x00000000
nop
add t5, t1, t2 /// t1 add by t2 = t5
sw t5, $0c6c(t0) /// store values in t5 to address 0x08800c6c
jr ra /// end
nop