clean up intruction instantiation and fix tests

This commit is contained in:
Torsten Ruger
2014-05-14 10:47:30 +03:00
parent 46ea1df51e
commit 2230a4f25e
16 changed files with 86 additions and 76 deletions

View File

@@ -18,12 +18,12 @@ module Arm
:tst => 0b1000,
:b => 0b1010,
:bl => 0b1011,
:bx => 0b00010010
:call=> 0b1011
}
#return the bit patter that the cpu uses for the current instruction @attributes[:opcode]
def op_bit_code
OPCODES[@attributes[:opcode]] or throw "no code found for #{@attributes[:opcode].inspect}"
bit_code = OPCODES[@attributes[:opcode]]
bit_code or raise "no code found for #{@attributes[:opcode].inspect}"
end
#codition codes can be applied to many instructions and thus save branches