Lab 02-1 PDF
Lab 02-1 PDF
Lab 02
Instructions:
Work on this lab individually. Discussion is not allowed.
Evaluation of tasks will be conducted in lab.
Anyone caught being indulged in the act of plagiarism would be awarded an “F” grade in this
lab.
Task 01:
An assembly language program named “prog.asm” is given in folder.
Now, run the following commands one by one:
C:\> edit prog.asm
C:\> masm prog.asm
C:\> link prog.asm
C:\> prog.exe or prog
C:\> cls
C:\> ml prog.asm
C:\> exit
Now, Use following Commands one by one to debug a program.
a. Type DEBUG prog.exe
b. Type -u to see the code and instruction of program
c. Type -r to see the contents of the registers and next instruction
d. Type -t to run an instruction at a time (single stepping ):
e. Type -p to run procedure type INT XX
f. Type -g to complete the program
g. Type -q to exit DEBUG
h. Type -d to exit DEBUG
Tazeem Haider
([email protected])
Computer Organization and Assembly Languages BCS-F-18
Lab 02
AX BX CX DX IP Memory Instruction
Address Executed
FFFF 0000 0016 0000 0000 : Before
execution
02FF 0000 0016 0000 0002 076A:0000 MOV AH,02
Answer:
2. Write a command to enter the letter ‘A’ in memory starting from location 0100 to 0350.
Answer:
Answer:
Tazeem Haider
([email protected])
Computer Organization and Assembly Languages BCS-F-18
Lab 02
Answer:
Answer:
6. Write a command to get sum and difference of two numbers 12AB and 0ABC?
Answer:
Answer:
8. Quit Debugger.
Answer
Tazeem Haider
([email protected])