mirror of
https://github.com/supleed2/ELEC50010-IAC-CW.git
synced 2024-12-22 21:35:48 +00:00
Merge branch 'main' of https://github.com/supleed2/AM04_CPU into main
This commit is contained in:
commit
2a7b9c2c49
|
@ -1 +1 @@
|
|||
3
|
||||
3
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
34040004
|
||||
34050003
|
||||
00A4001A
|
||||
0085001A
|
||||
00002010
|
||||
00002812
|
||||
00851021
|
||||
|
|
74
reference/divedgecaseref.txt
Normal file
74
reference/divedgecaseref.txt
Normal file
|
@ -0,0 +1,74 @@
|
|||
==========DIV-Divide==========
|
||||
|
||||
div - 2 // is it seperating quotients & remainders correctly
|
||||
|
||||
ori $4, $0, 4
|
||||
ori $5, $0, 3
|
||||
div $4, $5
|
||||
mfhi $4
|
||||
mflo $5
|
||||
addu $2,$4,$5
|
||||
jr $0
|
||||
|
||||
ref file = 2
|
||||
|
||||
34040004
|
||||
34050003
|
||||
0085001A
|
||||
00002010
|
||||
00002812
|
||||
00851021
|
||||
00000008
|
||||
|
||||
div - 3 // -ve/-ve
|
||||
|
||||
ori $4, $0, -4
|
||||
ori $5, $0, -2
|
||||
div $4, $5
|
||||
mflo $2
|
||||
jr $0
|
||||
|
||||
reg file = 2
|
||||
|
||||
3404fffc
|
||||
3405fffe
|
||||
0085001A
|
||||
00001012
|
||||
00000008
|
||||
|
||||
div - 4 // +ve/-ve
|
||||
|
||||
ori $4, $0, 4
|
||||
ori $5, $0, -2
|
||||
div $4, $5
|
||||
mflo $2
|
||||
jr $0
|
||||
|
||||
reg file = -2
|
||||
|
||||
34040004
|
||||
3405fffe
|
||||
0085001A
|
||||
00001012
|
||||
00000008
|
||||
|
||||
|
||||
div - 5 // is it seperating quotients & remainders correctly - when dealing with negatives
|
||||
|
||||
ori $4, $0, -4
|
||||
ori $5, $0, 3
|
||||
div $4, $5
|
||||
mfhi $4
|
||||
mflo $5
|
||||
addu $2,$4,$5
|
||||
jr $0
|
||||
|
||||
ref file = 2 - as we are adding -1 and -1 using addu
|
||||
|
||||
34040004
|
||||
34050003
|
||||
0085001A
|
||||
00002010
|
||||
00002812
|
||||
00851021
|
||||
00000008
|
Loading…
Reference in a new issue