MarSoft / pebble-firmware-utils

Some tools used for Pebble firmware.
GNU General Public License v2.0
139 stars 12 forks source link

Patcher rewrite #4

Closed MarSoft closed 10 years ago

MarSoft commented 10 years ago

Assembler structure: instructions are parsed to following: [ ['MOV', Reg('R0'), Int(0x102)], ['LDR, Reg('R4'), [Reg('SP'), Label('text')], ... ] Then each record is sequentially tested against all defined instructions

MarSoft commented 10 years ago

Instructions should be defined as follows: mask (opcode(s), operand types); proc. Proc gets operands as arguments and optionally also opcode, and returns either integer of (int, int) for twobyte instructions. Possible operand types are: Reg, Reg(Lo), Reg(Hi), Reg('SP')...; Int, Int(7 bytes), Int(0x29)...; Label; String (do we need it? if yes, then it will not be passed to proc, but only used as mask) Proc may be lambda calling some other proc with custom args.

MarSoft commented 10 years ago

Done.