COP-3402 Information
-
What's New
-
I will have regular office hours on Monday and Tuesday of final's week. On
Wednesday and Thursday I will be in my office from 2 - 3:15 pm.
-
The Multiplication Algorithm for Base 2.
-
You may run my Hamming
Code program to check that yoir calculations are correct. Note: This
program does not generate a 16 bit codeword, it genrates the shortest code
word. Your program always changes an 8-bit data word into a 16-bit code word.
Fill in any extra bits at the end of the code word with zeros to make the
code word into 16 bits.
-
Recursion
-
Exam Information
-
Midterm
-
Due to the weather, I am postponing the test until 10/17. I will return the
exams on Thursday, 10/19 so that you will know the results by the drop date
on 10/21.
-
Review: Thursday 10/12. Bring questions. When you stop asking questions,
the review is over.
-
Exam: Tuesday 10/17.
-
Topics for the midterm
-
Guaraneed topics that will be on the
midterm
-
Final
-
I will have regular office hours on Monday and Tuesday of final's week. On
Wednesday and Thursday I will be in my office from 2 - 3:15 pm.
-
Final Exam: Thursday, 12/14 from 3:30 pm
until 6:10 pm.
-
Topics for the final exam
-
Assignments
-
Submitting homework on-line
-
Assignment 1
-
Due 9/14 at the start of class. Hand in a printout and upload a text version
on the web.
-
Assignment 2
-
Assignment 3
-
Extended: Due 11/2 at the start of class
-
Do not use recursion.
-
Only use instructions in the first 6 chapters and DIV and IDIV from chapter
7.
-
Do not jump into a procedure, nor out of a procedure.
-
To make the columns look good, use the BIOS move cursor and get
cursor position routines; or use tabs (09h).
-
Assignment 4
-
Due 11/16 at the start of class.
-
I have simplified one of the requirements for the assignment: There must
be a procedure that changes a 8-bit data word into a 16-bit Hamming code
word. This can be done quite succinctly by using nested loops. Extra credit
(1 point): change a 16-bit data word into a 2-word Hamming code word.
-
The Multiplication Algorithm for Base 2.
-
You may run my Hamming
Code program to check that yoir calculations are correct. Note: This
program does not generate a 16 bit codeword, it genrates the shortest code
word. Your program always changes an 8-bit data word into a 16-bit code word.
Fill in any extra bits at the end of the code word with zeros to make the
code word into 16 bits.
-
Assignment 5
-
You must validate that each base is a number in base 10. The number must
be in the range 2..36 and each digit in the number must be from 0..9. A base
of 2C is not allowed, since it is not a number in base 10.
-
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.
-
Additional Topics - These pages contain some information to supplement the
text. I suggest that you do not read them until I cover the related material
in class.
-
Programming in MASM 6.11
-
Course Information
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
to visit this page since 10/13/00.