Chapter 4 the first experimental program assignment

Source: Internet
Author: User

Chapter 4 first program
Experiment 3 programming, compilation, connection, and tracking
1. Save the following program as a t1.asm file and generate the executable file t1.exe.
Assume Cs: codesg
Codesg segment
MoV ax, 2000 h
MoV SS, ax
MoV sp, 0
Add SP, 10
Pop ax
Pop BX
PUSH AX
Push BX
Pop ax
Pop BX

MoV ax, 4c00h
Int 21 h

Codesg ends

End

2. Use debugto track the execution process of t1.exe and write the internal

Content on the content and stack top
Debug t1.exe
-R
Ax = 0000 BX = 0000 Cx = 0016 dx = 0000 sp = 0000 BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 0b8d cs = 0b8d IP address = 0000
-T
Ax = 2000 BX = 0000 Cx = 0016 dx = 0000 sp = 0000 BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 0b8d cs = 0b8d IP address = 0003
-T
Ax = 2000 BX = 0000 Cx = 0016 dx = 0000 sp = 0000 BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 0008
-T
Ax = 2000 BX = 0000 Cx = 0016 dx = 0000 sp = 000a BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 000b
-T
Ax = 0000 BX = 0000 Cx = 0016 dx = 0000 sp = 000a BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 000c
-T
Ax = 0000 BX = 0000 Cx = 0016 dx = 0000 sp = 000e BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 000d
-T
Ax = 0000 BX = 0000 Cx = 0016 dx = 0000 sp = 000c BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 000e
-T
Ax = 0000 BX = 0000 Cx = 0016 dx = 0000 sp = 000c BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 0010

-T
Ax = 0000 BX = 0000 Cx = 0016 dx = 0000 sp = 000e BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 0011

-T
Ax = 4c00 BX = 0000 Cx = 0016 dx = 0000 sp = 000e BP = 0000 Si = 0000 di = 0000
DS = 0b7d es = 0b7d Ss = 2000 cs = 0b8d IP = 0014
-P
Program terminated normally

3. Use debug‑t1.exe to view the PSP content.

0b7d: 0 // PSP address
0b8d: 0 // program address
PSP = 0b7d * 16 + 0 = fcbe // physical PSP address
0b7d + 10 h: 0 // CIDR block address and offset address

-D 0b7d: 0 can be viewed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.