Professional Documents
Culture Documents
• CPU
• Memory Memory
• I/O CPU
I/O
Motherboard
Microprocessor
Microcontrollers
Memory
ROM RAM
CPU
I/O
Subsystems:
Timers, Counters, Analog
A single chip Interfaces, I/O interfaces
(SoC)
LPC 1768
Microprocessor vs Microcontroller
Microcontrollers
Embedded System
General Block Diagram
Sensor conditioning
Output interfaces
sensor
actuator
Microcontroller
sensor
(uC) indicator
sensor
Embedded systems overview
lens
What is CISC?
• A complex instruction set computer is a computer where single
instructions can perform numerous low-level operations like a
load from memory, an arithmetic operation, and a memory store
or are accomplished by multi-step processes or addressing modes
in single instructions, as its name proposes “Complex Instruction
Set ”.
RISC vs CISC
RISC – Reduced Instruction Set Computer
CISC – Complex Instruction Set Computer
N,Z,C,V flags
Bit No. 31, 30, 29. 28
Addressing Modes
The way in which an operand is specified in an
instruction is called Addressing Mode
V=N or Z=1
AREA data1,DATA
fact DCD 0
end
GCD
LDR R0, =NUM1
LDR R1, =NUM2
LDR R0,[R0]
LDR R1,[R1]
UP CMP R0, R1 While (a != b)
BEQ EXIT {
SUBHI R0,R1 If (a > b)
SUBLO R1,R0 a = a-b;
B UP Else if (b > a)
EXIT LDR R2,=GCD b = b-a;
STR R0, [R2] }
Load and Store Multiple
Load and Store Multiple
0x10000000 98
LDR R1, =0x10000000 0x10000001 76
LDM R1, {R2,R4,R6} 0x10000002 54
R2 = 0x32547698 0x10000003 32
R4 = 0xFEFFFFFF 0x10000004 FF
0x10000005 FF
R6 = 0xEFCDAB89
0x10000006 FF
R1= 0x10000000
0x10000007 FE
---------------------
0x10000008 89
In case of !
0x10000009 AB
LDM R1!, {R2,R4,R6} 0x1000000A CD
R1=0x1000000C 0x1000000B EF
0x1000000C
0x1000000D
0x1000000E
0x1000000F
Load and Store Multiple
0x10000000 98
LDR R1, =0x10000000 0x10000001 76
LDR R2, = 0x32547698 0x10000002 54
LDR R4, =0xFEFFFFFF 0x10000003 32
LDR R6, = 0xEFCDAB89 0x10000004 FF
0x10000005 FF
STM R1, {R2,R4,R6}
0x10000006 FF
R1= 0x10000000
0x10000007 FE
----------------
0x10000008 89
In case of !
0x10000009 AB
STM R1!, {R2,R4,R6} 0x1000000A CD
R1=0x1000000C 0x1000000B EF
0x1000000C
0x1000000D
0x1000000E
0x1000000F
Load and Store Multiple
Load and Store Multiple
0x10000000 98
LDR R1, =0x1000000C 0x10000001 76
LDMDB R1, {R2,R4,R6} 0x10000002 54
R2 = 0x32547698 0x10000003 32
R4 = 0xFEFFFFFF 0x10000004 FF
0x10000005 FF
R6 = 0xEFCDAB89
0x10000006 FF
R1= 0x1000000C
0x10000007 FE
------------
0x10000008 89
In case of !
0x10000009 AB
LDMDB R1!, {R2,R4,R6} 0x1000000A CD
R1=0x10000000 0x1000000B EF
0x1000000C
0x1000000D
0x1000000E
0x1000000F
Load and Store Multiple
0x10000000 98
LDR R1, =0x1000000C 0x10000001 76
LDR R2, = 0x32547698 0x10000002 54
LDR R4, =0xFEFFFFFF 0x10000003 32
LDR R6, = 0x32547698 0x10000004 FF
0x10000005 FF
STMDB R1, {R2,R4,R6}
0x10000006 FF
R1= 0x1000000C
0x10000007 FE
--------------
0x10000008 89
0x10000009 AB
In case of ! 0x1000000A CD
STMDB R1!, {R2,R4,R6} 0x1000000B EF
R1=0x10000000 0x1000000C
0x1000000D
0x1000000E
0x1000000F
Fully Ascending Stack
0x10000000 98
LDR R13, =0x10000000 0x10000001 76
LDR R2, = 0x32547698 0x10000002 54
LDR R4, =0xFEFFFFFF 0x10000003 32
LDR R6, = 0x32547698 0x10000004 FF
0x10000005 FF
STM R13!, {R2,R4,R6}
0x10000006 FF
R13= 0x1000000C
0x10000007 FE
MOV R2, #0
0x10000008 89
MOV R4, #0
0x10000009 AB
MOV R6, #0 0x1000000A CD
LDMDB R13!, {R2,R4,R6} 0x1000000B EF
R13=0x10000000 0x1000000C
0x1000000D
0x1000000E
SP increments for PUSH 0x1000000F
SP decrements for POP
Fully Descending Stack
0x10000000 98
LDR R13, =0x1000000C 0x10000001 76
LDR R2, = 0x32547698 0x10000002 54
LDR R4, =0xFEFFFFFF 0x10000003 32
LDR R6, = 0x32547698 0x10000004 FF
0x10000005 FF
STMDB R13!, {R2,R4,R6}
0x10000006 FF
R13= 0x10000000
0x10000007 FE
MOV R2, #0
0x10000008 89
MOV R4, #0
0x10000009 AB
MOV R6, #0 0x1000000A CD
LDM R13!, {R2,R4,R6} 0x1000000B EF
R13=0x1000000C 0x1000000C
0x1000000D
0x1000000E
SP decrements for PUSH 0x1000000F
SP increments for POP