diff --git a/inputs/reference/divquotient.txt b/inputs/reference/divquotient.txt new file mode 100644 index 0000000..e8a53e9 --- /dev/null +++ b/inputs/reference/divquotient.txt @@ -0,0 +1,5 @@ +34040004 +34050003 +0085001A +00001012 +00000008 \ No newline at end of file diff --git a/inputs/reference/divremainder.txt b/inputs/reference/divremainder.txt new file mode 100644 index 0000000..66e5dba --- /dev/null +++ b/inputs/reference/divremainder.txt @@ -0,0 +1,5 @@ +34040004 +34050003 +0085001A +00001010 +00000008 \ No newline at end of file diff --git a/inputs/reference/divuquotient b/inputs/reference/divuquotient new file mode 100644 index 0000000..e19a2cf --- /dev/null +++ b/inputs/reference/divuquotient @@ -0,0 +1,5 @@ +34040004 +34050003 +0085001B +00001012 +00000008 \ No newline at end of file diff --git a/inputs/reference/divuremainder.txt b/inputs/reference/divuremainder.txt new file mode 100644 index 0000000..5384638 --- /dev/null +++ b/inputs/reference/divuremainder.txt @@ -0,0 +1,5 @@ +34040004 +34050003 +0085001B +00001010 +00000008 \ No newline at end of file diff --git a/inputs/reference/ibrahimreference.txt b/inputs/reference/ibrahimreference.txt index ddcf491..695e603 100644 --- a/inputs/reference/ibrahimreference.txt +++ b/inputs/reference/ibrahimreference.txt @@ -111,8 +111,8 @@ register 0 = 3 34040002 34050010 -////// -////// +00851006 +00000008 =============== SRL Shift right logical ============== @@ -147,8 +147,8 @@ register 0 = -536870912 (first 3 bits high - rest low) 34040002 34050001 -//////// -/////// +00851007 +00000008 ====== SRA Shift right arithmetic ========== @@ -252,8 +252,8 @@ register 0 = 16 34040002 34050003 -////// -////// +00851004 +00000008 ======= SLL Shift left logical ====== @@ -445,37 +445,83 @@ $HI = 5 ==================== SH Store half-word ======= -///////// +lui $4, 3 +ori $5, $0, 3 +or $6, $4, $5 +sh $6, 1($1) +jr $0 + +3c040003 +34050003 +00853025 +A4260001 +00000008 -======== DIV Divide ====== +======== DIV Divide quotient ====== ori $4, $0, 4 ori $5, $0, 3 div $4, $5 +mflo $2 jr $0 -$LO = 1 -$HI = 1 +register v0 = 1 + 34040004 34050003 0085001A +00001012 00000008 -========= DIVU Divide unsigned ===== +======== DIV Divide remainder ====== + + +ori $4, $0, 4 +ori $5, $0, 3 +div $4, $5 +mfhi $2 +jr $0 + +register v0 = 1 + +34040004 +34050003 +0085001A +00001010 +00000008 + +========= DIVU Divide unsigned quotient ===== ori $4, $0, 4 ori $5, $0, 3 divu $4, $5 +mflo $2 jr $0 -$LO = 1 -$HI = 1 +register_vo = 1 34040004 34050003 0085001B +00001012 +00000008 + +========= DIVU Divide unsigned remainder ===== + +ori $4, $0, 4 +ori $5, $0, 3 +divu $4, $5 +mfhi $2 +jr $0 + +register_vo = 1 + +34040004 +34050003 +0085001B +00001010 00000008 \ No newline at end of file diff --git a/inputs/reference/reference.txt b/inputs/reference/reference.txt index 2230764..0bd130b 100644 --- a/inputs/reference/reference.txt +++ b/inputs/reference/reference.txt @@ -537,7 +537,7 @@ register_v0 = 0x12345678 //SLL Shift left logical -//SLLV Shift left logical variable ** +//SLLV Shift left logical variable //SLT Set on less than (signed) @@ -549,11 +549,11 @@ register_v0 = 0x12345678 //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/reference/sh.txt b/inputs/reference/sh.txt new file mode 100644 index 0000000..50387ed --- /dev/null +++ b/inputs/reference/sh.txt @@ -0,0 +1,5 @@ +3c040003 +34050003 +00853025 +A4260001 +00000008 diff --git a/inputs/sllv.txt b/inputs/sllv.txt index 93c2eb4..89c4fdd 100644 --- a/inputs/sllv.txt +++ b/inputs/sllv.txt @@ -1,4 +1,4 @@ 34040002 34050003 -////// -////// \ No newline at end of file +00851004 +00000008 diff --git a/inputs/srav.txt b/inputs/srav.txt index bb14f29..cf23bc9 100644 --- a/inputs/srav.txt +++ b/inputs/srav.txt @@ -1,4 +1,4 @@ 34040002 34050001 -//////// -/////// \ No newline at end of file +00851007 +00000008 \ No newline at end of file diff --git a/inputs/srlv.txt b/inputs/srlv.txt index fa1b6a4..ae99941 100644 --- a/inputs/srlv.txt +++ b/inputs/srlv.txt @@ -1,4 +1,4 @@ 34040002 34050010 -////// -////// \ No newline at end of file +00851006 +00000008 \ No newline at end of file