CPU 8086
ORG 0400H
SECTION CODE:
MOV AX, 0460H
MOV SP, AX
MOV AX, 1
MOV BX, 2
MOV CX, 3
MOV DX, 4
MOV WORD[DATA1], 7
PUSH AX
PUSH BX
PUSH CX
PUSH DX
INT3
POP AX
POP BX
POP CX
POP DX
POP WORD [SUM]
INT3
SECTION DATA:
DATA1 DW 7,9,10,11,12
SECTION BSS:
SUM DW 3
Demonstrate the following:
1) Run the program. It will run up to the first INT3 (break point). at this time, show and write the content of stack, register, and variables.
2) comment out the first INT3. Run the program again. At this time, show and write the content of stack, registers, and variables
1) Before the first INT3 (break point):
Content of stack:
- SP: 0460H (points to the top of stack)
- Top of stack: 0000H (empty)
Content of registers:
- AX: 0000H
- BX: 0000H
- CX: 0000H
- DX: 0000H
Content of variables:
- DATA1: 7,9,10,11,12
- SUM: 3
2) After commenting out the first INT3 and running the program again:
Content of stack:
- SP: 0462H (points to the top of stack)
- Top of stack: 0000H (empty)
Content of registers:
- AX: 0001H
- BX: 0002H
- CX: 0003H
- DX: 0004H
Content of variables:
- DATA1: 7,9,10,11,12
- SUM: 3
To demonstrate the program execution and the content of stack, registers, and variables at different points, let's go step-by-step.
1) Before first INT3 (break point):
- Stack: (bottom) 0460H, 0000H, 0002H, 0003H, 0004H, 0007H (top) *(Pushed values from registers AX, BX, CX, DX)*
- Registers: AX = 0001H, BX = 0002H, CX = 0003H, DX = 0004H
- Variables: DATA1: 7,9,10,11,12, SUM: 3
2) After the first INT3 (break point):
- Stack: (bottom) 0460H, 0000H, 0002H, 0003H, 0004H, 0007H (top)
- Registers: AX = 0001H, BX = 0002H, CX = 0003H, DX = 0004H
- Variables: DATA1: 7,9,10,11,12, SUM: 3
3) Comment out the first INT3 and run the program again.
Post running the program again, the content of stack, registers, and variables will be as follows:
- Stack: (bottom) 0460H, 0000H, 0002H, 0003H, 0004H, 0007H (top) *(Same values as before)*
- Registers: AX = 0001H, BX = 0002H, CX = 0003H, DX = 0004H
- Variables: DATA1: 7,9,10,11,12, SUM: 3
Please note that commenting out the INT3 instruction will not affect the stack, registers, or variables in this case, as the program flow will continue execution without any interruption.