Starting from:

$30

Assignment 7 – Introduction to Packed Decimal 

CSCI 360                              Assignment 7 – Introduction to Packed Decimal 
(75 points)

This program is a rather simple introduction to packed decimal and packed decimal arithmetic.

First, copy the following Assembler program into a new member of your ASSIGNS PDSE named ASSIGN7.  

Be sure the program is surrounded by the correct JCL:

         PRINT NOGEN
****************************************************************
*                                                              *
*  CSCI 360              ASSIGNMENT 7             SUMMER 2021  *
*                                                              *
*                                                              *
*                                                              *
****************************************************************
*
PAYROLL  CSECT
*
*  STANDARD ENTRY LINKAGE ESTABLISHING R12 AS BASE REGISTER
*
         STM   14,12,12(13)  SAVE REGS IN CALLER'S SAVE AREA
         LR    12,15         COPY CSECT ADDR INTO R12
         USING PAYROLL,12    ESTABLISH R12 AS THE BASE REG
         LA    14,REGSAVE    R14 POINTS TO THIS CSECT'S SAVE AREA
         ST    14,8(,13)     STORE ADDR OF THIS CSECT'S SAVE AREA
         ST    13,4(,14)     STORE ADDR OF CALLER'S SAVE AREA
         LR    13,14         POINT R13 AT THIS CSECT'S SAVE AREA
*
*
*  Here is where you will write your program.
*
*
*  STANDARD EXIT LINKAGE WITH RC OF 0 RETURNED IN R15
*
         SR    15,15        R15 = RETURN CODE OF 0
         L     13,4(,13)    POINT R13 TO CALLER'S SAVE AREA
         L     14,12(,13)   RESTORE REGISTER 14
         LM    0,12,20(13)  RESTORE R0 THRU R12
*
         BR    14           RETURN TO CALLER
*
         LTORG
*
* THE FOLLOWING TWO LINES PUTS A LABEL ON YOUR STORAGE ON A
* 32-BYTE BOUNDARY SO THAT YOU CAN FIND IT EASILY IN A DUMP
*
         ORG   PAYROLL+((*-PAYROLL+31)/32)*32
         DC    C'* PROGRAM STORAGE FOR PAYROLL **'
*
REGSAVE  DS    18F          PROGRAM'S REGISTER SAVE AREA
*
*  Here is where your storage will be defined.
*
         END   PAYROLL

You will write your source code in between the lines of standard entry and exit linkage code.  Of course, you can add variables and other storage declarations immediately following the LTORG provided but place them above the 18-fullword caller's register storage area.

Secondly, change the input data member to:

//FT05F001 DD DSN=KC02322.CSCI360.DATASU21(DATA7),DISP=SHR

To assist you, here is the data in the DATA7 member:
                                                                   
WOLFGANG AMADEUS MOZART  1234515802550         
RICHARD STRAUSS          2345619800001
AMY BEACH                2213210803120         
DAME ETHEL SMYTHE        6546522801590
PETER ILYICH TCHAIKOVSKY 4456023283407
ANTON BRUCKNER           9987022802100
LUDWIG VAN BEETHOVEN     1334515802550
JOHANNES BRAHMS          2445619800001
BELA BARTOK              2253210803120
MAX REGER                1146522801590
SAMUEL BARBER            1336023283407
GIUSEPPE VERDI           9987322802100
JOHANN SEBASTIAN BACH    1234215802550
JOSEPH HAYDN             2345219800001
GEORG FRIEDRICH HANDEL   2213110803120
NIKOLAI RIMSKY-KORSAKOV  4437823283407
EDWARD ELGAR             6541122801590
CLAUDE DEBUSSY           9985522802100
ANTONIN DVORAK           1334615802550
THOMAS TALLIS            2445719800001
RALPH VAUGHAN WILLIAMS   2253810803120
RICHARD WAGNER           1147722801590
FREDERIC CHOPIN          1777723283407
JOAN TOWER               9921122802100

Each of the above input records has the following layout:

Data Field    Data Type    Columns    Max. Value
Employee Name    Alphanumeric    1-25    
Employee ID    Alphanumeric    26-30    
Hourly Pay Rate    Zoned Decimal    31-34    $99.99 (two implied decimal places)
Hours Worked    Zoned Decimal    35-38    99.99 (two implied decimal places)
Unused        39-80    

As before, read the employee records one at a time using a standard read loop and printing a detail line for each employee so that your output looks like that provided to you in the Assignment 7 folder on Blackboard.

For each employee, move their name to the print line and move their ID to the print line.  Make sure your read loop works at this point before moving on.

Next, using only packed decimal instructions, PACK and ED the Hourly Pay Rate into the print line showing the decimal point.  Do the same for the Hours Worked.  

Finally, calculate the gross pay amount using MP, round it to two decimal places and ED it into the print line showing the decimal point.  

The only packed decimal instructions you will need are:  PACK, ED, ZAP, MP and SRP.  

You will no longer need to use XDECI or XDECO.  DO NOT use them!

Name your detail line you print for each employee DETAIL and place the following two lines at the top of your read loop:

         MVI   DETAIL+1,C' '
         MVC   DETAIL+2(131),DETAIL+1

These two lines set all but the very first byte – the carriage control character – of your 133-byte detail line to spaces to prepare for the next employee information.

Submit your ASSIGN7.txt file on Blackboard as before.