Here i'd like to post some common Assembler commands found in disassembly of several firmwares utilizing ARM CPUs (like MAC7116 of IPC).
The headings of the replies are set to the topic (e.g. "Storing data to memory locations"). In each topic post some samples and explain them.
ARM Assembler Instruction Cheatsheet
Storing data to memory locations
Code: Select all
STRB R1, [R0,#1]
Retrieving data from memory locations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Retrieve a 4 Byte value (32 Bit)
By reading this instruction it's clear what it does, loading register R0 with the value 0xFC000000. What's interesting here is the "=" which denotes that the value is not located next to the LDR opcode itself, but within a range in WORD-boundaries (a WORD is 4 Bytes in ARM-Architecture). In Thumb-Mode, this instruction is only two bytes long, giving the distance to the value itself in WORD counts.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Retrieve a single Byte:
Loads a Byte from memory location "R0+2" (R0 containing the base memory address and the index number 2 given as immediate value) and store it in the lowest Byte of the 32-Bit register R1.
Retrieve a 4 Byte value (32 Bit)
Code: Select all
LDR R0, =0xFC000000
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Retrieve a single Byte:
Code: Select all
LDRB R1, [R0,#2]