CS401 - Short Notes Chapter 10
CS401 - Short Notes Chapter 10
COM
CS401-ASSEMBLY LANGUAGE AND PROGRAMMING
CS401 CHAPTER NO 10 (LECTURE 28-29)
PREPARED BY: HTTPS://SUPERSTARWEBTECH.BLOGSPOT.COM/
Note: There is no instruction to set or clear the trap flag like there are instructions for the
interrupt and direction flags.
PUSHF and POPF:
We use two special instructions PUSHF and POPF to push and pop the flag from the stack.
We use PUSHF to place flags on the stack, change TF in this image on the stack and then reload
into the flags register with POPF. The single step interrupt will come after the first instruction
after POPF.
The interrupt mechanism automatically clears IF and TF otherwise there would an infinite
recursion of the single step interrupt.
The TF is set in the flags on the stack so another interrupt will come after one more instruction
is executed after the return of the interrupt.