100% found this document useful (1 vote)
213 views15 pages

Week008-Microprocessor Systems Assessement 2

The document provides instructions for familiarizing students with debugging commands using DEBUG and introducing the basics of using Turbo Assembler to write assembly language programs. It describes using DEBUG to view registers, load and assemble programs, and write files. It also outlines using a text editor to write assembly code, assembling with TASM, linking with TLINK, and executing the program. Exercises ask students to compare DEBUG and TASM, describe files created during assembly and linking, and modify a sample password program. The objective is for students to learn debugging commands, the assembly process using TASM, and write a password-protected program.

Uploaded by

Datu Prince
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
100% found this document useful (1 vote)
213 views15 pages

Week008-Microprocessor Systems Assessement 2

The document provides instructions for familiarizing students with debugging commands using DEBUG and introducing the basics of using Turbo Assembler to write assembly language programs. It describes using DEBUG to view registers, load and assemble programs, and write files. It also outlines using a text editor to write assembly code, assembling with TASM, linking with TLINK, and executing the program. Exercises ask students to compare DEBUG and TASM, describe files created during assembly and linking, and modify a sample password program. The objective is for students to learn debugging commands, the assembly process using TASM, and write a password-protected program.

Uploaded by

Datu Prince
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 15

MICROPROCESSOR SYSTEMS – ASSESSEMENT NO.

ACTIVITY NO. 1
FAMILIARIZATION WITH DEBUG COMMANDS

OBJECTIVE (S):

1. To familiarize students in using DEBUG commands.


2. To investigate the 8088 and familiarized with their functions.
3. To be able to construct an assembly language program using DEBUG.

NOTE: For you to do this activity. You have to download and install the debug application for
64 – bit Operating system user. After installation type debug, an hyphen ( - ) symbol will appear
indicating that you are already in the debug environment.

For 32 – bit Operating System User just open your open your command prompt and type debug.
An hyphen ( - ) symbol will appear indicating that you are already in the debug environment.

DISCUSSION:

DOS_DEBUG.COM

DOS offer a debugging utility as one of its internal commands. The


DEBUG program can be use to:

Provide a controlled testing environment so you can monitor and control the
execution of program.
Load, alter or display any file
Execute object files. Object files are executable programs in machine language
format.
DEBUG_COMMMANDS

The prompt from DEBUG program is a hyphen ( - )


A command is a single letter, usually followed by one or more parameters,
commands become effective only after you press the ENTER KEY.
Commands and parameters can be entered in uppercase or lowercase, or a
combination of both.
Delimiters may separate commands and parameters.

PROCEDURES:

1. Invoke DEBUG from the PC’s RAMDRIVE. Write down the command you use.

2. Investigate the register using the R Command. The R (register) has common function.

Function 1: R
It displays the hexadecimal of all the registers, plus the alphabetic flag settings
and the next instruction to be executed.

Function 2: R < register name>


Display the hexadecimal contents of a single register with the option of changing
the contents. To display the contents of a single register ( ie., AX ) enter:
- R AX
AX 0000
:_

Change the contents of the AX register by entering 1-4-character hexadecimal


value.

Use the DEBUG R command to display the contents of the registers. What are the
contents of the following registers?
a. General-Purpose Registers (Insert a screen shot for your answer here)

b. Pointer and Index Registers (Insert a screen shot for your answer here)

c. Segment Registers (Insert a screen shot for your answer here)

3. Change the contents of the CX register to 1352. Write down the complete DEBUG
command that you use. (Insert a screen shot for your answer here)

4. Load DEBUG enter assembly language program using A command. The A (assembler)
command lets you enter mnemonic code assembly language instructions.

Format: A < address >

Address is assumed to be an offset from the address in CS, unless another segment value
is given.

Assemble the following code into memory location 1234:0100


1234:0100 mov ah,2
1234:0102 mov dl,41
1234:0104 int 21h
1234:0106 mov dl,43
1234:0108 int 21h
1234:010a mov dl,45
1234:010c int 21h
1234:010e int 20h
1234:0110
Save the program into disk with file name nsample.com

To write a file, it must first be initialized with the N command. The N command
initialized a file name in the memory before using the load or write command.

Format: N [drive] [filename]. [extension]

Place the number of bytes to be written in BX and CX (BX contains the high 16 bits, and
CX contains the low 16 bits. To change the contents of registers BX and CX with the size
of the code you enter. The W (write) command writes a block of memory to a file.

g (go) command execute the program.

-r cx
cx 0000
:10 -w
writing 00010 bytes
-q
1. See the contents of the RAMDRIVE (C:\>dir). (Insert a screen shot for your answer here)

a. Is the file sample.com present?


b. How many bytes does the file consume?

2. Execute the program. What is the output?

EXERCISES:

1. What are the purposes of the following DEBUG commands?

a. R
b. A
c. N
d. W
e. T

5. What number system does DEBUG uses?


6. Write the hexadecimal ASCII value for the following characters. (refer to ASCII Table)

B- <LF> -
j- <CR> -
a- <SP> (space) -
d- . (dot) -
ACTIVITY NO. 2
INTRODUCTION TO TURBO ASSEMBLER

OBJECTIVE (S):

1. to be able to learn the basics of turbo assembler.


2. To properly assemble and link a program using tasm and tlink.
3. To be able to create an assembly language program using turbo assembler with SK as editor.

Note:
For you to do this activity. You have to download and install the TASM 1.4 application for 64 –
bit Operating system user.

After installation, open the TASM 1.4. The interface will look like this.
Type the sample program in the text editor.
Save the file and press exit.

Type tasm sample. (syntax: tasm <filename>) to run


and check for errors. Incase of errors to go back to the
text editor type edit sample.asm (syntax: edit
<filename.asm>)

Type tlink/t sample (syntax: tlink/t <filename>) to link


your program.

Lastly, type sample (syntax: filename) to display the


output.
Note: Output will only display if there is no error and
the linking is successful.

DISCUSSION:

Writing a program in Assembly Language follows the same procedures as in high- level
languages such as Pascal.
1. Type the program instructions into the computer using a text editor, then save the
program on the disk.
2. Translate the text file into machine language program using an assembler. If the
assembler finds errors, correct them with the text editor and reassemble the program.
3. Convert the assembler output to an executable run module using the loader.
4. Execute the program.
5. Check the results. If they differ from what you expected, you must find the error or
bugs, that is, you must debug the program.

Text Editor

A text editor is a program that allows you to enter and prepare your program from the
ordinary keyboard into a computer readable form. It also allows you to save this file into the
disk for later use. The assembler and loader program require the inputs to be saved files from the
disk.

A text editor can be any popular work processor or edit program that can be produce pure ASCII
text.

As a standard convention, program written in assembly language are usually given the filename
with an extension of .ASM. This is also the default filename extension that MASM searches.

Assembler

A program written in assembly language is translated to machine code by an assembler.


Assembler and the corresponding assembly language mnemonics are generally limited to use
with one particular microprocessor, which limits their portability, or use on other machines.
Today’s assembler do much more than translate assembly language mnemonics into binary code.

Loader

Before the microprocessor can execute any machine instruction, it must first be loaded into
memory accessible to it. The loader is the program that actually takes the machine instructions
(object code) and places it in memory at the specified starting address for execution. Loaders
range from the very simple to the very complex.
PROCEDURES:

1. Write the following program using SK’s notepad as your text editor. Assign the filename
exer2.asm

.model small
.code
org 100h

start: mov ah,2


mov dl, ‘R’
int 21h
mov dl, ‘E’
int 21h
mov dl, ‘D’
int 21h
int 20h
end start

2. Save the program by pressing F2.

3. Go to the DOS prompt and then assemble the program by using the command below:

C:\>tasm exer2

4. If there are warnings and errors in assembling process go back to the source code and fix
those errors. If no error occurs proceed to the next step.

5. Link the program by using the command:

C:\>tlink/t exer2

There should be no BAD OBJECT FILE message in the linking process, if bad object file occurs
assemble the program once again.

6. Execute the program by simple typing the filename on the prompt. What is the output of the
given program?
7. Modify exer2.asm. The output should be:

8. Write down the modify program on the space below.

EXERCISES:

1. Compare the actions of ESC and CTRL+ALT when moving from SK to DOS.

2. How many files are created in using turbo assembler?

3. What are those files? (insert the screenshot of your answer here)

4. Which files are created in assembling process? (insert the screenshot of your answer here)

5. Which files are created in linking process?

6. What is the purpose of /t in linking process?

7. Compare the use of DEBUG and TURBO ASSEMBLER in assembly language programming.

8. What is the purpose of org 100h in your program?


SUMMARY & CONCLUSION:
ACTIVITY NO. 3
PASSWORD PROTECTED PROGRAM

OBJECTIVE (S):

1. To be able to compare contrast the three characters input services of INT 21h.
2. The students should be able to create a password for their system disk.

DISCUSSION:

INT 21 Function 01H: Keyboard Input with Echo. This operation accepts a character
from the keyboard buffer or, if none is present, waits for keyboard entry.

INT 21 Function 07H: Direct Keyboard Input without Echo. This operation works like
function 01H, except that the entered character does not echo on the screen and the operation
does not respond to a Ctrl-Break request. It could be used to key in a password that is to be
visible.

INT 21 Function 08H: Keyboard Input without Echo. This operation works like
function 01H, except that the entered character does not echo on the screen.

INT 21 Function OAH: Buffered Keyboard Input. This operation had the inability to accept
extended function keys limits it capability.

INT 21 Function 0BH: Check Keyboard Status. This operation returns FFH in AL if an input
character is available in the keyboard buffer and 00H if no character is available. Operation does
not expect the user to press a key; rather, it simply checks the buffer.

INT 21 Function 0CH: Clear keyboard Buffer and Invoke Function. You may use this
operation in association with function 01H, 06H, 07H, 08H, or 0Ah. Load the required function
in AL. The operation clears the keyboard buffer, executes the function in AL, and accepts (or
wait for) a character, according to the function request. This operation could be used for a
program that does not allow a user to type ahead.
PROCEDURE:

1. Encode the given program.

2. Execute the given program. Write the outputs for the following inputs.

X-
R-
D-

3. Modify the program, use service 8 instead of service 1. Execute the program using the same
input. Write down your observation.

4. Replace service 8 by service 7. Execute the program using the same input. Write down your
observation.
EXERCISES:

1. Compare the character input services of INT21h (service 1, 7 and 8).

2. Give an application for which service 1 of INT 21h is advantageous to service 7 of INT 21h.

3. Why is service 7 of INT 21h suited for a password program?

SUMMARY & CONCLUSION:

You might also like