ARM Basic Help
ARM Basic Help
cpsr
spsr spsr spsr spsr spsr
Current Visible Registers
r0
IRQ Mode r1
r2
r3 Banked out Registers
r4
r5
r6 User FIQ SVC Undef Abort
r7
r8 r8
r9 r9
r10 r10
r11 r11
r12 r12
r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp)
r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr)
r15 (pc)
cpsr
spsr spsr spsr spsr spsr
Current Visible Registers
r0
FIQ Mode r1
r2
r3 Banked out Registers
r4
r5
r6 User IRQ SVC Undef Abort
r7
r8 r8
r9 r9
r10 r10
r11 r11
r12 r12
r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp)
r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr)
r15 (pc)
cpsr
spsr spsr spsr spsr spsr
Current Visible Registers
r0
SVC Mode
r1
r2
r3 Banked out Registers
r4
r5
r6 User FIQ IRQ Undef Abort
r7
r8 r8
r9 r9
r10 r10
r11 r11
r12 r12
r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp)
r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr)
r15 (pc)
cpsr
spsr spsr spsr spsr spsr
Current Visible Registers
r0
Abort Mode
r1
r2
r3 Banked out Registers
r4
r5
r6 User FIQ IRQ SVC Undef
r7
r8 r8
r9 r9
r10 r10
r11 r11
r12 r12
r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp)
r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr)
r15 (pc)
cpsr
spsr spsr spsr spsr spsr
Basic instructions
LDRSH
LDRSB
VAL1 RN R1
VAL2 RN R2
SUM RN R3
Note: load address to register : ADR R2, OUR_FIXED_DATA ;point to OUR_FIXED_DATA ---------- (Pseudo Instruction)
DCB 0x55,0x33,1,2,3,4,5,6
DCD 0x23222120,0x30
DCW0x4540,0x50
Space directive: allocates memory without initial value
;R2 = B
AREA OUR_PROG,CODE,READONLY
LDR R0,=B
;A = 5
LDR R2,[R0]
LDR R0,=A ;R0 = Addr. of A
MOV R1,#5
;C = R1 + R2 , (C = A + B)
STR R1,[R0]
ADD R3,R1,R2
LDR R0,=C
;B = 4
STR R3,[R0]
LDR R0,=B
loop B loop
MOV R1,#4
STR R1,[R0] ;
Align directive
Used to make sure data is aligned on the 32bit word or 16 bit half
word address boundary.
All arm processor have multiplications but not all have division
BIC Rd, Rn, Op2 ; clear certain bits of Rn specified by the Op2 and
place the result in Rd
OP2>RN V=N
OP2=RN Z=1
OP2<RN V != N