Вы находитесь на странице: 1из 8

OBJECTIVES

To understand the mechanisms involved in program execution in a microprocessor


To understand physical and logical addresses

SOFTWARE
MS-DOS DEBUG program

INTRODUCTION
X86 CPU uses registers to store values and this makes the process faster and cleaner. The main registers
we will be using in the exercise are AX, BX, CX, and DX which are general purpose registers. These are 16
bit registers but they can also be used as 8 bit registers, to use them as 8 bit registers we refer to them
as: AH and AL, which are the high and low byte of the AX register

Exercise 1
4.1
ADDRESS
00D8
2C24
B104
F6E1

MACHINE CODES
ADD
SUB
MOV
MUL

INSTRUCTION
AL, BL
AL, 24
CL, 04
CL

Using the register(R) instruction to check the contents of the microprocessors internal registers. The
contents of AX, BX, CX and IP registers are recorded in row 1.
Row two - after executing ADD AL, BL
Row 3 after executing SUB AL, 24
Row 4 after executing MOV CL, 04
Row 5 after executing MUL CL
Row No.
1
2
3
4
5

IP
0100
0102
0104
0106
0108

AX
0035
009D
0079
0079
01E4

Exercise 2
5.1
2.Using the dump command to display video card information

BX
0068
0068
0068
0068
0068

CX
0000
0000
0000
0004
0004

-d C000:0010
C000:0010 30 30 C4 17 E9 DD 16 A6-40 00 B0 0A 30 30 49 42 00......@...00IB
C000:0020 4D 20 56 47 41 20 43 6F-6D 70 61 74 69 62 6C 65 M VGA Compatible
C000:0030 20 42 49 4F 53 2E 20 03-5B 00 6B 00 79 00 8B C0 BIOS. .[.k.y...
C000:0040 50 43 49 52 86 80 C2 29-00 00 18 00 00 00 00 03 PCIR...)........
C000:0050 60 00 00 00 00 80 00 00-00 67 03 00 C0 00 00 00 `........g......
C000:0060 00 00 00 00 00 00 00 00-00 75 00 00 C0 00 00 00 .........u......
C000:0070 00 00 00 00 00 1A 00 30-03 00 C0 00 00 00 00 00 .......0........
C000:0080 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 04 ................
3.Using the dump to verify the logical addresses 0007:7B90 and 07C0:0000 are pointing to the same
physical address
-d 0007:7B90
0007:7B90 1E 15 4A B8 53 49 EB CD-E8 99 FD 98 03 06 83 56 ..J.SI.........V
0007:7BA0 92 8A C6 E8 C5 FE 8A C2-E9 C0 FE E8 86 FD 8A D0 ................
0007:7BB0 E8 81 FD 8A F0 03 16 83-56 EB E6 24 07 E8 02 FF ........V..$....
0007:7BC0 B0 2C AA 32 C0 E9 FA FE-32 C0 E8 EB FE B0 2C AA .,.2....2.....,.
0007:7BD0 B0 5B AA 33 DB C6 06 AA-56 03 EB A5 E8 F1 FF B0 .[.3....V.......
0007:7BE0 2C AA 32 C0 E9 D1 FE C6-06 A6 56 00 EB 05 C6 06 ,.2.......V.....
0007:7BF0 A6 56 01 24 07 E9 39 FE-C6 05 33 47 C3 E8 A3 01 .V.$..9...3G....
0007:7C00 74 0F BE F3 45 EB 27 E8-99 01 74 05 BE C5 45 EB t...E.'...t...E.
-d 07C0:0000
07C0:0000 1E 15 4A B8 53 49 EB CD-E8 99 FD 98 03 06 83 56 ..J.SI.........V
07C0:0010 92 8A C6 E8 C5 FE 8A C2-E9 C0 FE E8 86 FD 8A D0 ................
07C0:0020 E8 81 FD 8A F0 03 16 83-56 EB E6 24 07 E8 02 FF ........V..$....
07C0:0030 B0 2C AA 32 C0 E9 FA FE-32 C0 E8 EB FE B0 2C AA .,.2....2.....,.
07C0:0040 B0 5B AA 33 DB C6 06 AA-56 03 EB A5 E8 F1 FF B0 .[.3....V.......
07C0:0050 2C AA 32 C0 E9 D1 FE C6-06 A6 56 00 EB 05 C6 06 ,.2.......V.....
07C0:0060 A6 56 01 24 07 E9 39 FE-C6 05 33 47 C3 E8 A3 01 .V.$..9...3G....
07C0:0070 74 0F BE F3 45 EB 27 E8-99 01 74 05 BE C5 45 EB t...E.'...t...E.
4.computing the physical address of logical address 0C10:0010
-d 0C10:0010
0C10:0010 50 53 51 55 57 06 52 8B-E9 89 1E B0 91 88 36 B5
0C10:0020 91 E8 C4 FE 0B C9 74 1C-0B ED 75 05 E8 26 00 EB
0C10:0030 03 E8 B0 01 72 08 5A E8-05 01 07 5F EB 04 83 C4
0C10:0040 06 F9 EB 04 07 5F 5A F9-72 06 5D 59 5B 58 EB 04
0C10:0050 83 C4 08 F9 C3 50 53 52-8B 1E B0 91 83 FB FF 75
0C10:0060 05 E8 2C 00 EB 03 E8 77-00 73 0F B4 59 BB 00 00
0C10:0070 CD 21 32 E4 83 C4 06 F9-EB 10 83 FB FF 74 0B 3B
0C10:0080 C1 74 07 E8 B0 00 83 C4-06 F9 72 03 5A 5B 58 C3

PSQUW.R.......6.
......t...u..&..
....r.Z...._....
....._Z.r.]Y[X..
.....PSR.......u
..,....w.s..Y...
.!2..........t.;
.t........r.Z[X.

We insert zero at the end of the segment which is equivalent to multiplying by 1016
0C100
+ 0010
C110
Using the physical address C110 to look at the memory content
d 0000: C110
-d 0000:C110
0000:C110 50 53 51 55 57 06 52 8B-E9 89 1E B0 91 88 36 B5
0000:C120 91 E8 C4 FE 0B C9 74 1C-0B ED 75 05 E8 26 00 EB
0000:C130 03 E8 B0 01 72 08 5A E8-05 01 07 5F EB 04 83 C4
0000:C140 06 F9 EB 04 07 5F 5A F9-72 06 5D 59 5B 58 EB 04
0000:C150 83 C4 08 F9 C3 50 53 52-8B 1E B0 91 83 FB FF 75
0000:C160 05 E8 2C 00 EB 03 E8 77-00 73 0F B4 59 BB 00 00
0000:C170 CD 21 32 E4 83 C4 06 F9-EB 10 83 FB FF 74 0B 3B
0000:C180 C1 74 07 E8 B0 00 83 C4-06 F9 72 03 5A 5B 58 C3

PSQUW.R.......6.
......t...u..&..
....r.Z...._....
....._Z.r.]Y[X..
.....PSR.......u
..,....w.s..Y...
.!2..........t.;
.t........r.Z[X.

The memory contents of 0C10: 0010 and 0000:C110 are the same.
5. Computing the number of logical address available for physical address 6B00
6B00/1016 =6B0
6B0 + 1 = 6B1
6. The number of segment: offset pairs that point to the same physical location as the segment: offset
pair 0030: 0000

00300
+ 0000
0300
0300/1016 = 030
030 + 1 = 031

Exercise 3
6.1
AH = Register A
AL = Multiplier, Q
BL = Multiplicand, M
CX = Count
ORG 0100
CLC
MOV AH, 00
MOV AL, _25_
MOV BL, _24_
MOV CX, _8_
MOV DL, AL
AND DL, _01_
JZ 0113
ADD __AH_, BL
RCR __CX_, 1
CLC
LOOP 010A
MOV DX, AX
Steps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

BL
00
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24

AH
00
00
00
00
00
24
24
24
24
24
24
48
48
48
48
48

AL
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25

CX
00
00
08
08
08
08
04
04
03
03
03
03
01
01
00
00

DL
00
00
00
01
01
01
01
01
01
01
01
01
01
01
01
25

4.The final value in register DX is _4825

5.Multiplying 25H by 24H

25H in binary = 100101 and 24H is 100100

100101
100100
000000
000000
100101
000000
000000
100101
10100110100

10100110100 = 534H

Conclusion
The skills and knowledge acquired from the experiment is to be able to understand the usage of logical
address which is the segment: offset addressing. I was able to understand how the CPU uses the
segment: offset to increase its register size thereby increasing the addressing capability.
The other skills acquired were the use of the debug program. I was able to learn how the DEBUG
program displays the contents of a block of memory and video card information. I was also able to write
an assembly program using the debug program and stepping through the program to see the changes in
the register contents for each step.

Вам также может понравиться