Assembly Language Programming:
1. Introduction
Prepared by:
Md. Jahidul Islam (Lecturer, Dept. of CSE, UIU.)
Special Thanks to:
Muhammad Tasnim Mohiuddin (Lecturer, Dept. of CSE, UIU.)
April 2015.
Department of Computer Science & Engineering (CSE), United International University (UIU).
Programming Languages
1) Machine Language
2) Assembly Language (Low Level Language)
3) High Level Languages
April 2015.
Department of Computer Science & Engineering (CSE), United International University (UIU).
Simple Computer Model
April 2015.
Department of Computer Science & Engineering (CSE), United International University (UIU).
Inside the CPU
April 2015.
Department of Computer Science & Engineering (CSE), United International University (UIU).
CPU Registers
• General purpose registers
• Segment registers
• Instruction Pointer
• Flags register
• Special purpose registers
oDebug registers
oMachine Control registers
April 2015.
Department of Computer Science & Engineering (CSE), United International University (UIU).
6
 AX (accumulator register):
 Stores operands for arithmetic & data transfer instructions.
 BX Register (base register):
 Holds the starting base address of a memory within a data segment.

CX Register (counter register):
 Primarily used in loop instruction to store loop counter.

DX Register (data register)
 Used to contain I/O port address for I/O instruction.
General Purpose Registers
7
General Purpose Registers (contd.)
 Each of these 16-bit registers are further subdivided into two 8-bit
registers.
AH AL
BH BL
CH CL
DH DL
AX
BX
CX
DX
8
Memory Segmentation
 Data Segment
 contains variable definitions
 declared by .DATA
 Stack segment
 used to store the stack
 declared by .STACK size
 default stack size is 1KB.
 Code segment
 contains program’s instructions
 declared by .CODE
Extra segment

DS
CS
SS
ES
64 KB
64 KB
64 KB
8086 Memory
64 KB
Flag Register
9
 Flag register determines the current status of the microprocessor.
 It is modified automatically by CPU after mathematical operations.
 This allows to determine the type of the result.
 8086 has 16-bit Flag register.
 There are two kinds of flags: Status Flags and Control Flags
Flag Register (contd.)
10
Status Flags Control Flags
Carry Flag (CF) Trap Flag
Auxiliary-carry Flag (AF) Interrupt Flag
Zero Flag (ZF) Directional Flag
Sign Flag (SF)
Parity Flag (PF)
Overflow Flag (OF)
Flag Register (contd.)
11
Flag Purpose
Carry (CF) CF = 1 if there is a carry out from the MSB on addition or there
is a Borrow into the MSB on subtraction.
Parity (PF) PF=1 if the low byte of a result has an even number of one bits
(even parity).
Auxiliary (AF) Holds the carry (half–carry) after addition or borrow after
subtraction between bit positions 3 and 4 of the result
(for example, in BCD addition or subtraction.)
Zero (ZF) Shows the result of the arithmetic or logic operation.
Z=1; result is zero. Z=0; The result is 0
Sign (SF) Holds the sign of the result after an arithmetic/logic instruction
execution. SF=1 if the MSB of a result is 1.
Flag Register (contd.)
12
Flag Purpose
Trap (TF) Enables the trapping through an on-chip debugging feature.
Interrupt (IF)
Controls the operation of the INTR (interrupt request)
IF = 0 if the INTR pin is disabled
IF = 1, if the INTR pin isenabled.
Direction (DF)
Selects either the increment or decrement mode for DI
and /or SI registers during the string instructions.
Overflow (OF)
Overflow occurs when signed numbers are added or
subtracted. An overflow indicates the result has exceeded
the capacity of the machine.
13
 Stack Pointer (SP)
 A 16-bit register pointing to program stack
 Base Pointer (BP)
 A 16-bit register used to access data in stack segment
 Usually used for based indexed or register indirect addressing
 Source Index (SI) & Destination Index (DI)
 16-bit registers
 Used to point to memory locations in the data segment
Pointer and Index Registers
Any Questions?
Thank You
April ,2015.
Department of Computer Science & Engineering (CSE), United International University (UIU).

More Related Content

PPT
Assembly Language Basics
PPTX
Advanced procedures in assembly language Full chapter ppt
PPSX
Assembly language programming
PPTX
Lecture 4 assembly language
PDF
Assembly language part I
PPTX
Assembly Language -I
PPT
Lec 04 intro assembly
PPTX
Assembly 8086
Assembly Language Basics
Advanced procedures in assembly language Full chapter ppt
Assembly language programming
Lecture 4 assembly language
Assembly language part I
Assembly Language -I
Lec 04 intro assembly
Assembly 8086

What's hot (20)

PPT
8086 assembly language
PDF
system software 16 marks
PPTX
Chapter 5 programming concepts iv
POT
Arrays and addressing modes
PPTX
Two pass Assembler
PPT
Assembly language programming_fundamentals 8086
PPTX
Intermediate code- generation
PDF
8086 assembly
PPTX
Chapter 4 programming concepts III
PPTX
Microprocessor chapter 9 - assembly language programming
PDF
Assembler directives and basic steps ALP of 8086
PPTX
Addressing modes
PPTX
Code generation
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
PPTX
Computer architecture instruction formats
PPTX
Chapter 1 archietecture of 8086
PPTX
Chapter 2 programming concepts - I
PDF
Compiler unit 4
PDF
Examinable Question and answer system programming
DOCX
MASM -UNIT-III
8086 assembly language
system software 16 marks
Chapter 5 programming concepts iv
Arrays and addressing modes
Two pass Assembler
Assembly language programming_fundamentals 8086
Intermediate code- generation
8086 assembly
Chapter 4 programming concepts III
Microprocessor chapter 9 - assembly language programming
Assembler directives and basic steps ALP of 8086
Addressing modes
Code generation
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Computer architecture instruction formats
Chapter 1 archietecture of 8086
Chapter 2 programming concepts - I
Compiler unit 4
Examinable Question and answer system programming
MASM -UNIT-III
Ad

Viewers also liked (20)

PPT
Complement
PPT
Complements
PPTX
1's and 2's complement
PPTX
Binary Arithmetic Presentation about Binary Numbers 2015
PPTX
Binary arithmetic
PPT
binary arithmetic rules
PPTX
Introduction number systems and conversion
PPT
Arithmetic & logical operations in 8051
PPT
Logic gates
PPT
Conversion of number system
PPTX
Conversion binary to decimal
PPTX
1s and 2s complement
PPT
BINARY NUMBER SYSTEM
PPTX
Number System
PPT
08. Numeral Systems
PPTX
Number system
PPTX
number system
PPT
Decimal to binary number
PPT
Number System
Complement
Complements
1's and 2's complement
Binary Arithmetic Presentation about Binary Numbers 2015
Binary arithmetic
binary arithmetic rules
Introduction number systems and conversion
Arithmetic & logical operations in 8051
Logic gates
Conversion of number system
Conversion binary to decimal
1s and 2s complement
BINARY NUMBER SYSTEM
Number System
08. Numeral Systems
Number system
number system
Decimal to binary number
Number System
Ad

Similar to Assembly language programming intro (20)

DOCX
Introduction to CPU registers
PPTX
Register introduction
PPT
programmer model and registers of 8086.ppt
PPT
programmer model and registers of 8086.ppt
PPTX
SAQIB ALI.pptx
PPTX
Registers
PPT
26677766 8086-microprocessor-architecture
PDF
N_Asm Assembly registers (sol)
PPTX
CH-02 8086-microprocessor-architecture.pptx
PPTX
Register & flags
PPT
Advanced micro -processor
PPTX
Microprocessor 8086 and Microcontoller
PPTX
PPTX
register
PPTX
INTEL 8086 MP Architecture
PPTX
Flag registers, addressing modes, instruction set
PPTX
Microprocessor_theory-Presentation.pptxx
PPTX
Lecture_3.1 Registers.pptx....................
DOCX
Intel Microprocessors 8086 Documentation
Introduction to CPU registers
Register introduction
programmer model and registers of 8086.ppt
programmer model and registers of 8086.ppt
SAQIB ALI.pptx
Registers
26677766 8086-microprocessor-architecture
N_Asm Assembly registers (sol)
CH-02 8086-microprocessor-architecture.pptx
Register & flags
Advanced micro -processor
Microprocessor 8086 and Microcontoller
register
INTEL 8086 MP Architecture
Flag registers, addressing modes, instruction set
Microprocessor_theory-Presentation.pptxx
Lecture_3.1 Registers.pptx....................
Intel Microprocessors 8086 Documentation

Recently uploaded (20)

PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PPTX
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
PDF
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
PPTX
mechattonicsand iotwith sensor and actuator
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
Principal presentation for NAAC (1).pptx
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PPTX
Module 8- Technological and Communication Skills.pptx
PPTX
Feature types and data preprocessing steps
PPTX
Measurement Uncertainty and Measurement System analysis
PDF
MLpara ingenieira CIVIL, meca Y AMBIENTAL
PDF
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
PDF
Java Basics-Introduction and program control
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
wireless networks, mobile computing.pptx
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
Computer System Architecture 3rd Edition-M Morris Mano.pdf
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
mechattonicsand iotwith sensor and actuator
Information Storage and Retrieval Techniques Unit III
Principal presentation for NAAC (1).pptx
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Exploratory_Data_Analysis_Fundamentals.pdf
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Module 8- Technological and Communication Skills.pptx
Feature types and data preprocessing steps
Measurement Uncertainty and Measurement System analysis
MLpara ingenieira CIVIL, meca Y AMBIENTAL
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
Java Basics-Introduction and program control
Soil Improvement Techniques Note - Rabbi
wireless networks, mobile computing.pptx

Assembly language programming intro

  • 1. Assembly Language Programming: 1. Introduction Prepared by: Md. Jahidul Islam (Lecturer, Dept. of CSE, UIU.) Special Thanks to: Muhammad Tasnim Mohiuddin (Lecturer, Dept. of CSE, UIU.) April 2015. Department of Computer Science & Engineering (CSE), United International University (UIU).
  • 2. Programming Languages 1) Machine Language 2) Assembly Language (Low Level Language) 3) High Level Languages April 2015. Department of Computer Science & Engineering (CSE), United International University (UIU).
  • 3. Simple Computer Model April 2015. Department of Computer Science & Engineering (CSE), United International University (UIU).
  • 4. Inside the CPU April 2015. Department of Computer Science & Engineering (CSE), United International University (UIU).
  • 5. CPU Registers • General purpose registers • Segment registers • Instruction Pointer • Flags register • Special purpose registers oDebug registers oMachine Control registers April 2015. Department of Computer Science & Engineering (CSE), United International University (UIU).
  • 6. 6  AX (accumulator register):  Stores operands for arithmetic & data transfer instructions.  BX Register (base register):  Holds the starting base address of a memory within a data segment.  CX Register (counter register):  Primarily used in loop instruction to store loop counter.  DX Register (data register)  Used to contain I/O port address for I/O instruction. General Purpose Registers
  • 7. 7 General Purpose Registers (contd.)  Each of these 16-bit registers are further subdivided into two 8-bit registers. AH AL BH BL CH CL DH DL AX BX CX DX
  • 8. 8 Memory Segmentation  Data Segment  contains variable definitions  declared by .DATA  Stack segment  used to store the stack  declared by .STACK size  default stack size is 1KB.  Code segment  contains program’s instructions  declared by .CODE Extra segment  DS CS SS ES 64 KB 64 KB 64 KB 8086 Memory 64 KB
  • 9. Flag Register 9  Flag register determines the current status of the microprocessor.  It is modified automatically by CPU after mathematical operations.  This allows to determine the type of the result.  8086 has 16-bit Flag register.  There are two kinds of flags: Status Flags and Control Flags
  • 10. Flag Register (contd.) 10 Status Flags Control Flags Carry Flag (CF) Trap Flag Auxiliary-carry Flag (AF) Interrupt Flag Zero Flag (ZF) Directional Flag Sign Flag (SF) Parity Flag (PF) Overflow Flag (OF)
  • 11. Flag Register (contd.) 11 Flag Purpose Carry (CF) CF = 1 if there is a carry out from the MSB on addition or there is a Borrow into the MSB on subtraction. Parity (PF) PF=1 if the low byte of a result has an even number of one bits (even parity). Auxiliary (AF) Holds the carry (half–carry) after addition or borrow after subtraction between bit positions 3 and 4 of the result (for example, in BCD addition or subtraction.) Zero (ZF) Shows the result of the arithmetic or logic operation. Z=1; result is zero. Z=0; The result is 0 Sign (SF) Holds the sign of the result after an arithmetic/logic instruction execution. SF=1 if the MSB of a result is 1.
  • 12. Flag Register (contd.) 12 Flag Purpose Trap (TF) Enables the trapping through an on-chip debugging feature. Interrupt (IF) Controls the operation of the INTR (interrupt request) IF = 0 if the INTR pin is disabled IF = 1, if the INTR pin isenabled. Direction (DF) Selects either the increment or decrement mode for DI and /or SI registers during the string instructions. Overflow (OF) Overflow occurs when signed numbers are added or subtracted. An overflow indicates the result has exceeded the capacity of the machine.
  • 13. 13  Stack Pointer (SP)  A 16-bit register pointing to program stack  Base Pointer (BP)  A 16-bit register used to access data in stack segment  Usually used for based indexed or register indirect addressing  Source Index (SI) & Destination Index (DI)  16-bit registers  Used to point to memory locations in the data segment Pointer and Index Registers
  • 14. Any Questions? Thank You April ,2015. Department of Computer Science & Engineering (CSE), United International University (UIU).