Refactored Cpsr to Psr to use the same struct for both cpsr and spsr
Added RegisterBank struct into Armv7tdmi. This struct stores the banked registers. Banked general purpose registers (R8-R14 for fiq and R13-R14 for supervisor, abort, irq, and undefined) are mapped to general purpose registers when in the given mode. For example: when in mode fiq if the CPU accesses R13, it's using the r13_fiq. For this reason, I've added bank_registers to save banked registers depending on the current mode and restore_registers to restore from the bank.
This work is preliminary to implementing PSR instructions and to fix all the instructions already implemented to take into account spsr registers in some specific cases
I'm not 100% sure the idea I came up with the RegisterBank is the best one, we can discuss it here and in any case, we'll see once we'll start using this machinery :D
Cpsr
toPsr
to use the same struct for bothcpsr
andspsr
RegisterBank
struct intoArmv7tdmi
. This struct stores the banked registers. Banked general purpose registers (R8-R14 forfiq
and R13-R14 forsupervisor
,abort
,irq
, andundefined
) are mapped to general purpose registers when in the given mode. For example: when in modefiq
if the CPU accesses R13, it's using ther13_fiq
. For this reason, I've addedbank_registers
to save banked registers depending on the current mode andrestore_registers
to restore from the bank.This work is preliminary to implementing
PSR
instructions and to fix all the instructions already implemented to take into account spsr registers in some specific casesI'm not 100% sure the idea I came up with the
RegisterBank
is the best one, we can discuss it here and in any case, we'll see once we'll start using this machinery :DDocumentation: http://bear.ces.cwru.edu/eecs_382/ARM7-TDMI-manual-pt1.pdf pages from 3-4 to to 3-10 (except THUMB sections)