SlideShare a Scribd company logo
WELCOME TO OUR
PRESENTATION
Microprocessor and
Assembly Language
Programming
TEAM :ABRACADABRA
1. Afnanul Hassan #161-15-
7213
2. Khaled Akram Sany #161-15-
7203
3.Shami Al Rahad #161-15-
7349
4. Md. Sohanur Rahman Sakib #161-
WHAT IS MICROCOMPUTER?
• System Bus
Microproc
essor ROM RAM input output
Memory
Element
I/O unit
THE MICROPROCESSOR AND ITS
ARCHITECTURE
•ALU (Arithmetic and Logic Unit)
•The Control Unit
•Registers
HDD
RAM
Cache
Memory
Microprocessor
R1 R1
R3
THE PROGRAMMING
MODEL
•Program visible registers
•We can access via programs
•Program invisible registers
•We can not access via
programs
REGISTERS
16 bit Segment registers
EXAMPLE DATA
• If AX = 20A2H then AH = 20H, AL = A2H
• In other words, if AH = 1CH and AL = A2H then AX =
1CA2H
0010 0000 1010 0010
AH AL
AX
THE FLAGS REGISTER
• FLAGS indicate the condition of the MP
• Also control the operations
• FLAGS are upward compatible from 8086/8088 to
Pentium/Pentium Pro
Figure 2.2: The EFLAG and FLAG registers
THE FLAGS
• Carry Flag – C
• C = 1 if there is a carry out from the msb on addition
• Or, there is a borrow into the msb on subtraction
• Otherwise C = 0
• C flag is also affected by shift and rotate instructions
10101010
11101010
111010100 C = 1, in this case
THE FLAGS
• Parity Flag – P
• P = 1 for even parity, if number contains even number
of ones
• P = 0 for odd parity, if odd number of ones
10101010 10101011
P = 1 P = 0
Even number of ones Odd number of ones
Definition changes from microprocessor to microprocessor
THE FLAGS
• Zero Flag – Z
• Z = 1 for zero result
• Z = 0 for non-zero result
• Sign Flag – S
– S = 1 if msb of a result is 1, means
negative number
– S = 0 if msb of a result is 0, means positive
number
THE FLAGS
• Trap Flag – T
• Enables trapping through an on-chip debugging feature
• T = 1 MP interrupts the flow of a program, i.e. debug mode is
enabled
• T = 0 debug mode is disabled
• Direction Flag – D
– Selects increment/decrement mode of SI and/or DI
registers during string instructions
– D = 1, decrement mode, STD (set direction)
instruction used
– D = 0, increment mode, CLD (clear direction)
THE FLAGS
• Overflow Flag – O
• O = 1 if signed overflow occurred
• O = 0 otherwise
• Overflow is associated with the fact of range of numbers
represented in a computer
• 8 bit unsigned number range (0 to 255)
• 8 bit signed number range (-128 to 127)
• 16 bit unsigned number range (0 to 65535)
• 16 bit signed number range (-32768 to 32767)
SIGNED VS. UNSIGNED OVERFLOW
• Let, AX = FFFFh, BX = 0001h and execute
• ADD AX, BX
1111 1111 1111 1111
+ 0000 0000 0000 0001
1 0000 0000 0000 0000
AX
BX
• Unsigned interpretation
– Correct answer is 10000h = 65536
– But this is out of range.
– 1 is carried out of msb, AX = 0000h, which is
wrong
– Unsigned overflow occured
• Signed interpretation
– FFFFh = -1, 0001h = 1, summation is -1+1 = 0
HOW INSTRUCTIONS AFFECT THE
FLAGS?
• Every time the processor executes a instruction, the
flags are altered to reflect the result
• Let us take the following flags and instructions
• Sign Flag – S
• Parity Flag – P
• Zero Flag – Z
• Carry Flag – C
• MOV/XCH
G
• ADD/SUB
• INC/DEC
• NEG
None
All
All except C
All (C = 1 unless result is 0)
EXAMPLE 1
• Let AX = FFFFh, BX = FFFFh and execute ADD
AX, BX FFFFh
+ FFFFh
1 FFFEh
The result stored in AX is FFFEh = 1111 1111 1111 1110
S
P
Z
C
= 1 because the msb is 1
= 0 because the are 15 of 1 bits, odd parity
= 0 because the result is non-zero
= 1 because there is a carry out of the msb on addition
EXAMPLE 2
• Let AX = 8000h, BX = 0001h and execute SUB
AX, BX 8000h
- 0001h
7FFFh
The result stored in AX is 7FFFh = 0111 1111 1111 1111
S
P
Z
C
= 0 because the msb is 0
= 0 because the are 15 of 1 bits, odd parity
= 0 because the result is non-zero
= 0 because there is no carry
SEGMENT REGISTERS
16 bit Segment registers
*
*
*
Segment 1
Segment 2
Segment n
0000hCS
8000hDS
A000hSS
Fig:The programming model of intel 8086 trough the Pentium pro
Microprocessor and assambly language programming
Microprocessor and assambly language programming
Microprocessor and assambly language programming
Microprocessor and assambly language programming
Microprocessor and assambly language programming
Microprocessor and assambly language programming

More Related Content

PPTX
PPTX
Direct memory access (dma) with 8257 DMA Controller
PPTX
DMA and DMA controller
PPTX
Direct Memory Access(DMA)
PPTX
Multiprocessor
PPTX
25. 8255 programmable peripheral interface
PDF
Unit 1 Introduction to Embedded computing and ARM processor
PPTX
Architectural Development Tracks
Direct memory access (dma) with 8257 DMA Controller
DMA and DMA controller
Direct Memory Access(DMA)
Multiprocessor
25. 8255 programmable peripheral interface
Unit 1 Introduction to Embedded computing and ARM processor
Architectural Development Tracks

What's hot (20)

PPTX
Memory mapped I/O and Isolated I/O
PPTX
DMA presentation [By- Digvijay]
PPTX
Computer architecture input output organization
PPTX
2. forward chaining and backward chaining
PPTX
Compiler optimization techniques
PPTX
Multi Processors And Multi Computers
PPTX
Planning in AI(Partial order planning)
PPTX
Shared Memory Multi Processor
PPT
Branch prediction
PPT
04 cache memory.ppt 1
PPTX
Processor organization & register organization
PPTX
Operation of 8255A
PPTX
Multiprocessor architecture
PPT
DDR2 SDRAM
PPTX
DMA operation
PPTX
EC8791 UML-model train controller
PPT
16 control unit
PPT
Context Switching
PPTX
System verilog coverage
PDF
Computer Organization Lecture Notes
Memory mapped I/O and Isolated I/O
DMA presentation [By- Digvijay]
Computer architecture input output organization
2. forward chaining and backward chaining
Compiler optimization techniques
Multi Processors And Multi Computers
Planning in AI(Partial order planning)
Shared Memory Multi Processor
Branch prediction
04 cache memory.ppt 1
Processor organization & register organization
Operation of 8255A
Multiprocessor architecture
DDR2 SDRAM
DMA operation
EC8791 UML-model train controller
16 control unit
Context Switching
System verilog coverage
Computer Organization Lecture Notes
Ad

Similar to Microprocessor and assambly language programming (20)

PPTX
Assembly Language and microprocessor
PPTX
Basic of Firmware & Embedded Software Programming in C
PPTX
Hemanth143
PDF
Instruction types
PPT
Addressing mode and instruction set using 8051
PPTX
Intel 8086
PPTX
Computer organisation powerpoint presentation
PDF
computer organization and assembly language giki course slides
PPTX
PDF
Microprocessor Part 3
PPTX
Microprocessor_theory-Presentation.pptxx
PPT
8085-paper-presentation.ppt
PPT
8086-instruction-set-ppt
PPT
Unit 2 8086 Instruction set.ppt notes good
PDF
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
PPT
8051 MMD Chapter 1.ppt
PPT
Mca i-u-2-overview of register transfer, micro operations and basic computer ...
PPT
overview of register transfer, micro operations and basic computer organizati...
PPT
Instruction set of 8086
PPT
8085 paper-presentation
Assembly Language and microprocessor
Basic of Firmware & Embedded Software Programming in C
Hemanth143
Instruction types
Addressing mode and instruction set using 8051
Intel 8086
Computer organisation powerpoint presentation
computer organization and assembly language giki course slides
Microprocessor Part 3
Microprocessor_theory-Presentation.pptxx
8085-paper-presentation.ppt
8086-instruction-set-ppt
Unit 2 8086 Instruction set.ppt notes good
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
8051 MMD Chapter 1.ppt
Mca i-u-2-overview of register transfer, micro operations and basic computer ...
overview of register transfer, micro operations and basic computer organizati...
Instruction set of 8086
8085 paper-presentation
Ad

Recently uploaded (20)

PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Classroom Observation Tools for Teachers
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Cell Structure & Organelles in detailed.
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
01-Introduction-to-Information-Management.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
master seminar digital applications in india
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Pharma ospi slides which help in ospi learning
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
A systematic review of self-coping strategies used by university students to ...
VCE English Exam - Section C Student Revision Booklet
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Classroom Observation Tools for Teachers
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Cell Structure & Organelles in detailed.
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Microbial disease of the cardiovascular and lymphatic systems
01-Introduction-to-Information-Management.pdf
Computing-Curriculum for Schools in Ghana
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Microbial diseases, their pathogenesis and prophylaxis
Chinmaya Tiranga quiz Grand Finale.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
master seminar digital applications in india
102 student loan defaulters named and shamed – Is someone you know on the list?
Pharma ospi slides which help in ospi learning
Abdominal Access Techniques with Prof. Dr. R K Mishra
A systematic review of self-coping strategies used by university students to ...

Microprocessor and assambly language programming

  • 3. TEAM :ABRACADABRA 1. Afnanul Hassan #161-15- 7213 2. Khaled Akram Sany #161-15- 7203 3.Shami Al Rahad #161-15- 7349 4. Md. Sohanur Rahman Sakib #161-
  • 4. WHAT IS MICROCOMPUTER? • System Bus Microproc essor ROM RAM input output Memory Element I/O unit
  • 5. THE MICROPROCESSOR AND ITS ARCHITECTURE •ALU (Arithmetic and Logic Unit) •The Control Unit •Registers HDD RAM Cache Memory Microprocessor R1 R1 R3
  • 6. THE PROGRAMMING MODEL •Program visible registers •We can access via programs •Program invisible registers •We can not access via programs
  • 8. EXAMPLE DATA • If AX = 20A2H then AH = 20H, AL = A2H • In other words, if AH = 1CH and AL = A2H then AX = 1CA2H 0010 0000 1010 0010 AH AL AX
  • 9. THE FLAGS REGISTER • FLAGS indicate the condition of the MP • Also control the operations • FLAGS are upward compatible from 8086/8088 to Pentium/Pentium Pro Figure 2.2: The EFLAG and FLAG registers
  • 10. THE FLAGS • Carry Flag – C • C = 1 if there is a carry out from the msb on addition • Or, there is a borrow into the msb on subtraction • Otherwise C = 0 • C flag is also affected by shift and rotate instructions 10101010 11101010 111010100 C = 1, in this case
  • 11. THE FLAGS • Parity Flag – P • P = 1 for even parity, if number contains even number of ones • P = 0 for odd parity, if odd number of ones 10101010 10101011 P = 1 P = 0 Even number of ones Odd number of ones Definition changes from microprocessor to microprocessor
  • 12. THE FLAGS • Zero Flag – Z • Z = 1 for zero result • Z = 0 for non-zero result • Sign Flag – S – S = 1 if msb of a result is 1, means negative number – S = 0 if msb of a result is 0, means positive number
  • 13. THE FLAGS • Trap Flag – T • Enables trapping through an on-chip debugging feature • T = 1 MP interrupts the flow of a program, i.e. debug mode is enabled • T = 0 debug mode is disabled • Direction Flag – D – Selects increment/decrement mode of SI and/or DI registers during string instructions – D = 1, decrement mode, STD (set direction) instruction used – D = 0, increment mode, CLD (clear direction)
  • 14. THE FLAGS • Overflow Flag – O • O = 1 if signed overflow occurred • O = 0 otherwise • Overflow is associated with the fact of range of numbers represented in a computer • 8 bit unsigned number range (0 to 255) • 8 bit signed number range (-128 to 127) • 16 bit unsigned number range (0 to 65535) • 16 bit signed number range (-32768 to 32767)
  • 15. SIGNED VS. UNSIGNED OVERFLOW • Let, AX = FFFFh, BX = 0001h and execute • ADD AX, BX 1111 1111 1111 1111 + 0000 0000 0000 0001 1 0000 0000 0000 0000 AX BX • Unsigned interpretation – Correct answer is 10000h = 65536 – But this is out of range. – 1 is carried out of msb, AX = 0000h, which is wrong – Unsigned overflow occured • Signed interpretation – FFFFh = -1, 0001h = 1, summation is -1+1 = 0
  • 16. HOW INSTRUCTIONS AFFECT THE FLAGS? • Every time the processor executes a instruction, the flags are altered to reflect the result • Let us take the following flags and instructions • Sign Flag – S • Parity Flag – P • Zero Flag – Z • Carry Flag – C • MOV/XCH G • ADD/SUB • INC/DEC • NEG None All All except C All (C = 1 unless result is 0)
  • 17. EXAMPLE 1 • Let AX = FFFFh, BX = FFFFh and execute ADD AX, BX FFFFh + FFFFh 1 FFFEh The result stored in AX is FFFEh = 1111 1111 1111 1110 S P Z C = 1 because the msb is 1 = 0 because the are 15 of 1 bits, odd parity = 0 because the result is non-zero = 1 because there is a carry out of the msb on addition
  • 18. EXAMPLE 2 • Let AX = 8000h, BX = 0001h and execute SUB AX, BX 8000h - 0001h 7FFFh The result stored in AX is 7FFFh = 0111 1111 1111 1111 S P Z C = 0 because the msb is 0 = 0 because the are 15 of 1 bits, odd parity = 0 because the result is non-zero = 0 because there is no carry
  • 19. SEGMENT REGISTERS 16 bit Segment registers * * * Segment 1 Segment 2 Segment n 0000hCS 8000hDS A000hSS Fig:The programming model of intel 8086 trough the Pentium pro