Вы находитесь на странице: 1из 1

2102440 Introduction to Microprocessors

Assembly Programming Laboratory I


Lab lists:
1. Executing an assembly program
2. Using Turbo Debugger
Lab. 1 Executing an assembly program
1.1 Write a program to add following hex numbers: 1200H, 141H, 123AH, 45EDH,
and 5672H.

Open form.asm using one of the follows:


o notepad
o wordpad
o edit
Edit yourfile.asm based on the form.asm
Compile the source code to create an object module
o tasm /l/z/zi yourfile.asm (The /l generates .lst file, /z switch causes
TASM to display the lines that generate compilation errors, and /zi
switch enables information needed by the debugger to be included in
the .OBJ file.)
Run the Linker to generate an .EXE file from the .OBJ file
o tlink yourfile

Lab. 2 Using Turbo Debugger


2.1 Write down the physical and logical addresses and memory contents of each data
location (using the same data as in 1.1).
2.2 Trace the program and analyze the ZF, AC, SF, PF, and CF flag bits.

Debug your program


o td yourfile

2.3 Experiment with the CPU window by changing register values, data segment values, and
program instructions. Fill in the following table.
Operation
ADD
ADD
ADD
SUB
SUB
SUB

Destination
AL=64H
BL=FFH
AX=1234H
AL=0H
CX=F934H
AX=1234H

Source
46H
1H
1DF3H
1H
F000H
1234H

Instruction

Result

CF

SF

PF

AF

ZF