Week008-Microprocessor Systems Assessement 2
Week008-Microprocessor Systems Assessement 2
ACTIVITY NO. 1
FAMILIARIZATION WITH DEBUG COMMANDS
OBJECTIVE (S):
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
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
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.
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)
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.
Address is assumed to be an offset from the address in CS, unless another segment value
is given.
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.
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.
-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)
EXERCISES:
a. R
b. A
c. N
d. W
e. T
B- <LF> -
j- <CR> -
a- <SP> (space) -
d- . (dot) -
ACTIVITY NO. 2
INTRODUCTION TO TURBO ASSEMBLER
OBJECTIVE (S):
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.
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
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
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.
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:
EXERCISES:
1. Compare the actions of ESC and CTRL+ALT when moving from SK to DOS.
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)
7. Compare the use of DEBUG and TURBO ASSEMBLER in assembly language programming.
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:
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:
2. Give an application for which service 1 of INT 21h is advantageous to service 7 of INT 21h.