Thanks, guys, sincerely for your kind reply. they are of very help to me.
manikawnth wrote:
I cant stop laughing. Well said.
I am meditating on the SAVE macro.
PPl like me should POP out from mediocre brains and peep into POP.
Now i read it LR R3,R15 instead of BASR R3,0.
Really well caught.
Would u please kindly tell me what does below two words mean? they cannot be find out from dictionary...
Thanks to your help,I have run the first program smoothly.
but abended to another simple program....
I have debug it for a long time, but.... things are always frustrating...
Code:
BEGIN CSECT
SAVE (14,12)
BASR R15,0
USING *,R15
OPEN (TEACHERS,(INPUT)) OPEN INPUT FILE
LOOP GET TEACHERS,IREC READ A SINGLE TEACHER RECORD
B LOOP REPEAT
ATEND CLOSE TEACHERS
RETURN (14,12),RC=(15)
TEACHERS DCB LRECL=80,DSORG=PS,RECFM=FB,MACRF=(GM), X
DDNAME=TEACHER, X
EODAD=ATEND
LTORG
YREGS
IREC DS CL80
BEGIN AMODE 31
BEGIN RMODE ANY
END
below is the dump list:
Code:
Command ===>
.IEA995I SYMPTOM DUMP OUTPUT
.SYSTEM COMPLETION CODE=0C4 REASON CODE=00000011
. TIME=04.27.40 SEQ=15024 CPU=0000 ASID=011F
. PSW AT TIME OF ERROR 070C2000 95FEE300 ILC 4 INTC 11
. NO ACTIVE MODULE FOUND
. NAME=UNKNOWN
. DATA AT PSW 15FEE2FA - 700018C8 1F22BF27 C0011299
. GR 0: 00000001_FD000008 1: 00000000_98A00F1C
. 2: 00000000_00000000 3: 00000000_80FD97C8
. 4: 00000000_009D1B00 5: 00000000_009FD368
. 6: 00000000_95FEE170 7: 00000000_00FC8E80
. 8: 00000000_00A00F1C 9: 00000000_00FEE900
. A: 00000000_16646000 B: 00000000_165EB178
. C: 00000000_00A00F1C D: 00000000_009D1B00
. E: 00000000_80FEE900 F: 00000000_15F004E0
. END OF SYMPTOM DUMP
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Suggest you try with the method Bill provided (use the same code in the same order and pay attention to the registers used - yours should be like Bill's as there is no need to be "creative" . . . .
Once you have a working module, suggest you thoroughly understand every line of code (Bill's comments provide this) and then clone this for each new task.
Apart from you not following linkage conventions, the following raises a question about your Assemble/link process...
Code:
PSW AT TIME OF ERROR 070C1000 83B1387C ILC 2 INTC 0D
which looks like you are in AMODE(31) but your code does not seem to have AMODE/RMODE statements, so you should be running AMODE(24)? Also, where's the END statement?
Garry
Hi, Garry,
May I ask, how do you judge it's AMODE(31) from PSW?
I searched PSW within <ESA390 Principles of Operation>, but cannot find an exhausitive description for PSW.
Would you please tell me how to determine if it's AMODE(31) or AMODE(24)?
Thanks in advance.
Suggest you try with the method Bill provided (use the same code in the same order and pay attention to the registers used - yours should be like Bill's as there is no need to be "creative" . . . .
Once you have a working module, suggest you thoroughly understand every line of code (Bill's comments provide this) and then clone this for each new task.
Yes, I have tried the program that Bill provided, it works well. Thanks.
Apart from you not following linkage conventions, the following raises a question about your Assemble/link process...
Code:
PSW AT TIME OF ERROR 070C1000 83B1387C ILC 2 INTC 0D
which looks like you are in AMODE(31) but your code does not seem to have AMODE/RMODE statements, so you should be running AMODE(24)? Also, where's the END statement?
Garry
Hi, Garry,
May I ask, how do you judge it's AMODE(31) from PSW?
I searched PSW within <ESA390 Principles of Operation>, but cannot find an exhausitive description for PSW.
Would you please tell me how to determine if it's AMODE(31) or AMODE(24)?
Thanks in advance.
I have found it from<z/Architecture reference summary>
Please ignore this post. THanks and sorry for bringing you inconvenience.
May I ask, how do you judge it's AMODE(31) from PSW?
The address of next sequential instruction in PSW is 83B1387C
and the most significant nibble is 8. Since the most significant bit is turned to 1, the amode is 31.
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
Regarding the second program, note the following -
* BASR needs to be BALR (I'll explain)
* Use R3 as your base-register
* AMODE and RMODE must be 24
* Add a label to your RETURN Macro
The reason you need to use BALR (can be used for both below and above the line) is because the program must be AMODE 24 / RMODE 24. The BASR instruction is strictly for above-the-line.
You're using a DCB, which is inherently below-the-line.
Below-the-line limits addressability of any register as an AL3 (maximum 16777215 / X'007FFFFF').
After the OPEN, issue a LTR R15,R15 for success / failure. Issue BNZ (Open was a failure) to RETURN Macro label, naming the label (for example) as RTN2CLLR.
Never use R0, R1, R14 or R15 as a base-register as they are used in Assembler Macro's.
Don't tie-up R2 as it is used in TRT instructions (along with R1).
Unless you know what you're doing, outside of savearea usage, don't use R13, period.
Use the Register Save Area (REGSAVE) technique in the WTO program posted earlier.
Optionally, in the DCB, substitute LRECL=80 with LRECL=L'IREC.
Regarding the second program, note the following -
* BASR needs to be BALR (I'll explain)
* Use R3 as your base-register
* AMODE and RMODE must be 24
* Add a label to your RETURN Macro
The reason you need to use BALR (can be used for both below and above the line) is because the program must be AMODE 24 / RMODE 24. The BASR instruction is strictly for above-the-line.
You're using a DCB, which is inherently below-the-line.
Below-the-line limits addressability of any register as an AL3 (maximum 16777215 / X'007FFFFF').
After the OPEN, issue a LTR R15,R15 for success / failure. Issue BNZ (Open was a failure) to RETURN Macro label, naming the label (for example) as RTN2CLLR.
Never use R0, R1, R14 or R15 as a base-register as they are used in Assembler Macro's.
Don't tie-up R2 as it is used in TRT instructions (along with R1).
Unless you know what you're doing, outside of savearea usage, don't use R13, period.
Use the Register Save Area (REGSAVE) technique in the WTO program posted earlier.
Optionally, in the DCB, substitute LRECL=80 with LRECL=L'IREC.
Bill
Thank you very much, BIll.
I have modified source code like below:
Code:
BEGIN CSECT
SAVE (14,12)
BALR R3,0
USING *,R3
OPEN (TEACHERS,(INPUT)) OPEN INPUT FILE
LTR R15,R15
BNZ RTN2CLLR
LOOP GET TEACHERS,IREC READ A SINGLE TEACHER RECORD
B LOOP REPEAT
ATEND CLOSE TEACHERS
RTN2CLLR RETURN (14,12),RC=(15)
TEACHERS DCB LRECL=L'IREC,DSORG=PS,RECFM=FB,MACRF=(GM),
DDNAME=TEACHER,
EODAD=ATEND
LTORG
YREGS
IREC DS CL80
BEGIN AMODE 24
BEGIN RMODE 24
END
but the program still abended with S0C4:
Quote:
.IEA995I SYMPTOM DUMP OUTPUT
.SYSTEM COMPLETION CODE=0C4 REASON CODE=00000011
. TIME=02.46.09 SEQ=38987 CPU=0000 ASID=0174
. PSW AT TIME OF ERROR 070C2000 95FEE300 ILC 4 INTC 11
. NO ACTIVE MODULE FOUND
. NAME=UNKNOWN
. DATA AT PSW 15FEE2FA - 700018C8 1F22BF27 C0011299
. GR 0: 00000001_FD000008 1: 00000000_98A00F1C
. 2: 00000000_00000000 3: 00000000_80FD97C8
. 4: 00000000_009D1B00 5: 00000000_009FD938
. 6: 00000000_95FEE170 7: 00000000_00F6AD00
. 8: 00000000_00A00F1C 9: 00000000_00FEE900
. A: 00000000_16646000 B: 00000000_165EB178
. C: 00000000_00A00F1C D: 00000000_009D1B00
. E: 00000000_80FEE900 F: 00000002_15F004E0
. END OF SYMPTOM DUMP
BEGIN CSECT
SAVE (14,12)
BALR R3,0
USING *,R3
LA R15,REGSAVE POINT TO OUR SAVEAREA
XC 0(REGSAVEL,R15),0(R15) ENSURE X'00'S
ST R13,4(,R15) BACKWARD-CHAIN
ST R15,8(,R13) FORWARD-CHAIN
LR R13,R15 POINT TO OUR SAVEAREA
OPEN (TEACHERS,(INPUT)) OPEN INPUT FILE
LTR R15,R15
BNZ RTN2CLLR
LOOP GET TEACHERS,IREC READ A SINGLE TEACHER RECORD
B LOOP REPEAT
ATEND CLOSE TEACHERS
L R13,4(,R13) RESTORE CALLERS R13
RTN2CLLR RETURN (14,12),RC=(15)
DS 0F ENSURE ALIGNMENT
REGSAVE EQU * REGISTER-SAVEAREA
DS 18F 18-WORDS
REGSAVEL EQU *-REGSAVE RSA OVERALL-LGTH
TEACHERS DCB LRECL=L'IREC,DSORG=PS,RECFM=FB,MACRF=(GM),
DDNAME=TEACHER,
EODAD=ATEND
LTORG
YREGS
IREC DS CL80
BEGIN AMODE 24
BEGIN RMODE 24
END