Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Assembler program why does a DC H'0' result in a S0C1 abend

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Tue May 19, 2009 5:54 pm    Post subject: Assembler program why does a DC H'0' result in a S0C1 abend
Reply with quote

In an assembler program why does a DC H'0' result in a S0C1 abend?
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue May 19, 2009 6:21 pm    Post subject: Reply to: DC H'0'
Reply with quote

Because the programmer (for numerous reasons I'm sure) decided to drive the logic to the label associated with this H'0' definition and an OPCODE of X'00' (first byte of the halfword) is not a valid OPCODE, which results in a S0C1.

Normally, driving logic to a label like this indicates the programmer intentionally wanted to raise an abend/dump.

Regards,
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Tue May 19, 2009 6:32 pm    Post subject: Reply to: DC H'0'
Reply with quote

Bill, thank you for the explanation.

Sorry if my question wasn't clear. What I am trying to figure out is why we need to code a DC H'0' to get the abend - why not a DC F'0' or something similar?

((DC F'0' also has the op-code of X'00' and should result in a S0C1 abend.))
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue May 19, 2009 6:45 pm    Post subject: Reply to: DC H'0'
Reply with quote

Actually, it could have been a constant X'00'. But, halfword-constants are what I've seen in the past most of the time. I guess the programmer wanted to save two-bytes, because a fullword is four-bytes. Regardless, an OPCODE of X'00' will always raise a S0C1.

Regards,
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Tue May 19, 2009 6:49 pm    Post subject: Reply to: Assembler program why does a DC H'0' result in a S
Reply with quote

Thanks!
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Wed May 20, 2009 5:17 am    Post subject:
Reply with quote

In theory, if the last valid instruction before the F'0' ends 2 bytes before the F'0' then the F'0' could be preceeded by 2 bytes of uninitialized storage that might contain a valid instruction. If that instruction happens to be a branch, then it is possible that the bad opcode in an F'0' might never be hit. Or if it is something that affects storage (LR, SVC, etc) then the dump taken by the F'0' will show incorrect data for the time of the abend. That is why people use H'0' to align the bad opcode immediately after the last instruction. If you want to use F'0' say for making it easier to find in a dump, you should preceed it with CNOP directives to insure that the instructions leading up to the aligned fullword are valid NOP instructions.
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Wed May 20, 2009 12:42 pm    Post subject: Reply to: Assembler program why does a DC H'0' result in a S
Reply with quote

Thanks MBabu.
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Wed May 20, 2009 2:15 pm    Post subject: Reply to: Assembler program why does a DC H'0' result in a S
Reply with quote

Hello MBabu,

I am back with some more questions.

First, let me see if I have understood you correctly. Assembler instructions follow the halfword boundary requirement and so does DC H'0'. So, if I code a DC H'0' after some instruction, the DC H'0' will be stored right after the instruction and there will be no unused bytes of storage between the instruction and the halfword zero.

DC F'0' follows the fullword boundary requirement. If I code a DC F’0’ after an instruction there may be 2 unused bytes of storage if the previous instruction is not on a fullword boundary even though it is on a halfword boundary.

My question is – will something else get stored in these 2 unused bytes of storage?

Next, you mentioned something about LR and SVC affecting storage. How do these instructions affect storage?

Sorry if I am asking too many questions.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu May 21, 2009 12:29 am    Post subject:
Reply with quote

Your understanding is correct. The (possible) two bytes of unused storage between the end of the instruction and an F'0' depends on what happened when the module was loaded into storage. I don't remember if the loader zeros the storage first (I hope so, but don't know). If not, those bytes could anything including valid opcodes.

Load Register (LR) won't change storage but it would change a register. Similarly SVCs can do anything since they are basically calls to other programs in the system. Since DC H'0' is often used to force a dump, you want to make sure the registers and storage can't get changed before the dump occurs.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu May 21, 2009 2:54 am    Post subject:
Reply with quote

Terminating a program with an invalid instruction is not a good practice.
The person running a job (or the operator in the middle of the night) should be able to see immediately if the job canceled by program request it or because of a bug (regardless of any other message that may appear).

That's why you have Sxxx abends and Uxxxx abends.

I'm pretty sure that:
Code:
          CALL 'CANCEL'
will work.
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Thu May 21, 2009 1:18 pm    Post subject: Reply to: Assembler program why does a DC H'0' result in a S
Reply with quote

MBabu and Marso, thank you for the explanation.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Thu May 28, 2009 5:26 pm    Post subject:
Reply with quote

Hi !

As Marso allready told: No good practice.

You could use abend-macro. You could have several points in your programm, where the makro is coded, but using different abend-numbers.
So looking the abend-number you know where it occurs in your programm. So you can dedicate different numbers to different situations.

mvc bla,bla
mvc bla,bla
abend dump,4711
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Tue Jun 02, 2009 1:49 pm    Post subject:
Reply with quote

Hi UmeySan,

Thanks for letting me know.

Btw, where can I find more information on the abend macro and the Cancel program?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Tue Jun 02, 2009 2:13 pm    Post subject:
Reply with quote

@ paramita

Morning Sir !

Plse have a look at publib.boulder.ibm.com an search for MVS, Z/OS, or VSE Macro Instructions.
Back to top
View user's profile Send private message
paramita

New User


Joined: 06 Mar 2005
Posts: 14
Location: Bangalore

PostPosted: Tue Jun 02, 2009 2:51 pm    Post subject: Reply to: Assembler program why does a DC H'0' result in a S
Reply with quote

UmeySan,

Good Morning and thanks for the clue.

PS: I am female. :-)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 2 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us