Coal Lab 2
Coal Lab 2
Lab#2
Lab Exercise
1- Assemble and unassemble the following code and fill the following table.
Answer:
Due to the little-endian convention lower byte is filled in the lower memory and
higher byte is filled in the higher memory. The number of bytes and the value of IP
register in each instruction is given below:
Instruction IP Value Memory
MOV AX, 0200H 0100 3 Bytes
MOV BX, 0400H 0103 3 Bytes
MOV AX, BX 0106 2 Bytes
BX = 932110
CX = 4503210
DX = 2310210
4- Apply the program control T to execute the code given in Activity -1 & 3.
Capture the screenshot. Write down and analyze the values of each register
including IP and Flag registers.
Activity 1:
REGISTER VALUES:
AX=0600, BX=0400, CX=0000, DX=0000
FLAG VALUES:
NV (no overflow) = 0, UP (up) = 0, EI (enable interrupt) = 1, PL (positive) = 0, NZ
(not zero) = 0, NA (no auxiliary carry) = 0, PE (parity even) = 1, NC (no carry) =
0.
2023F-BCS-264
Lab#2
IP VALUES:
108
Activity 2:
REGISTER VALUES:
AX=1537 ,BX=2469, CX=AFE8,DX=5A3E
FLAG VALUES:
NV (no overflow) = 0, UP (up) = 0, EI (enable interrupt) = 1, PL (positive) = 0,
ZR (zero) = 0, NA (no auxiliary carry) = 1, PE (parity even) = 1,
CY (carry) = 0.
IP VALUES:
0110
2023F-BCS-264
Lab#2
5- Apply the program control command G to execute the code given in Activity -1
& 3. Capture the screenshot. Write down and analyze the values of each register
including IP and flag registers.
Activity 1:
REGISTER VALUES:
AX=600,BX=0400
FLAG VALUES:
NV (no overflow) = 0, UP (up) = 0, EI (enable interrupt) = 1, PL (positive) = 0,
NZ (not zero) = 0, NC (no auxiliary carry) = 1, PE (parity even) = 1,
NC (no carry) = 0.
IP VALUE:
0108
Activity 2:
REGISTER VALUES:
AX=1537, BX=2469, CX=AFE8, DX=5A3E
FLAG VALUES:
NV (no overflow) = 0, UP (up) = 0, EI (enable interrupt) = 1, PL (positive) = 0,
ZR (zero) = 0, NA (no auxiliary carry) = 1, PE (parity even) = 1,
NC (no carry) = 0.
IP VALUE:
020C