Assume that 8086 registers are loaded with the following values. Go through each
ID: 3667674 • Letter: A
Question
Assume that 8086 registers are loaded with the following values. Go through each instruction in the following list and show what effective “address” or “addresses” will be used (if any) by the CPU for executing the instruction. For example, if DS = 1000H, the instruction MOV AX, [5000H] will use the address 15000H = 10000H+5000H to access the memory and copy two bytes of data from this location (one from 15000h and one from 15001H) into register AX. IN and OUT instructions do not access memory, but still need to use the address bus (without using segments).
AX
43
52
BX
2E
A1
CX
11
3D
DX
22
00
SI
00
10
DI
A0
10
BP
44
01
SP
00
26
DS
20
00
CS
30
00
ES
40
00
SS
D0
00
MOV CX, [2034H]
MOV [2034H], CL
MOV CX, 2034H
ADD AX, [SI+4]
ADD AX, SI
MOV [BP+30H], DL
SUB DH, [BX + 30H]
ADD ES:[DI], AL
MOV BX, [BP + SI+ 23H]
POP CX
IN AL, 70H
OUT DX, AX
PUSH DX
MOV [BP][DI], AX
OUT 21H , AL
XOR [BX + SI - 0E00H], DX
AX
43
52
BX
2E
A1
CX
11
3D
DX
22
00
SI
00
10
DI
A0
10
BP
44
01
SP
00
26
DS
20
00
CS
30
00
ES
40
00
SS
D0
00
Explanation / Answer
basic ideas of these instruction which type of memory and size is described.
MOV [BP][DI], AX
MOV CX, [2034H]
MOV [2034H], CL
MOV CX, 2034H
MOV [BP+30H], DL
MOV BX, [BP + SI+ 23H]
we know the general syntax of mov dest,src
dest/src may be a register or memory. where src may also be immediate.
ADD AX, [SI+4]
ADD AX, SI
ADD ES:[DI], AL
the syntax would be add dest,src and in which dest and src for reisters and src.
but src can also be immediate address.
SUB DH, [BX + 30H]
the syntax would be sub dest,src in which as like as add can have register and memory whereas src also can have immediate
action would be dest-src.
flags effected be OF,SF,ZF,AF,PF,CF.
it works for both signed/usigned numbers
POP CX
cx is register which possess 16 bit
IN AL, 70H
70h would be an immediate data
as the destination is al read byte from 8 bit port 70H
OUT DX, AX
if sourcce is AX write word in ax to 16 bit port op.
where op is 8 bit immediate or DX.
PUSH DX
dx is a register 16 bit
OUT 21H , AL
op is 8 bit immediate so write byte in al to 8 bit port 21H
XOR [BX + SI - 0E00H], DX
destination is memory and src is register
action would be dest^src
flags that are affected OF=0,SF,ZF,AF=?,PF,CF=0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.