Documente Academic
Documente Profesional
Documente Cultură
●
In 8086 Stack Pointer Points TOP of the stack
●
SS(Base Address) : SP(Offset Address)
●
PUSH Decrements SP once for each byte
●
POP Increments the SP
●
Last in First Out(LIFO)
●
Used in CALL and Interrupts
Procedures Macros
Sequence of Instructions to perform Sequence of Instructions to perform
a specific task which is to be a specific task which is to be
repeatedly used in the program repeatedly used in the program
Accessed with CALL followed by Accessed with the name given to the
PROCEDURE name, Ends with RET MACRO
Loads the new CS:IP from the Set of Instructions written in a Macro
address followed by CALL executes are copied to the called location
the Set of Instructions and returns
back to the next instruction to CALL
after RET
Uses STACK Does not use STACK
Machine Code is generated once Generated each time called
Procedures Macros
Uses PROC and ENDP to define Uses MACRO and ENDM to define
Procedures consumes Lot of time as Macros does not have any control
CALL is to be exectued transfer, executes sequentially
Code Footprint(Size) is less as the Large Code Footprint as the
machine code is generated only Machine code is gerenated for every
once access to Macro
Procedures Macros
Syntax: <name> PROC Syntax: <name> MACRO
.......... ..........
.......... ..........
RET ENDM
<name> ENDP
Access: ........... Access: ...........
........... ...........
CALL <name> <name>
............. .............
●
Type 0: Divide by Zero Interrupt
●
Type 1: Single Step Interrupt (Trap Interrupt)
Trap Flag must be Set
●
●
Type 2: NMI (Non- Maskable Interrupt)
●
Type 3: Breakpoint Interrupt (Single Byte Instruction)
●
Debugging Purpose
●
Placing INT 3 whereever debug Required
●
Type 4: Interrupt on Overflow
●
Occurs if Overflow Flag is Set
●
Stores the Vector Address(Branching Address) of Interrupt
●
Each Interrupt requires 4 Bytes of Space
●
2 Bytes for IP
●
2 Bytes for CS
●
256 Types of Interrupts with 4 Bytes Each = 1 KB
●
00000h to 03FFFh is space for Vector Table
●
Vector Address of INT n is stored in Vector Table having
address
●
IP : 2 bytes at n x 4
●
CS: 2 bytes at (n x 4) +2
●
After interrupt occurs Flag, CS and IP are PUSHED to Stack
●
PUSH PSW
●
PUSH CS
●
PUSH IP
●
IP and CS of Interrupt Service Routine are loaded from the
Vector table depending on type of Interrupt from the address
Type n x 4
●
Executes Interrupt until IRET
●
POPS out IP, CS and Flag from the Stack
●
POP IP
●
POP CS
●
POP PSW
07/08/19 8086 Programming Model - MPMC
Steps Involved in Execution of Interrupt
●
https://www.sites.google.com/site/sripathroykoganti/my-forms
●
D.V.Hall “Microprocessor and Interfacing”, 2nd Edition Tata McGraw
Hill Publishing Company,2006.
●
A.K. Ray & K. M Bhurchandi, “Advanced Microprocessors &
peripherals”, Tata Mc Graw Hill Publishing Company 2002.
●
Rajkamal, “Microcontrollers - Architecture, Programming, Interfacing
& System Design”, 2 nd edition, Pearson Education.