Docsity

Lab Assignment 1 on Assembly Language I | CPSC 3121, Assignments of Programming Languages

Toggle sidebar
bg1
CPSC 3121 ASSEMBLY LANGUAGE 1 SPRING 2009
LAB ASSIGNMENT 4 DUE WEDNESDAY, APRIL 1
This lab requires the student to write a completely new program.
The structure of the program should reflect that of earlier programs.
The goal of this assignment is to write and execute an assembly language program.
The program should be called LAB04.
The program will read in a list of integers, one per line.
Each integer should be no more than six digits. At least one should have two or more digits.
As each number is read in, it is to be printed out.
After the last number is read in, the program should print the sum.
Example:
1
3
14
THE SUM IS 18
Please note that there is a lot of flexibility in this assignment.
One way to do this would be to convert each string of digits into Packed Decimal
format, to do the addition as packed decimals, convert the sum to EBCDIC,
and then to print the answer.
Be sure that your output is entirely numeric. If you use the UNPK instruction
incorrectly, the output above would be 01H, which is not acceptable.
A complete solution would require scanning the input strings for non–numeric characters
and other such mistakes. For this, just assume that the input is correct.

Partial preview of the text

Download Lab Assignment 1 on Assembly Language I | CPSC 3121 and more Assignments Programming Languages in PDF only on Docsity!

CPSC 3121 ASSEMBLY LANGUAGE 1 SPRING 2009

LAB ASSIGNMENT 4 DUE WEDNESDAY, APRIL 1

This lab requires the student to write a completely new program. The structure of the program should reflect that of earlier programs. The goal of this assignment is to write and execute an assembly language program. The program should be called LAB. The program will read in a list of integers, one per line. Each integer should be no more than six digits. At least one should have two or more digits. As each number is read in, it is to be printed out. After the last number is read in, the program should print the sum. Example:

THE SUM IS 18

Please note that there is a lot of flexibility in this assignment. One way to do this would be to convert each string of digits into Packed Decimal format, to do the addition as packed decimals, convert the sum to EBCDIC, and then to print the answer. Be sure that your output is entirely numeric. If you use the UNPK instruction

incorrectly, the output above would be 01H , which is not acceptable.

A complete solution would require scanning the input strings for non–numeric characters and other such mistakes. For this, just assume that the input is correct.