mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-15 03:40:56 +01:00
ror &= 31
This commit is contained in:
parent
e64b17aea4
commit
860fc64b11
1 changed files with 1 additions and 0 deletions
|
@ -111,6 +111,7 @@ class CPU
|
||||||
# Rotate right
|
# Rotate right
|
||||||
def ror(word : Word, bits : Int, set_conditions : Bool) : Word
|
def ror(word : Word, bits : Int, set_conditions : Bool) : Word
|
||||||
log "ror - word:#{hex_str word}, bits:#{bits}"
|
log "ror - word:#{hex_str word}, bits:#{bits}"
|
||||||
|
bits &= 31
|
||||||
return word if bits == 0
|
return word if bits == 0
|
||||||
@cpsr.carry = bit?(word, bits - 1) if set_conditions
|
@cpsr.carry = bit?(word, bits - 1) if set_conditions
|
||||||
word >> bits | word << (32 - bits)
|
word >> bits | word << (32 - bits)
|
||||||
|
|
Loading…
Reference in a new issue