Sie sind auf Seite 1von 10

.Model tiny . code .

starup MOV AX, 5000h MOV ES, AX MOV AX, 6000h MOV BX, 7000h MOV CX, 8000h MOV DX, 9000h MOV DI, 0700h MOV BP, 0800h MOV SI, 0002h MOV SP, 6000h PUSH AX PUSH BX

Za id
PUSH DX POP DX PUSH SI PUSH SX PUSH BP PUSH SP POP DI PUSH DI

Qt

eis

ha

study the following program and determine contents of the registers listed in the pagebelow after executing the following program :

Question #1 :

POP SI POP BX POP AX POP BP .exit END

What is the values of DI,BP,AX,DX and SP ?!

Question #2 :

Imagine we consrust an assembly program that consists of three assembly instructions to perform a certain job . the corresponding logical addressassociated with each instruction as shown below :

0018:0020

Za id

Answer the following qwestions : (a) At which memory segment the above intsructions are stored ? (b) What are the physical addresses generated to fetch instruction 2 considering real mode memory addresses ? (c) What are the physical addresses gencrated to fetch instruction 3 considering protected mode memory addressing ? ( Consider an 80286prcessor that has 24-bit get further benefit from Appendix D .

Qt
Assembly Instruction 1 0018:0023 0018:0026

eis
Assembly Instruction 2

Assembly Instruction 3; three bytes long

ha

Figure 1. part of global and local descriptor tables where all of the mentioned values are in hex

Question #3 :

Za id
1) 2) 3) 4) MOV CX,[1000H] MOV CX,[BX+SI+6000H] MOV [BX],AX MOV AL,[EBX+4*ECX]

Classify the following instructions according to their addressing modes?

Question #4 :

state whether each of following is valid or invalid in addition the major cause for that : 1) MOV SS,DS

Qt

Global descriptor Table (G D T): Descriptor1 00 00 9F 10 00 00 11 FF

G D T: Descriptor 2 00 00 9A 10 10 00 22 FF

eis
00 00 9E 40 10 10 66 FF

ha
G D T: Descriptor 2

Local Descriptor Table (L O T) Descriptor 1 00 00 FE 10 00 00 FF FF

L O T: Descriptor 2 00 00 FA 10 40 30 FF FF

L O T : Descriptor 3 00 00 FF 20 10 10 00 FF

Question #5 :

(a) What MOV MOV MOV MOV

will AX, DS, BH, BI,

be the value of BX after exccuting following code ? 0C000h AX 30H 70H

(c ) What will be the contents of BP after executing the following code ? MOV SI,[000AH] MOV BX,[000EH] MOV BP,[BX+SI]

Za id
.Model small .data X DW 0004H Y DW 558CH Z DW 4FFCH K DW 0FFCBH .code

Question #6 :

Study the following Assembly program named Mid carefully , given that the starting offset address of the data segment DS is 0009H

Qt

(b) What will be the contents of CX and DX after exccuting the following code ? MOV CH, [000Dh] MOV CL, [0006h] MOV DX, [0005H]

eis

the following table shows the logical memory addresses along with their contents. You need to consider this table for answering questions below .

ha

2) 3) 4) 5) 6) 7)

MOV DX,CH MOV [BX],1234H MOV DX,[AX] MOV BH,[EBX+5*ECX] MOV CS,DX MOV CH,[XP+8000H]

Write down the value of registers DI,BX,DX and CX after executing this code above.

Question #7 :

The following variables are declared in the data segment , where DS= 1000H and the starting offset = 0020H .DATA DATA1 DW 11C2H DATA2 DW 264CH DATA3 DW 3FFCH DATA4 DB 40 DUP(ODEH)

(a) What will be the content of DI register after executing the following instructions ? LEA DI,DATA1

(b) How does the follownig instruction affect the data segment (DS) ? MOV WORD PTR [DI+4],0FFFFH

Za id
898D0070H 8CDAH

QUESTION #8 :

Find the equivalent assembly instructions for these machine instructions :

Qt

eis

ha

.startup MOV DI,OFFSET X MOV BX,X MOV DX,[BX+DI-2] MOV CX,Y[BX-2] .exit END

Das könnte Ihnen auch gefallen