0% found this document useful (0 votes)
30 views4 pages

Coal Lab 2

Uploaded by

dddsasda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Coal Lab 2

Uploaded by

dddsasda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

2023F-BCS-264

Lab#2

Lab Exercise
1- Assemble and unassemble the following code and fill the following table.

Logical Address Opcode Assemble code Comment

072A:0100 B80002 MOV AX, 0200H ; AX=0200

072A:0103 BB0004 MOV BX, 0400H ; BX=0400

072A:0106 01D8 MOV AX, BX ; AX=AX+BX


; AX=0400+0200
; AX=0600

2- Give answers to the following questions after unassemble the code:


Why the values of 0200H and 0400H are written as 0002 and 0004, in the opcode,
respectively?
Write the number of bytes and the value of IP register taken by each instruction.

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

3- Assemble a program using the DEBUG programming utility to move the


decimal values in the registers, as given below:
AX = 543110
2023F-BCS-264
Lab#2

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

You might also like