|
|
Unfortunately, each type of CPU (processor) has different names for its registers
Example:
CPU Name of some of the registers ------------------- ------------------------------- Intel processor rax, rbx, rcx, rdx, ... ARM processor r0, r1, r2, r3, ... |
When you write an assembler program, you will need to use the registers in the CPU inside your assembler program
Because the registers' names are different for different processor type, the assembler programs written for one type of processor cannot be compiled and run on another type of processor
Fortunately:
|
|
We will learn assembler programming using the ARM processor.
So I will describe these properties of the ARM registers now.
I will explain the use of the register below.
|
|
Although register R11 is a "general purpose" register, in practice, we have assign it for a specific purpose....
So register R11 may be considered as a special purpose register (i.e.: don't use register r11 to store value for computation !)
|
ARM register Commonly used register name in assembler programming --------------- ------------------------------------------------------ R0 r0 or R0 R1 r1 or R1 R2 r2 or R2 R3 r3 or R3 R4 r4 or R4 R5 r5 or R5 R6 r6 or R6 R7 r7 or R7 R8 r8 or R8 R9 r9 or R9 R10 r10 or R10 R11 fp (frame pointer) R12 ip (intra procedure) R13 sp (stack pointer) R14 lr (link register) R15 pc (program counter) |
Assembler programs will not use the CPSR register directly and will therefore not refer to the CPSR register by a register name.