diff python/ppci/target/arm/__init__.py @ 375:19eacf4f7270

Started on memory manager
author Windel Bouwman
date Sun, 23 Mar 2014 15:44:06 +0100
parents c49459768aaa
children 6df89163e114
line wrap: on
line diff
--- a/python/ppci/target/arm/__init__.py	Fri Mar 21 15:27:18 2014 +0100
+++ b/python/ppci/target/arm/__init__.py	Sun Mar 23 15:44:06 2014 +0100
@@ -9,6 +9,7 @@
 from .instructions import B, Bl, Ble, Bgt, Beq, Blt, Cmp, Cmp2
 from .instructions import Push, Pop, Str, Ldr, Ldr3, Str1, Ldr1, Adr
 from .instructions import Mcr, Mrc
+from .instructions import LdrPseudo
 from .selector import ArmInstructionSelector
 from .frame import ArmFrame
 
@@ -154,6 +155,10 @@
         self.add_instruction(['ldr', 'reg', ',', 'ID'],
             lambda rhs: Ldr(rhs[1], rhs[3].val))
 
+        # This is a pseudo instruction:
+        self.add_instruction(['ldr', 'reg', ',', '=', 'ID'],
+            lambda rhs: LdrPseudo(rhs[1], rhs[4].val))
+
         self.add_keyword('str')
         self.add_instruction(['str', 'reg', ',', '[', 'reg', ',', 'imm8', ']'],
             lambda rhs: Str(rhs[1], rhs[4], rhs[6]))
@@ -165,6 +170,7 @@
         self.add_instruction(['adr', 'reg', ',', 'ID'],
             lambda rhs: Adr(rhs[1], rhs[3].val))
 
+
         # Register list grammar:
         self.add_rule('reg_list', ['{', 'reg_list_inner', '}'],
             lambda rhs: rhs[1])