Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Code:
MESSAGE DC CL10'HELLO,WORLD!'
Suggest you re-read all of the code to make sure there are no other discrepancies. . . When i saw this, it kinda jumped off the page and i stopped reading. . .
Suggest you re-read all of the code to make sure there are no other discrepancies. . . When i saw this, it kinda jumped off the page and i stopped reading. . .
hi, Dick,
Are you saying that the length should not be 10 bytes, right?
actually, I have noticed this, but the lengh should not be the problem.
When I change it to
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
I think what Dick is saying (in a much nicer way than I) is that until you clean up the slop, especially slop you present to the world as your product, how seriously can you be taken as a computer programmer?
Have you looked closely at all more relevant details?
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
When your program executes this instruction:
Code:
MVC 0(10,10),MESSAGE
exactly what have you done to ensure register 10 points to a memory location that your program is allowed to use? You can't just take existing addresses in registers and expect them to work -- that is how you get storage protection (S0C4) abends!
Furthermore, it is never too early to learn how to use the standard save area linkage since using the standard helps you understand dumps better. You should set up your save area linkage, no matter how small the program.
Your original post contains a nine-line Assembler program that has at least three MAJOR errors, two of which are guaranteed to cause S0C4 abends and one of which will cause your results to not be what you expect them to be.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
IT done properly can be tedious. Assembler is more tedious - there is little between you and many different abends.
Long ago, when a new class of assembler students were beginning, their "Hello World" program was used to introduce standard linkage. Possibly one of the most critical disciplines that should "always" be used.
If your organization/system allows using assembler, there should be some standard code that is cloned to create a new program subroutine. The standard samples will (or should) have standard linkage code where the code is entered and where the code is exited. This is done differently from place to place, so you should use the method your system already uses.
You need to take the time to understand what these instructions actually accomplish. Once you thouroghly understand this, you will probably not consciously think about it, but you need the initial understanding.
***************************** Top of Data ****
PRINT GEN
BEGIN CSECT
SAVE (14,12)
BASR R3,0
USING BEGIN,R3
* MVC 0(20,10),MESSAGE
LA R10,MESSAGE
WTO MF=(E,(R10))
RETURN (14,12)
DS 0F
MESSAGE DC CL20'HELLO,WORLD!'
*
LTORG
YREGS
END
**************************** Bottom of Data **
but still got below error when it is executed.
Code:
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=D23 REASON CODE=05010003
TIME=10.25.54 SEQ=06773 CPU=0000 ASID=00E4
PSW AT TIME OF ERROR 070C1000 83B1387C ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 03B13876 - C49018F8 0A0DA7F4 00065810
GR 0: 00011000 1: 84D23000
2: 00000003 3: 0000010E
4: 00000000 5: 00FF59B8
6: 00000000 7: 00000000
8: 05010003 9: 00000000
A: 7F4E62FE B: 7F4E52FF
C: 03B1ED70 D: 7F4E4300
E: 00000311 F: 05010003
END OF SYMPTOM DUMP
IEF472I S1XCO61T STEP020 - COMPLETION CODE - SYSTEM=D23 USER=0000 REASON=0501003
IT done properly can be tedious. Assembler is more tedious - there is little between you and many different abends.
Long ago, when a new class of assembler students were beginning, their "Hello World" program was used to introduce standard linkage. Possibly one of the most critical disciplines that should "always" be used.
If your organization/system allows using assembler, there should be some standard code that is cloned to create a new program subroutine. The standard samples will (or should) have standard linkage code where the code is entered and where the code is exited. This is done differently from place to place, so you should use the method your system already uses.
You need to take the time to understand what these instructions actually accomplish. Once you thouroghly understand this, you will probably not consciously think about it, but you need the initial understanding.
hi dick,
THanks for your suggestion, but our shorp is not using assembler program, I completely learn assembler by myself and out of interest.
Thanks for your reply,
but the same error occurred to below source.
Code:
***************************** Top of Data *****
PRINT GEN
BEGIN CSECT
SAVE (14,12)
BASR R3,0
USING BEGIN,R3
* MVC 0(20,10),MESSAGE
LA R10,MESSAGE
WTO MF=(E,(R10))
RETURN (14,12)
DS 0F
MESSAGE DC AL2(20)
DC CL20'HELLO,WORLD!'
*
LTORG
YREGS
END
to all of those who advised and approved of the use of
Code:
BEGIN CSECT
SAVE (14,12)
BASR R3,0
USING BEGIN,R3
did You care to look at the effin' POP for the BASR instruction description and use
from the abovesaid manual
Quote:
Other BALR and BASR Examples
The BALR or BASR instruction with the R2 field set to zero may be used to load a register for use as a base register. For example, in the assembler language, the two statements:
BALR 15,0
USING *,15
or
BASR 15,0
USING *,15
indicate that the address of the next sequential instruction following the BALR or BASR instruction will be placed in register 15, and that the assembler may use register 15 as a base register until otherwise instructed. (The USING statement is an “assembler instruction” and is thus not a part of the object pro- gram.)
if You cannot read, better meditate on a career shift
The list form will set up the parameter list for the MF=E call, if you dont do
that you will have to define the parameter list yourself. And that is tricky
as you have seen.
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.
1. your first try
PRINT GEN
BEGIN CSECT
USING BEGIN,R2
MVC 0(10,10),MESSAGE
problem is that you are giving R2 as base but you do not know that address it has. You can try by giving:
PRINT GEN
BEGIN CSECT
LR R2,R15
USING BEGIN,R2
MVC 0(10,10),MESSAGE
R15 has program address when you call from jcl.
2. your 2nd try:
PRINT GEN
BEGIN CSECT
BASR R3,0
USING BEGIN,R3
MVC 0(10,10),MESSAGE
problem is that you are loading address of inst MVC in register R3 and giving basing from BEGIN or BASR.
Try:
BEGIN CSECT
BASR R3,0
BCTR,R3,0
BCTR R3,0
USING BEGIN,R3
MVC 0(10,10),MESSAGE
Sorry Robert. I do not need to mention MVC instruction. I was just mentioning the error in basing. It is having the error in basing which i explained. It might have any other error.
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
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?
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
An alternative that works. I'm sticking with the old (as in prehistoric) message-length max of 69 (let's keep it clean) as it works as advertised as well as utilizes the WTO "TEXT" option.
Code:
PRINT GEN ACTIVATE MACRO EXPANSION
BEGIN CSECT
SAVE (14,12) SAVE REGISTERS
BASR R3,0 R3 IS BASE-REGISTER
USING *,R3 INFORM ASSEMBLER
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
LA R10,WTOMSGA POINT TO MESSAGE-AREA
PRINT NOGEN SUPPRESS MACRO-EXPANSION
WTO TEXT=(R10),ROUTCDE=(11) ISSUE 'WTO' TO 'JESMSGLG'
PRINT GEN ACTIVATE MACRO EXPANSION
L R13,4(,R13) RESTORE CALLERS R13
RETURN (14,12),RC=(15) RESTORE AND RETURN
DS 0F ENSURE ALIGNMENT
REGSAVE EQU * REGISTER-SAVEAREA
DS 18F 18-WORDS
REGSAVEL EQU *-REGSAVE RSA OVERALL-LGTH
WTOMSGA DS 0CL71 WTO MESSAGE-AREA
DC AL2(L'WTOMSGA-2) WTO MESSAGE-AREA LGTH (HWORD)
DC CL(L'WTOMSGA-2)'HELLO WORLD'
LTORG ,
YREGS , REGISTER-EQUATE MACRO
BEGIN AMODE 31
BEGIN RMODE ANY
END ,