0% found this document useful (0 votes)
91 views

Lab 02-1 PDF

The document provides instructions for a lab assignment on assembly language programming. Students are instructed to work individually and not engage in plagiarism. The tasks involve running assembly language programs using MASM, LINK, and DEBUG commands. DEBUG commands like -u, -r, -t are used to disassemble and debug code line by line, checking register status. Students are asked to create a table noting register values after each line is executed. Several questions are provided to test debugging skills like dumping memory, searching memory, modifying registers, and performing math operations.

Uploaded by

Moeen Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Lab 02-1 PDF

The document provides instructions for a lab assignment on assembly language programming. Students are instructed to work individually and not engage in plagiarism. The tasks involve running assembly language programs using MASM, LINK, and DEBUG commands. DEBUG commands like -u, -r, -t are used to disassemble and debug code line by line, checking register status. Students are asked to create a table noting register values after each line is executed. Several questions are provided to test debugging skills like dumping memory, searching memory, modifying registers, and performing math operations.

Uploaded by

Moeen Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Organization and Assembly Languages BCS-F-18

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

Now, Using above commands


Debug complete code line by line using –p command and check status of registers using –r command.
Create a table on your note books and note down registers status after execution of each line. Also write
every instructions logical address. Sample table is given below:

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

1. Write a command to dump eighteen memory locations starting from 0BBA:0110

Answer:

2. Write a command to enter the letter ‘A’ in memory starting from location 0100 to 0350.

Answer:

3. Write a command to search letter P in memory from location 0100 to 025F.

Answer:

4. Write a command to change the contents of register AX to 12F9.

Tazeem Haider
([email protected])
Computer Organization and Assembly Languages BCS-F-18
Lab 02
Answer:

5. Change the contents of register CX to ABCD.

Answer:

6. Write a command to get sum and difference of two numbers 12AB and 0ABC?

Answer:

7. Write a command to view all available commands in debugger.

Answer:

8. Quit Debugger.

Answer

Tazeem Haider
([email protected])

You might also like