
CPSC 3121 ASSEMBLY LANGUAGE 1 SPRING 2009
LAB ASSIGNMENT 2 DUE WEDNESDAY, FEBRUARY 18
This lab involves a slight modification to the first lab, which all students seem to have
completed successfully. There are two main goals for this lab exercise.
1. The student is asked to complete a program execution outside of class time with
minimal help from the instructor. Our lab (CCT 450) is a good place to try this.
2, The student will experience a style of programming which the instructor prefers.
There is a main loop that gets the input data and produces the output.
The actual work of the program is done in a subroutine called by the main loop.
Instructions for the second lab:
1. Use the editor copy feature to create a new lab, LAB02, from a copy of LAB01.
2. Make the edit changes indicated below. The two lines that are struck out (as this is) are
to be deleted and the five lines in bold font are to be inserted at the places indicated.
Leave the rest of the text as it is; only these changes are required.
3. Run the program and leave the results in your output queue. When I grade the lab,
I shall do so by examining your output queue. If the results are there, you get a 100.
Here is the marked up program text, indicating the changes to be made.
GET FILEIN,RECORDIN GET THE FIRST RECORD, IF THERE
*
* READ AND PRINT LOOP
*
A10LOOP MVC DATAPR,RECORDIN MOVE INPUT RECORD
PUT PRINTER,PRINT PRINT THE RECORD
A10LOOP BAL 8,B10DOIT CALL HANDLER SUBROUTINE
GET FILEIN,RECORDIN GET THE NEXT RECORD
B A10LOOP GO BACK AND PROCESS
*
* END OF INPUT PROCESSING
*
********************** END LOGIC ********************************
A90END CLOSE (FILEIN) CLOSE THE FILES...
CLOSE (PRINTER)
L R13,SAVEAREA+4 POINT AT OLD SAVE AREA
LM R14,R12,12(R13) RESTORE THE REGISTERS
LA R15,0 RETURN CODE = 0
BR R14 RETURN TO OPERATING SYSTEM
********************** SUBROUTINE ********************************
B10DOIT MVC DATAPR,RECORDIN FILL THE PRINT AREA
PUT PRINTER,PRINT START THE PRINT
BR 8 RETURN FROM THE SUBROUTINE
********************** DATA AREAS ********************************