Professional Documents
Culture Documents
Midsem 2023
Midsem 2023
A
Recheck Request:
38
24g0h
i. JP WORD PTR [SI] ;PF=1 before this instruction IP=8889h
CALL WORD PTR [BPI[SIJ[O100HJ CS= 240oh , IP= 349 h
-l
QS. Consider the following code snippet and specifywhich mode of memoryorganlzatlon is used in an x86,(machine
Note that due to some restriction only 64KB is allowed for data segment. (4M) Ans.
D4TA
EXAMI DD 2000}H, 3000H. 330011, 430017
CODE
MOT DI, 30
MOT B, 10
CALL EAMI
Q6. Give the name of the addressing mode for the following instructlons (1Mx6= 6M]
a.
MOV AL, BH
b. MOVCL, (EBX+ 4* EAX] Registy addressing
NOT WORD PTR [BX][O104H]
Sealdadyaoking
d. MOV EBX, (ESl+0234H] legistr teakue addresy
INC LOC1
Ragishox elaku addesig
Ragi shr Dixect
*Note: LOC1 is is the label of a byte sized odllg
f.
location
LEA BX, LOC2
Tronediah addnesting
*Note: LOC2 is the labelof an instruction at
CS:033Oh
Q11. Consider the following instructions.Note that the opcode for JMP instruction is EB. Fillinthe blank with the
right machine code (in hex) which willcome in the two blanks. (Assume any suitable data if required) [3Mx2 =6M)
Instruction Machine code (in hex)
MOV AX, 4000H B8 00 40
MOV DS. AX SE D8
MOV CX, 0032H B9 32 00
MOVSI, 0000H BE 00 10
JMP X2 EB o3X% Fillin the blank
XI: ADDBL. [SI] 02 1C
INC BH FE C7
INC SI 46
X2: DEG CX 49
JMP XI ERFB Fill in the blank
Q12. Write the register values in hex after the execution of following code [2M]
.MODEL TINY
.DATA
.ORG 1030H
DAT IDB 50H 20H 30H 25H 80H 40H 35H 5SH 6SH 75H
.CODE
.STARTUP
MOV D1, OFFSET DATI
MOV AL. 80H
MOV CX, 10H
CLD
REPNE SCASB
.EXIT
END DI= lo35
Q13. Write the register values in hex after the execution of following code [3M]
.MODEL TINY
.DATA
.ORG 1030H
DAT IDB 50H 20OH 30H 2SH 80H 40H 3SH 2SH 70H 7SH
.CODE
.STARTUP
MOV SI, OFFSET DATI
MOVDI, OFFSET DATI
ADD DI,7
STD
CMPSW
JA X1
X2: MOV CX, 4534H
JMP OVER
X1: MOV CX, 7556H
OVER:
.EXIT
END Dl: H,SI: H, CX = H
Q14 You have to write a macro named NINE Which performe the foliowing operation OutPar-9*InPar where
InPar and OutPar are the parameters to the macro NINE Yoy are not allowed to use MUL/IMUL in this macro
The only register youcan uSe inside macro is CX, and are allowed to use only one ADD instruction. Assume that
the range of InPar is from 50H - 200H The mocro should not have more than 6 lines of code (including the
mocro heoder ond footer).
Furthermore, write a complete 8086 ALP which will change the contents of DX register with 27 times the content
of BX (i e. DX=27*BX). This ALP is allowed to call the macro NINE only one time. Only BX, DX and CX can be used
in this program. The code between. stortup and. Exit (exclvding the entire macro) should not exceed 4 lines
You can use the ADD instructiononly once in the ALP. No other arithmetic instruction can be Used. (10M]
SA
Moy
ENDM
Cx, 0o0
SAL TnPar,Ck
Mov C, Tn Par
Mov Outlar,
ENDM