ELEC50010-IAC-CW/reference/edgecases/sravref.txt
2020-12-18 23:15:04 +00:00

48 lines
610 B
Plaintext

==SRAV Shift right arithmetic variable ==
srav -2 // Will it be able to handle shifts greater than the highest 1 value
ori $4,$0,6
ori $5,$0,16
srav $2,$5,$4
jr $0
ref = 0
34040006
34050010
00000008
00851007
srav - 3 // negative number - does it sign extened (negative)
lui $4, 0xFFFF
ori $4, $4, 0x00FF
ori $5, $0, 4
srav $2, $4, $5
jr $0
ref = FFFFF00F (4294963215 / -4081)
3c04ffff
348400ff
34050004
00000008
00A41007
srav - 4 // Does it sign extend 0s
lui $4, 0x0FFF
ori $4, $4, 0x00FF
ori $5, $0, 4
srav $2, $4, $5
jr $0
ref = 00FFF00F (16773135)
3c040fff
348400ff
34050004
00000008
00A41007