Question: EECE 3 4 3 5 Lab 0 8 : Arithmetic - Addition, Subtraction, Multiplication, Division Instructions EECE 3 4 3 5 Lab 0 8 :

EECE 3435 Lab 08: Arithmetic- Addition, Subtraction, Multiplication, Division Instructions
EECE 3435 Lab 08: Arithmetic- Addition, Subtraction, Multiplication, Division Instructions
A. Objectives: to understand and experiment on the arithmetic instructions
B. Resources
Online resources
Textbook
C. Lab Preparation
Use online resources or the textbook to understand the debug commands and assembly instructions used in the assignment.
Start the Debug Application.
First fill the memory with some data by executing the following command:
-f 0 ffff DD 3C C1 D8 B6 B26A F1 AA
Note that in the lab report, you will be required to show the results you obtained in your experiments. You thus need to take screenshots of your work.
D. The Lab
Initialization of memory locations:
1.1 Initialize segment registers and memory:
Use R command: DS =0B50 and CS =0A50
Note: this is to make the DS and CS occupy different space in memory.
Use f command: f DS:0 ffff DD 3C C1 D8 B6 B26A F1 AA
1.2: Reinitialize some memory locations:
DS: 100H=10H;DS:101=01H;
DS:120H=FFH; DS: 121H=FFH;
DS: 130H=08H; DS: 131H=01H;
DS: 150H=02H; DS: 151H=01H;
DS:200H=30H; DS: 201H=01H;
DS:210H=40H; DS: 211=01H; and
DS:220H=30H; DS:221H=01H.
1.3. Verify that the memory locations have been loaded with the correct data with the D command.
2. Initialize registers:
Ax=0020H;
Bx=0030H;
CX=0040H;
Dx=0050H;
SI=0100H;
DI=0200H; and
CF=1.
Verify the register contents.
3. Assemble the following instruction sequence into the memory starting at address CS
a. ADD AX,00FF
b. ADC SI, AX
c. INC BYTE PTR [0100]
d. SUB DL, BL
e. SBB DL,[0200]
f. DEC BYTE PTR [DI+BX]
g. NEG BYTE PTR [DI+0010]
h. MUL DX
i. IMUL WORD PTR [BX+SI]
j. DIV WORD PTR [SI+0030]
k. IDIV WORD PTR [BX][SI+0030]
Verify these instructions are in the memory.
How many bytes of memory do the instructions take up?
Note: For instructions j and k, you may encounter an interrupt/exception. Try to find the reason behind it, and modify the contents of registers with new values to avoid the divide overflow.
4. Display the current state of the flags.
5. Execute the instructions one at a time with the TRACE command. Describe the operation performed by each instruction. For each instruction, show where the source and destination operands are located, what results are produced, where are the results stored; and name the flags that changed in the given operation.
a. Instruction-a
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
b. Instruction-b
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
c. Instruction-c
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
d. Instruction-d
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
e. Instruction-e
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
f. Instruction-f
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
g. Instruction-g
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
h. Instruction-h
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
i. Instruction-i
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
j. Instruction-j
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
k. Instruction-k
What does the instruction do?
Where are the source and destination operands located?
What are the results?
Where are the results stored?
After you finish the assignment or at the end of the lab session: 1. show your experimental results to the lab assistant; 2. fill out the section below; 3. each member signs on the sign-out sheet that the lab assistant provides (a member not present in the lab will not receive credits for the lab).
Group members present in the lab:
_Date:
Lab report: 1. Screenshots of all your experiments; and 2. the filled-out lab assignment sheet with the required answers.
EECE 3 4 3 5 Lab 0 8 : Arithmetic - Addition,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!