From 7d52e71f5cad2426c7e0f8e619eba4ea4ff85184 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 29 Sep 2014 20:26:55 +0300 Subject: [PATCH] found and implemented the movw, but not for pi :-( --- lib/arm/move_instruction.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/arm/move_instruction.rb b/lib/arm/move_instruction.rb index 7539c98f..add3c29f 100644 --- a/lib/arm/move_instruction.rb +++ b/lib/arm/move_instruction.rb @@ -51,6 +51,14 @@ module Arm operand = op_with_rot immediate = 1 else + # unfortunately i was wrong in thinking the pi is armv7. The good news is the code below implements + # the movw (armv7) instruciton and works + #armv7 raise "Too big #{right.integer} " if (right.integer >> 16) > 0 + #armv7 operand = (right.integer & 0xFFF) + #armv7 immediate = 1 + #armv7 rn = (right.integer >> 12) + # a little STRANGE, that the armv7 movw (move a 2 byte word) is an old test opcode, but there it is + #armv7 @attributes[:opcode] = :tst raise "No negatives implemented " if right.integer < 0 # and so it continues: when we notice that the const doesn't fit, first time we raise an # error,but set the extra flag, to say the instruction is now 8 bytes