COP-3402 Information
-
What's New
-
Assignments
-
Submitting
homework on-line
-
Assignment 1.
-
Due to the holiday on 1/17, I have changed the due date for Monday's section
to 1/26. The due date for Tuesday's section has not changed.
-
Option 4 of the menu should display EVEN numbers above the average.
-
Do not use recursion for this assignment.
-
Read a character to pause.
-
Do not bother about centering the text, nor clearing the
screen.
-
Run an
example of the homework assignment.
-
In the assignment, 'print' means 'display on the screen'. Do not send any
program output to the printer.
-
Assignment 2.
-
Assignment 3.
-
You must download a copy of ASM_IO.INC to the directory
where your ASM file is located.
-
Assignment 4
-
The pause procedure may reference the name of the string for the message
from the data segment.
-
The rowDir array in the homework assignment had an incorrect value
in it. The final 3, in the 14th position, should be a -3:
rowDir db 0, 1,-2,-1, 1,-1, 1, 2,-2,-3,-2,-2, 0,-3, 0
-
Assignment 5
-
If you obtained a copy of the assignment before 12 noon on 3/16, then get
a new copy. I have added two functions.
-
The recursion acts like this:
If the first character is 0dh, then return without doing anything. Otherwise,
push the first character onto the stack so you can get it later and call
the function with a string that is one letter shorter. When the call returns,
print the character that is on the stack.
-
Assignment 6
-
If you obtained a copy of the assignment before 1:30 pm on 4/5, then get
a new copy. I have added more problems.
-
Please note that FSUB subtracts the top of the stack FROM the second element
on the stack, not the other way around. I gave section 04 the wrong information.
-
For the Hamming code questions, please use an even parity.
-
Running MASM
-
Running MASM in an IDE, updated with Visual
Studio commands.
-
I have updated the link for Configuring MASM
6.11 from your home computer. In particular, the device= statements.
This version of MASM has placed two of the files in the BINR directory, that
is why you are getting the "Device Driver Not Found" errors. Please check
the page again for the new statements.
-
I have updated the link for Running MASM
to include instructions for running MASM from your home computer.
-
If you are using Notepad to create your .ASM file, then you must save
the file using double quotes. For instance, if the name of your file is
first.asm, then save it as "first.asm". This will prevent the
addition of the .txt extension.
-
Exam Information
-
Additional Topics
-
Programming in MASM 6.11
-
Course Information
Examples of how I like code to be written
MASM 6.11
We will be using the Microsoft Assembler, MASM 6.11, in this course. It has
been installed in the PC411 and in the AUL (ECS 241).
For those of you with computers at home, the text book for the course comes
with a copy of MASM 6.11. The installation requires at least 4MB of RAM.
Some students have had difficulty installing it, so read the documentation
and follow the instructions closely.
Configuring MASM 6.11 from your home
computer.
Back to Index
Header to include in all programs
You are to include the following comment at the start of each program that
you hand in, and then SIGN the statement.
; Name: your name
; File Name: the name of the file that contains your source code
;
; Program Description: Several sentences that give a complete description
; of your program.
;
; Instructor: Tim Downey Class: COP3402 Section: your section
;
; I attest that I have done this assignment without help from other people,
; except possibly Tim Downey.
;
; Signed: sign your name here
;
Back to Index
Necessary comments to include in all programs
-
A comment before each procedure, explaining what the procedure does, and
which registers and global variables are changed by it
-
The header stating that all this work is your own
-
Comments on lines that help explain the program. It is not neccessary to
comment each line. Place enough comments to document what (you think) you
are doing.
-
You should include enough comments so that I can read just the comments and
understand completely what your program does.
Back to Index
Some decuctions from programs
-
Insufficient comments
-
Bad names for variables, procedures and labels
-
NEVER jump out of a procedure, always return from one.
-
Insufficient use of EQU statements
Back to Index
What to hand in
For each assignment you are to hand in the following
-
Upload a copy of your .asm file. Follow these instructions:
Uploading
via the Web.
-
Hand in a printout of the source file (.asm)
Back to Index
Steps to create a project
-
From the Project menu, select New Project
-
Give the project a name. DO NOT INCLUDE AN EXTENSION
-
Choose the option Set project template
-
For runtime support, select None
-
For Project Template, select DOS EXE
-
Select OK, then select OK again
You should now be at a screen that shows you all the files in your directory.
You will now select the particular files you want in your project.
-
Select the main module, for example MAIN.ASM, from the upper list, then click
on Add
-
Select any other modules, for example MOD.ASM, from the upper list, then
click on Add
-
Continue this process for all the files you want in your project
-
When you are done, click on Save List
You now have a project for the indicated files.
-
To create the final executable, click on Build under the project menu. It
should indicate the name of your project with a .EXE extension, for example
Build PROJ.EXE.
-
In the future, when you want to work on the project, you must first Open
the project under the Project menu. When you open the project, look for a
file withe the name of your project, with the extension MAK, for example
PROJ.MAK
Example of two files that could be combined together in a project
Back to Index
Reading and Printing Decimal Numbers
I have created four routines that you can use that read and print decimal
numbers.
-
Reading a decimal
-
To read a decimal, call the routine READ_SIGNED or READ_UNSIGNED. After the
call, the AX register will contain the decimal number stored in
hexadecimal.
call READ_SIGNED
;now AX has the number
-
-
or
-
-
call READ_UNSIGNED
;now AX has the number
-
Printing a number in decimal format
-
To print a number in decimal, place the number in AX, then call the routine
PRINT_SIGNED or PRINT_UNSIGNED. The routine will take the number that is
stored in AX, and print it in decimal format. Warning: this routine will
destroy the contents of AX.
mov AX, TOTAL
call PRINT_SIGNED
or
mov AX, TOTAL
call PRINT_UNSIGNED
To get this to work, just include the file ASM_IO.INC just after the .code
statement and before the start of the program
.code
include asm_io.inc
main proc
mov ax,@data
...
You will need to download the file ASM_IO.INC and place it in the same directory
as your source code. Here is a link to the code
for ASM_IO.INC. Follow this link in your browser, then click on File,
Save As to download it. Save it in the same directory as your ASM file.
If your browser tries to download it as an HTML file, then cancel the operation
and do the following
-
From the browser window that is displaying the contents of the ASM_IO.INC
file, press CTRL-A. This will highlight the contents of the page.
-
Press CTRL-C. This will copy the contents of the page.
-
Open Notepad on your computer. In the blank Notepad screen press CTRL-V.
This will copy the contents of the ASM_IO.INC file into Notepad. Save the
file as "ASM_IO.INC". Be sure to include the double-quotes around the name,
or Notepad will append a .txt to the name. Save the file in the same directory
as your ASM file.
Back to Index
| 10h |
Video |
| 13h |
Disk |
| 14h |
Serial Port |
| 15h |
I/O Subsytem (eg, Joystick) |
| 16h |
Keyboard |
| 17h |
Parallel Port Printer |
| 1Ah |
Real-time clock |
| 21h |
DOS |
| 33h |
Mouse |
Back to Index
You are visitor number [an error occurred while processing this directive]
to visit this page since 10/4/96.