Hi all,
I want to know about the instruction in assembly for adding zoned decimal.
AZP CSECT
DATA DSECT
FIELD1 DS ZL3
FIELD2 DS ZL3
FIELD3 DS ZL4
AZP CSECT
USING *,12
SAVE (14,12),,*
LR 12,15
LA 15,SAVEAREA
ST 13,4(,15)
ST 15,8(,13)
LR 13,15
OPEN (INPUT,INPUT,OUTPUT,OUTPUT)
LOOP GET INPUT
LR 2,1
USING DATA,2
PACK DBL1,FIELD1
PACK DBL2,FIELD2
AP DBL2,DBL1
UNPK FIELD3,DBL2
PUT OUTPUT
MVC 0(80,1),0(2)
B LOOP
EOD CLOSE (INPUT,,OUTPUT)
L 13,4(,13)
RETURN (14,12),RC=0
SAVEAREA DC 9D'0'
DBL1 DC PL8'0'
DBL2 DC PL8'0'
INPUT DCB DSORG=PS,MACRF=GL,DDNAME=INPUT,EODAD=EOD
OUTPUT DCB DSORG=PS,MACRF=PL,DDNAME=OUTPUT, ->
RECFM=FB,LRECL=80
END AZP
*** RECORD 1
0000 0 F1F2F3F4 F5F64040 40404040 40404040 *123456 *
0010 16 40404040 40404040 40404040 40404040 * *
ONE OR MORE LINES SAME AS PREVIOUS LINE
0040 64 40404040 40404040 40404040 40404040 * *
*** RECORD 2
0000 0 F9F9F9F9 F9F94040 40404040 40404040 *999999 *
0010 16 40404040 40404040 40404040 40404040 * *
ONE OR MORE LINES SAME AS PREVIOUS LINE
0040 64 40404040 40404040 40404040 40404040 * *
*** RECORD 1
0000 0 F1F2F3F4 F5F6F0F5 F7C94040 40404040 *123456057I *
0010 16 40404040 40404040 40404040 40404040 * *
ONE OR MORE LINES SAME AS PREVIOUS LINE
0040 64 40404040 40404040 40404040 40404040 * *
*** RECORD 2
0000 0 F9F9F9F9 F9F9F1F9 F9C84040 40404040 *999999199H *
0010 16 40404040 40404040 40404040 40404040 * *
ONE OR MORE LINES SAME AS PREVIOUS LINE
0040 64 40404040 40404040 40404040 40404040 * *