IUP Computer Science
CO 300 Assembly Language
Spring 1988
Program #5 (due 11 April 1988)
Write an assembly language program to display a survey form
on the screen, read in and verify information for three records
and then display the records.
This program will be used in conjunction with a future
assignment. The requirements for this program are simple but are
very exact. You must display the form exactly as specified and
store the records exactly as specified.
The program should begin by displaying the survey form. The
pieces of the form and their positions are described below. All
words are to be displayed in normal video mode. All specified
blank areas are to be displayed in reverse video mode.
1. Display 'Last Name' starting on line 5, in column 1. Display
a 12-column blank area to the right starting in column 11.
2. Display 'First Name' starting on line 5, in column 40. Dis
play a 12-column blank area to the right starting in column 51.
3. Display 'Social Security No.' starting on line 8, in column 1.
Display a 9-column blank area to the right starting in column 21.
4. Display 'Class (FR,SO,JR,SR,GR)' starting on line 8, in
column 40. Display a 2-column blank area to thr right starting
in column 63.
5. Display 'Major' starting on line 11, in column 1. Display a
20-column blank area to the right starting in column 7.
6. Display this message starting on line 15, in column 1.
'Grades for Courses (enter N if not completed yet)'
7. Display 'CO 250' starting on line 17, in column 5. Display
'CO 310' on line 19, in column 5. Display 'CO 315' on line 21,
in column 5. After each of these displays, display a 1-column
blank area in column 12.
After displaying the form, the program should read in a
value for each of the blank fields. This should be done by
moving the cursor to the beginning of each field and reading in
the field value. As the field values are entered, they should
appear in reverse video. The field values should be stored in
58 consecutive bytes in this order: last name (12 bytes), first
name (12 bytes), social security no. (9 bytes), class (2 bytes),
major (20 bytes), course grades (3 bytes - one for each course).
These bytes represent one record. Unused bytes in the record
should contain spaces.
After reading in one record, the clean form should be
redisplayed and another record should be read in. The program
should read in three complete records. These records should be
stored consecutively in memory (each record 58 bytes). After
reading in all three records, the program should display them on
three separate lines at the bottom of the screen in normal mode.
If these were all the program requirements, writing it would
be rather easy, tedious but easy. There are several additional
requirements on how the program is written.
1. You must define and use at least three macros in this
program.
a.One macro called PUTAT which takes at least four arguments:
a row number, a column number, address of a string, and the
length of the string. This macro should display a message
string at the specified screen position.
b. One macro called BLANKIT which takes at least one argument
(the length of the blanked area). This macro should dis-
play a group of blanks of the specified length in reverse
video.
c. One macro called GETAT which takes at least four arguments:
a row number, a column number, address of a storage area
to hold a string, and the size of the storage area. This
macro should read in a string (entered in reverse video) at
the specified screen position and put the string into the
storage area.
2. You must validate the social security number when it is read
in. To validate the number, the program must make sure that the
entered value consists of 9 digits. If anything else is entered,
the program must make the field blank again, cause a bell to
sound and read in a new social security number.
3. You must use advanced loop instructions (SOBxxx, AOBxxx
or ACBx) for ALL loops in the program.
4. You must use at least one instruction in the program that
uses a displacement mode operand.
5. The final executable program must be assembled and linked
without the /DEBUG switch. Store the final executable program in
a file called PGM5.MAR.
Hand in a .LIS listing of your program. You may show your
macros expanded in the listing, but DON'T expand TERMINALIOSTUFF.
I will execute your final program to make sure that it displays
the form properly.