8051&ARM
8051&ARM
8051&ARM
Microprocessor Microcontroller
Addressing modes
22
Direct addressing mode
The location 00h to 7Fh to address the
internal RAM .
SFR addresses from 80h to FF h
23
Continue…
Ex:-
MOV R0,40H // save content of RAM
location 40h into R0.
MOV 56H,A // save content of A in
RAM location 56H.
Register indirect addressing mode
31
External addressing mode
or Indexed addressing mode
E.g.
MOVC A,@A+DPTR
MOVC A,@A+PC
33
External addressing mode
or Indexed addressing mode
(b) Data access (RAM access)
ORG 00H
MOV R0,50H ;get memory location in memory pointer R0
MOV R1,51H ;get memory location on memory pointer
register R1
MOV A,@R0 ;get content of memory location 50H to
accumulator
ADD A,@R1 ;add content of A with content of memory
location 51H and store result in A
MOV R0,52H ;get 52H to memory pointer R0
MOV@R0,A ;copy content of A to memory location 52H
END
Multiplication and Division
Program
ORG 00H
MOV A,51H ;get content of memory location 51H to accumulator
MOV 0F0H,52H;get content of memory location 52H to B register
MUL AB ;multiply content of A with content of B
MOV 53H,A ;get lower order byte of product in memory location 53H
MOV54H,0F0H ;get higher order byte of product in memory location
in 54H
MOV A,51H ;get content of memory location 51H to accumulator
MOV 0F0H,52H ;get content of memory location 52H to register B
DIV AB ;divide content of register A with register B
MOV 55H,A ;Copy quotient of result to memory location 55H
MOV 56H,0F0H ;copy remainder of result to memory location 56H
END
The two legal operations that can be done with B register
is MUL AB and DIV AB. For using any other operation we
must use address of B register 0F0H.
Load/store architecture
A large array of uniform registers
Fixed-length 32-bit instructions
3-address instructions
ARM architecture
Registers
Only 16 registers are visible to a specific
mode. A mode could access
A particular set of r0-r12
r13 (sp, stack pointer)
r14 (lr, link register)
r15 (pc, program counter)
Current program status register (cpsr)
SPSR
The uses of r0-r13 are orthogonal
General-purpose registers
31 24 23 16 8 0
15 7
8-bit Byte
16-bit Half word
32-bit word
•6 data types
(signed/unsigned)
•All ARM operations are
32-bit. Shorter data types are
only supported by data transfer
operations.
Program counter
mode
overflow bits
Thumb
carry/borro state FIQ
w zero disable
negativ IRQ
e disable
Processor modes
Register organization
Instruction sets
• ARM/Thumb/
Jazelle
Pipeline
ARM7
ARM9
In execution, pc always 8 bytes
ahead
Pipeline
Interrupt
handlers
code
Interrupts
Addressing modes
1. Immediate addressing mode
2. Register addressing mode
3. Direct addressing mode
4. Indirect addressing mode
5. Register relative indirect addressing mode
6. Based indexed indirect addressing mode
7. Base with scaled index indirect addressing mode
With examples.
Thank you