![]() |
![]() |
![]() |
I find most emulators out there very strict when it comes to running code. Sometimes you just want to find out what kind of result some instructions will give you. Hence I've begun programming my own userland ARM emulator specifically targeted ARMv4 (no thumbcode). If anyone wants to jump on the bandwagon, feel free. I can get a svn server up in no time. I'm playing around in C++ for now. I might change to C99 later if it becomes necessary.
I have all the documentation one needs. http://www.mechcore.net/docs/arm/
Here are the opcodes I plan to implement first. Co-processor opcodes are omited. SWI will emulate the most important syscalls for a 2.4 kernel. (The syscall system in Linux was totally revamped in 2.6.16 IIRC)
ADC - Add two 32-bit values with carry
ADD -
AND - Logical Bitwise AND of two 32-bit values
B - Branch relative
BIC - Logical Bit Clear (AND NOT) of two 32-bit values
BL - Relative branch with Link (save link register)
CMN - Compare Negative two 32-bit values
CMP - Compare Positive two 32-bit values
EOR - Logical exclusive OR of two 32-bit values
LDM - Load Multiple (from stack to registers. use sp)
LDR - Load Single from virtual memory
MLA - Multiply and Accumulate
MOV -
MRS - Move to ARM register from Status Register (CPSR or SPSR)
MSR - Move to Status Register from ARM register
MUL
MVN - Move Logical NOT of two 32-bit values
ORR - Logical Bitwise OR of two 32-bit values
RSB - Reverse Subtract of two 32-bit values
RSC - Reverse Subtract with Carry of two 32-bit values
SBC - Subtract with carry of two 32-bit values
SMLAL - Signed Multiply with Accumulate (64-bit result)
SMULL - Signed Multiply (64-bit result)
STM - Store Multiple (from register to stack)
STR - Store register to virtual memory
SUB -
SWI - Software Interrupt
TEQ - Test for equality of two 32-bit values
TST - Test for bits in a 32-bit value
UMLAL - Unsigned Multiply with Accumulate (64-bit result)
UMULL - Unsigned Multiply (64-bit result)