diff --git a/inputs/div.txt b/inputs/div.txt new file mode 100644 index 0000000..6dcc0f5 --- /dev/null +++ b/inputs/div.txt @@ -0,0 +1,4 @@ +34040004 +34050003 +0085001A +00000008 \ No newline at end of file diff --git a/inputs/divu.txt b/inputs/divu.txt new file mode 100644 index 0000000..039725b --- /dev/null +++ b/inputs/divu.txt @@ -0,0 +1,4 @@ +34040004 +34050003 +0085001B +00000008 \ No newline at end of file diff --git a/inputs/ibrahimreference.txt b/inputs/ibrahimreference.txt index 64df695..ddcf491 100644 --- a/inputs/ibrahimreference.txt +++ b/inputs/ibrahimreference.txt @@ -271,4 +271,211 @@ register 0 = 16 34040003 00041080 +00000008 + +======== SB Store byte ======= + +ori $4, $0, 1029 +ori $5, $0, 1 +sb $4, 1($5) +jr $0 + +register 0 = 5 + +34040405 +34050001 +a0a40001 +00000008 + + ======== ORI Bitwise or immediate === + +ori $4,$0,3 +jr $0 + +register a0 = 3 + +34040003 +00000008 + +======== OR Bitwise or === + +int main(){ + int a =5; + int b= 3; + + int c = 5 | 3; + + return 0; +} + + +ori $4, $0, 5 +ori $5, $0, 3 +or $2, $4, $5 +jr $0 + + +34040005 +34050003 +00851025 +00000008 + +register 0 = 7 + +======= MULT Multiply ===== + +ori $4, $0, 4 +ori $5, $0, 3 +mult $4, $5 +jr $0 + +$LO = 12 + +34040004 +34050003 +00850018 +00000008 + + +======= MULT Multiply ===== + +ori $4, $0, 4 +ori $5, $0, 3 +mult $4, $5 +mflo $2 +jr $0 + +register v0 = 12 + +34040004 +34050003 +00850018 +00001012 +00000008 + +======= MULTU Multiply unsigned ===== + +ori $4, $0, 4 +ori $5, $0, 3 +multu $4, $5 +jr $0 + + +$LO = 12 + +34040004 +34050003 +00850019 +00000008 + + +======= MULTU Multiply unsigned ===== + +ori $4, $0, 4 +ori $5, $0, 3 +multu $4, $5 +mflo $2 +jr $0 + + +$2 = 12 + +34040004 +34050003 +00850019 +00001012 +00000008 + +======= MFLO Move from lo ====== + +ori $4, $0, 4 +ori $5, $0, 3 +multu $4, $5 +mflo $2 +jr $0 + + +$2 = 12 + +34040004 +34050003 +00850019 +00001012 +00000008 + +=========== MFHI Move from Hi ========== + +ori $4, $0, 3 +mthi $4 +mfhi $2 +jr $0 + +register v0 = 3 + +34040003 +00800011 +00001010 +00000008 + +======== MTHI Move to HI ==== + +ori $4, $0, 5 +mthi $4 +jr $0 + + +$HI = 5 + +34040005 +00800011 +00000008 + +======= MTLO Move to LO === + +ori $4, $0, 5 +mtlo $4 +jr $0 + + +$HI = 5 + +34040005 +00800013 +00000008 + +==================== SH Store half-word ======= + +///////// + + +======== DIV Divide ====== + + +ori $4, $0, 4 +ori $5, $0, 3 +div $4, $5 +jr $0 + + +$LO = 1 +$HI = 1 + +34040004 +34050003 +0085001A +00000008 + +========= DIVU Divide unsigned ===== + +ori $4, $0, 4 +ori $5, $0, 3 +divu $4, $5 +jr $0 + +$LO = 1 +$HI = 1 + +34040004 +34050003 +0085001B 00000008 \ No newline at end of file diff --git a/inputs/mfhi.txt b/inputs/mfhi.txt new file mode 100644 index 0000000..fd75215 --- /dev/null +++ b/inputs/mfhi.txt @@ -0,0 +1,4 @@ +34040003 +00800011 +00001010 +00000008 \ No newline at end of file diff --git a/inputs/mflo.txt b/inputs/mflo.txt new file mode 100644 index 0000000..db18ff6 --- /dev/null +++ b/inputs/mflo.txt @@ -0,0 +1,5 @@ +34040004 +34050003 +00850019 +00001012 +00000008 diff --git a/inputs/mthi.txt b/inputs/mthi.txt new file mode 100644 index 0000000..a8cc125 --- /dev/null +++ b/inputs/mthi.txt @@ -0,0 +1,3 @@ +34040005 +00800011 +00000008 \ No newline at end of file diff --git a/inputs/mtlo.txt b/inputs/mtlo.txt new file mode 100644 index 0000000..dc818bc --- /dev/null +++ b/inputs/mtlo.txt @@ -0,0 +1,3 @@ +34040005 +00800013 +00000008 \ No newline at end of file diff --git a/inputs/mult.txt b/inputs/mult.txt new file mode 100644 index 0000000..86f65a6 --- /dev/null +++ b/inputs/mult.txt @@ -0,0 +1,5 @@ +34040004 +34050003 +00850018 +00001012 +00000008 \ No newline at end of file diff --git a/inputs/multcurrent.txt b/inputs/multcurrent.txt new file mode 100644 index 0000000..38f4bf0 --- /dev/null +++ b/inputs/multcurrent.txt @@ -0,0 +1,4 @@ +34040004 +34050003 +00850018 +00000008 \ No newline at end of file diff --git a/inputs/multu.txt b/inputs/multu.txt new file mode 100644 index 0000000..bae2062 --- /dev/null +++ b/inputs/multu.txt @@ -0,0 +1,5 @@ +34040004 +34050003 +00850019 +00001012 +00000008 \ No newline at end of file diff --git a/inputs/multucurrent.txt b/inputs/multucurrent.txt new file mode 100644 index 0000000..7f898e1 --- /dev/null +++ b/inputs/multucurrent.txt @@ -0,0 +1,4 @@ +34040004 +34050003 +00850019 +00000008 \ No newline at end of file diff --git a/inputs/or.txt b/inputs/or.txt new file mode 100644 index 0000000..25df299 --- /dev/null +++ b/inputs/or.txt @@ -0,0 +1,4 @@ +34040005 +34050003 +00851025 +00000008 \ No newline at end of file diff --git a/inputs/ori.txt b/inputs/ori.txt index 996347b..902d413 100644 --- a/inputs/ori.txt +++ b/inputs/ori.txt @@ -1,8 +1,2 @@ 34040003 00000008 -00000000 -00000000 -00000000 -00000000 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/reference.txt b/inputs/reference.txt index c947c50..10792b3 100644 --- a/inputs/reference.txt +++ b/inputs/reference.txt @@ -330,13 +330,21 @@ LW Load word LWL Load word left LWR Load word right +// DIVU Divide unsigned + +// DIV Divide + +//MFHI Move from Hi + +//MFLO Move from lo + //MTHI Move to HI //MTLO Move to LO -//MULT Multiply +//MULT Multiply** -//MULTU Multiply unsigned +//MULTU Multiply unsigned** //OR Bitwise or @@ -344,11 +352,11 @@ LWR Load word right //SB Store byte -//SH Store half-word +//SH Store half-word** //SLL Shift left logical -//SLLV Shift left logical variable +//SLLV Shift left logical variable ** //SLT Set on less than (signed) @@ -360,11 +368,11 @@ LWR Load word right //SRA Shift right arithmetic -//SRAV Shift right arithmetic +//SRAV Shift right arithmetic** //SRL Shift right logical -//SRLV Shift right logical variable +//SRLV Shift right logical variable** //SUBU Subtract unsigned diff --git a/inputs/sb.txt b/inputs/sb.txt new file mode 100644 index 0000000..01cfb59 --- /dev/null +++ b/inputs/sb.txt @@ -0,0 +1,4 @@ +34040405 +34050001 +a0a40001 +00000008 \ No newline at end of file diff --git a/inputs/sh.txt b/inputs/sh.txt new file mode 100644 index 0000000..e69de29