bunch of method extraction on instructions

This commit is contained in:
Torsten Ruger
2016-12-14 21:53:26 +02:00
parent 55c108a8d7
commit ec2b0a563e
5 changed files with 63 additions and 59 deletions

View File

@ -32,14 +32,11 @@ module Arm
else
raise "invalid operand argument #{right.inspect} , #{inspect}"
end
result = reg_code(@result)
left_code = reg_code(left)
op = shift_handling
instuction_class = 0b00 # OPC_DATA_PROCESSING
if( opcode == :mul )
operand = reg_code(left) + 0x90
op = reg_code(right) << 8
result = 0
left_code = reg_code(@result)
end
val = shift(operand , 0)
@ -55,6 +52,14 @@ module Arm
assemble_extra
end
def result
opcode == :mul ? 0 : reg_code(@result)
end
def instuction_class
0b00 # OPC_DATA_PROCESSING
end
# Arm can't load any large (over 1024) numbers, or larger with fancy shifting,
# but then the lower bits must be 0's. Especially in constant loading random large numbers
# happen, and so they are split into two instructions. An exection is thrown, that triggers