Escolar Documentos
Profissional Documentos
Cultura Documentos
1
Debug
Course Code: CPE 005
Course Title: Computer Systems Organization with Assembly Language
Section: CPE42FA1
Name: Aeron Paul B. Abdon
Program: BsCpE
Date Performed: June 22,
2016
Date Submitted: June 22,
2016
Instructor:
Engr. Jonathan Taylar
1. Objective:
This activity aims to demonstrate how Debug can be used as an assembler and disassembler.
2. Intended Learning Outcomes (ILOs):
After completion of this activity the students should be able to:
2.1 Write a short assembly language sequence using Debug
2.2 Execute an assembler instruction in Debug
2.3 Examine the contents memory
3. Discussion :
The DEBUG program
To create a program in assembly options are to use an assembler or a debugger. The debugger
that comes with both Windows and DOS is debug.exe or DEBUG program.
DEBUG allows users to:
control and monitor execution of programs
interactively display, examine memory contents, and view registers and variables as they change.
alter and selectively load COM, EXE and other file types
access specific sectors, I/O ports and memory addresses
The Debug Commands
Debug commands are issued at command prompt, denoted by a hyphen (-), either as a single
letter, in uppercase or lowercase, or with a combination of parameter. Table 1.1 shows the summary of the
Debug commands. The ? is used to show the long name of each command.
Command
Program Creation and Debugging
A
G
R
P
T
U
Description
Assemble a program using instruction mnemonics
Execute the program currently in memory
Display the contents of register
Proceed past an instruction, procedure or loop
Trace a single instruction
Disassemble memory into assembler mnemonics
Memory Manipulation
C
D
E
F
M
S
Miscellaneous
H
Q
Input-Output
I
L
O
N
W
Once a Debug command has been issued, the <Enter> key must be pressed so that the command
becomes effective.
4. Resources:
Computer with 32-bit Operating System
Debug.exe
5. Procedure:
Sample Problem A.
1. Open Debug.exe. Type the following at the DOS command prompt of your computer:
C:/>Debug <Enter>
2. Issue the command E when prompted by hyphen ( - ), to place bytes in the memory,
- E CS:100 Welcome to Assembly Programming!
3. Use the D command to view contents at CS:0100
-D 100
Describe how your data are stored in the memory of the computer. In what number system are they
stored?
In Hexadecimal form of number system.
Record all results in Table 1.2.
4. Display the contents of a range, type
-D 110 11F
Describe what happened to the display.
It only displays the second row.
5. Type Q to quit from Debug.
-Q
Sample Problem B.
1. Open Debug.exe.
11. Use H command to get the sum and difference of the addresses 0120 and 0100. Type,
H 0120 0100
0220 0020
12. Change the value of the CX register to 0020. Type,
-R CX <Enter>
CX 0000
:0020
13. Type W to write the file Prog1.com,
-W <Enter>
The computer should display Writing 00020 bytes.
14. Exit from Debug.
Sample Problem C..
1. Check the created Prog1.com file. Open the DOS command prompt. Click START-type CMD-press
ENTER.
2. Change directory to CompOrg.
c:\cd CompOrg> <Enter>
3. Execute Prog1.com.
c:\CompOrg>Prog1.com <Enter>
4. Record your output in Table 1.6.
Sample Problem D.
1. Open Debug.exe
2. Type ?
-?
Describe what happened after you typed ? at the prompt.
Displays a list of the Debug commands.
Which of the commands does not have a parameter?
The A,D,G,L,N,P,R,T,U and W.
Use Table 1.7 to write the long names of the commands and given the examples, give the function
of each of the commands used in this activity.
6. DATA ANALYSIS:
Table 1.2- Sample Problem A.3
PROBLEMS:
1. Make a DEBUG program that will display your name, program, and course, on the computer
screen. Save you program as Prog2.com.
Sample Output:
Juan dela Cruz
BS CpE
CPE005