Lab 2
Lab 2
Lab 2
MOV
MOV
MOV
MOV
MOV
MOV
AX,BX
AX,AAAA
AX,[BX]
AX,[4]
AX,[BX+SI]
AX,[SI+4]
Page 1/6
Microprocessor I Labs
Step 2
Step 3
=
=
=
=
=
=
=
0000H
0001H
0002H
0003H
0010H
0020H
0030H
Step 4
=
=
=
=
=
BBBBH
CCCCH
DDDDH
EEEEH
FFFFH
Trace the execution of the instructions (a) through (f). Explain the execution
of each instruction, including addressing mode, physical address for memory
addressing mode, value in AX.
Assemble the instruction MOV SI, [0ABC] to memory at address CS:100 and
verify loading of the instruction. How many bytes does the instruction take up?
Initialize the word of memory starting at DS:0ABC with the value FFFFH
Clear the SI register, verify by displaying its content.
Trace the execution. Describe the operation performed by the instruction
Assemble the instruction MOV WORD PTR [SI], ABCD into memory at
address CS:100 and then verify loading of the instruction. How many bytes
does it take?
Initialize SI register with the value 0ABCH
Clear the word of memory starting at DS:0ABC
Trace the execution. Describe the operation performed by the instruction
Arithmetic instructions
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Assemble the instruction ADC AX, [0ABC] to memory at address CS:100 and
verify loading of the instruction. How many bytes does the instruction take up?
Initialize the word of memory starting at DS:0ABC with the value FFFFH
Initialize AX with the value 0001H. Verify by displaying register contents.
Clear the carry flag
Trace the execution. Describe the operation performed by the instruction
Does a carry occur?
Flag-control instructions
Prof. Yan Luo, UMass Lowell
Page 2/6
Microprocessor I Labs
Step 1
Step 2
Step 3
Step 4
Step 5
Into memory at address CS:100 and then verify loading of the instruction. How
many bytes do they take?
Initialize the byte of memory starting at DS:200 with the value 00H
Clear register AX and BX
Display the current state of flags, make sure the status flags equal NG, ZR,
AC, PE and CY
Trace the execution. Describe the operation performed by each instruction.
What value is read out of the flags register?
What value is saved in memory?
What value is reloaded into flags register?
Compare instructions
Step 1
Step 2
Step 3
Step 4
Into memory at address CS:100 and then verify loading of the instruction. How
many bytes do they take?
Clear register AX and BX.
Display the current state of flags
Trace the execution. Describe the operation performed by each instruction.
What value is read out of the flags register?
What value is saved in memory?
What value is reloaded into flags register?
What are the status flags before and after the compare instruction was
executed?
Jump instructions
You need to download two files (L5P3.LST and L5P3.EXE) from the course webpage at
http://faculty.uml.edu/yluo/Teaching/MicroprocessorI/umlrocks/L5P3.LST
http://faculty.uml.edu/yluo/Teaching/MicroprocessorI/umlrocks/L5P3.EXE
Step 1
Download the files in one of your file folders
Step 2
open the source listing in file L5P3.LST.
What is the starting address offset from CS: for the first instruction (PUSH
DS) and the last instruction (RET)?
Step 3
Load the run module L5P3.EXE with emu8086
Step 4
Verify loading of the program by unassembling the contents of the current
code segment for the offset range found in Step 2
Prof. Yan Luo, UMass Lowell
Page 3/6
Microprocessor I Labs
Step 5
Step 6
Subroutine instructions
You need to download one file (L5P4.EXE) from the course webpage at
http://faculty.uml.edu/yluo/Teaching/MicroprocessorI/umlrocks/L5P4.EXE
Step 1
Step 2
Step 3
Page 4/6
Microprocessor I Labs
Step 4
b. Load the numbers that follow for use by the arithmetic subroutine.
(AX) = -32 = FFE0H
(BX) = 27 = 001BH
(CX) = 10 = 000AH
(DX) = 200 = 00C8H
c. Execute the call instruction with a TRACE command. What instruction
is to be executed next?
d. Single step to address CS:10. What is the sum in DX?
e. Check the value of the last word pushed to the stack
f. Run the program to completion. What is the final value in DX? How
did the contents of DX become this value?
Exit emu8086.
Check off
Demonstrate the files you saved (in example 4.24) to the TA.
Get TAs signature on the screen print-out you obtained.
Attach your screen print-out to your report.
Report format
Your report needs to follow the format below.
Lab # and title:
Student Name:
Partners Name:
Lab Purpose:
<It is usually the objective of the lab.>
Lab Content:
< Answer the questions in lab specification. Describe what you do in the lab, e.g. what
commands you practiced. It has to be at least one page with 11pt font size. Try to
organize and summarize the lab in itemized lists.>
Difficulties:
< state what difficulties you encountered in the lab and how you managed to solve it. If
not, what have you tried? >
Conclusion and Suggestions:
Page 5/6
Microprocessor I Labs
Grading
Student Name _________________
Student ID ___________________
Criteria
Check off with TA
Print-out or screen capture of the
instruction, Answer questions correctly
Print-out or screen capture of the
instruction, Answer questions correctly
Print-out or screen capture of the
instruction, Answer questions correctly
Print-out or screen capture of the
instruction, Answer questions correctly
Print-out or screen capture of the
instruction, Answer questions correctly
Print-out or screen capture of the
instruction, Answer questions correctly
Full Points
40
10
Actual Points
10
10
10
10
10
TOTAL
100
Page 6/6