4. 4
A microprocessor is a computer processor where the data
processing logic and control is included on a single integrated
circuit, or a small number of integrated circuits. The
microprocessor contains the arithmetic, logic, and control
circuitry required to perform the functions of a computer's
central processing unit.
A microcontroller is a small computer on a single VLSI
integrated circuit chip. A microcontroller contains one or more
CPUs along with memory and programmable input/output
peripherals
5. 5
Microprocessor Microcontroller
A microprocessor is the heart of a
computer system
A microcontroller is the heart of an
embedded system
All peripherals need to be connected
separately
All peripherals are embedded into a
single chip
The circuit is complex and bulky The circuit can be simple and compact
High power consumption Low power consumption
Uses external RAM to execute programs Uses flash memory to execute programs
Can not be used in a compact system and
hence not efficient
Can be used in a compact system and
hence efficient
The input and output is not defined The input and output is defined
Cost of the system is higher than
microcontrollers
Cost of the system is low
Used in personal computers, mobile
phones
Used in refrigerators, washing machines
6. 6
Type of Number System Numbers used
Binary 0,1
Octal 0,1,2,3,4,5,6,7
Decimal 0,1,2,3,4,5,6,7,8,9
Hexadecimal 0,1,2,3,4,5,6,7,8,9,A,B,C,
D,E,F
9. 9
General Purpose Temporary Data Special Purpose Sixteen Bit
B, C Temp. Data A PC
D,E W, Z Flag SP
H,L Instruction
Address Bus A0 – A7 & A8 – A15
Data Bus D0 – D7
Control Bus
10. 10
D7 D6 D5 D4 D3 D2 D1 D0
S Z AY P CY
S SIGN
Z ZERO
AY AUXILIARY CARRY
P PARITY
CY CARRY/BORROW
11. 11
OP CODE OPERAND BINARY
CODE
HEX
CODE
TASK
MOV C,A 0100 1111 4F H Move the contents of register
A into register C
MVI A,02 H 0011 1110 3E H Move immediate data 02 into
register A
12. 12
Type Example
Immediate Addressing Mode MVI A, 20H
MVI M,30H
LXI SP 2000H
Register Addressing Mode MOV A, B
SPHL
ADD C
Direct Addressing Mode LDA 2000H
SHLD 3000H
Indirect Addressing Mode LDAX B
MOV M, A
Implied Addressing Mode CMA
RAL
13. 13
Interrupt Type Trigger Priority Makeable Vector Address
TRAP (RST 4.5) Edge & Level 1st – Highest No 0024 H
RST 7.5 Edge 2nd Yes 003C H
RST 6.5 Level 3rd Yes 0034 H
RST 5.5 Level 4th Yes 002C H
INTR Level 5th - Lowest Yes Decided by
hardware
17. 17
NO Flags are affected
1 MOV R1,R2
2 MOV M,R
3 MOV R,M
4 MVI R, DATA
5 MVI M,DATA
6 LXI RP,DATA
7 STAADDR
8 LDAADDR
9 STAX RP
10 LDAX RP
11 LHLD ADDR
12 SHLD ADDR
13 XCHG
18. 18
Sr. No. Instruction Flags affected
1 ADD R ALL
2 ADD M ALL
3 ADI DATA ALL
4 ADC R ALL
5 ADC M ALL
6 ACI DATA ALL
7 DAA ALL
8 SUB R ALL
9 SUB M ALL
10 SUI DATA ALL
11 SBB R ALL
12 SBB M ALL
13 SBI DATA ALL
Sr. No. Instruction Flags affected
14 INR R NCY
15 INR M NCY
16 DCR R NCY
17 DCR M NCY
18 INX RP NF
19 DCX RP NF
20 DAD RP CY
19. 19
Sr. No. Instruction Flags affected
1 ANA R ALL
2 ANA M ALL
3 ANI DATA ALL
4 ORA R ALL
5 ORA M ALL
6 ORI DATA ALL
7 XRA R ALL
8 XRA M ALL
9 XRI DATA ALL
10 CMP R ALL
11 CMP M ALL
12 CPI DATA ALL
13 CMA NF
Sr. No. Instruction Flags affected
14 RLC CY
15 RRC CY
16 RAL CY
17 RAR CY
18 STC CY
19 CMC CY
20. 20
NO Flags are affected
1 JMPADDR
2 JMP COND. ADDR
3 CALL ADDR
4 CALL COND. ADDR
5 RET
6 RET COND.
7 PCHL
8 RST n
22. 22
NO Flags are affected
1 IN PORT
2 OUT PORT
3 XTHL
4 SPHL
5 PUSH RP
6 PUSH PSW
7 POP RP
8 POP PSW (ALL FLAGS)
9 NOP
10 HLT
11 EI
12 DI
13 RIM
14 SIM
23. 23
Controls of DYNA 85L
A C000 Assembly language programme
C000: Program
COON: End of program
ESC Come out of the program
GO C000
4 sec
Space Bar
Execute the program
D C050 Display 8 bits of memory
location starting form C050
Rest
Button
Reset everything and display
start of the panel
24. 24
Program to add two 8 bit numbers
MVI A,20H
MVI B,03H
MVI C,00H
ADD B
JNC NEXT
INR C
NEXT STA C050H
MOV A,C
STA C051H
RST 1/HLT
25. 25
Program to subtract two 8 bit
numbers
MVI A,20H
MVI B,03H
MVI C,00H
SUB B
JNC NEXT
INR C
NEXT STA C050H
MOV A,C
STA C051H
RST 1/HLT
26. 26
Program to find multiplication of
numbers
LXI H,C050H
MVI B,M
INX H
MOV C,M
MVI A,00H
MVI D,00H
BACK ADD B
JNC NEXT
INR D
NEXT DCR C
JNZ BACK
INX H
MOV M,A
INX H
MOV M,D
RST 1
27. 27
Program to store 8 bit numbers into
memory locations
LXI H,C050H
MVI M,01H
INX H
MVI M,02H
INX H
MVI M,03H
INX H
MVI M,04H
INX H
MVI M,05H
INX H
MVI M,06H
INX H
MVI M,07H
INX H
MVI M,08H
RST 3
28. 28
Program to largest of two numbers
LXI H,C050H
MVI A,05H
MOV M,A
MVI A,08H
CMP M
JNC NEXT
MOV A,M
NEXT INX H
MOV M,A
RST 1
29. 29
Program to largest of given numbers
LXI H,C050H
MVI A,00H
MVI B,08H
BACK CMP M
JNC NEXT
MOV A,M
NEXT INX H
DCR B
JNZ BACK
STA C020H
RST 1
30. 30
Program to smallest of given numbers
LXI H,C050H
MVI A,FFH
MVI B,08H
BACK CMP M
JC NEXT
MOV A,M
NEXT INX H
DCR B
JNZ BACK
STA C020H
RST 1
31. 31
Program to arrange the numbers in
ascending order
MVI C,COUNT
DCR C
REPEAT MOV D,C
LXI H,C050H
LOOP MOV A,M
INX H
CMP M
JC SKIP
MOV B,M
MOV M,A
DCX H
MOV M,B
INX H
SKIP DCR D
JNZ LOOP
DCR C
JNZ REPEAT
RST 3
32. 32
Program to arrange the numbers in
descending order
MVI C,COUNT
DCR C
REPEAT MOV D,C
LXI H,C050H
LOOP MOV A,M
INX H
CMP M
JNC SKIP
MOV B,M
MOV M,A
DCX H
MOV M,B
INX H
SKIP DCR D
JNZ LOOP
DCR C
JNZ REPEAT
RST 3