IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SBAL Instruction


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Mon Aug 10, 2009 1:32 pm
Reply with quote

Hi ,

I encountered following instruction in a program ,

Code:

         AP    RECCT2HE,RECCT2C0 
         SBAL  R07,LON1000       
         ZAP   RECCT1C0,=P'0'     


Could any body help me in understanding , wat does SBAL stands for and wat it does?

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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Aug 10, 2009 1:34 pm
Reply with quote

Ever considered looking it up on Google or in a manual?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Aug 10, 2009 2:27 pm
Reply with quote

the best thing would be to ask the programmer who wrote the code
looking together at the assembler listing
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Aug 10, 2009 3:29 pm
Reply with quote

This instruction does not appear in any POPS manual, which indicates that it is most likely, a home-grown Macro.

What happens when you Assemble the program?

Does SBAL expand correctly or does the Assembler find it unrecognisable?

I don't ever recall such an instruction.

It looks like a customised "BAL" instruction of some sort, based upon the "Rx,Label" convention and the prefixed "S".

You need to speak with the author and attempt to resolve it together....

Bill
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Mon Aug 10, 2009 3:43 pm
Reply with quote

Hi ,

Even in the listing it is behaving diffrently , the first SBAL expaned as 0700 and the second one expaned as 5070A460 ,

It appears as if it behaves similar to BAL ( as per code analysis) , I dont understand how it could give different listing ?




Code:

0700                               6679          SBAL  R07,WHLD703P   
                                   6686 *                             
               00000448            6687 WRITT73L EQU   *             
95E8 C3D2      000013D1            6688          CLI   REC703L1,C'Y' 
4770 A464               00000464   6689          BNE   WRITT705       
5070 A460               00000460   6690          SBAL  R07,WHLD703L   
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Aug 10, 2009 3:54 pm
Reply with quote

Ensure that PRINT GEN is specified in the program so that SBAL can be expanded.

The 0700 indicates the Assembler is attempting alignment.

OPCODE 50 is a ST (RX format) instruction and the remainder concludes it's a ST.

I don't understand why someone would make a ST this complicated?

Cleverness without documentation leads to confusion and unanticipated "opportunities".

Bill
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Mon Aug 10, 2009 4:08 pm
Reply with quote

Hi Bill,

It turned out to be a macro and the whole buzz was to just resuse the reigister. This has been wriiten just to screw the programmer like me icon_cry.gif

Thanks Bill for your help , It speeded my analysis.





Code:

                                   6691          SBAL  R07,WHLD703L
                                   6692+         CNOP  0,4         
5070 A460               00000460   6693+         ST    R07,*+16     
4570 A750               00000750   6694+         BAL   R07,WHLD703L
5870 A460               00000460   6695+         L     R07,*+8     
47F0 A464               00000464   6696+         B     *+8         
00000000                           6697+         DC    F'0'         
                                   6698          PRINT NOGEN       
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Aug 10, 2009 4:32 pm
Reply with quote

If this Macro is used in CICS/Assembler, it introduces non-reentrant code.

But regardless, branching using current location counter plus "whatever" can bite you quicker than a scorpion in your shorts.

If someone adds an instruction, storage, etc, within the range of the branch, you're probably going to get a S0C1 (invalid OPCODE) or perhaps, execute an instruction that wasn't supposed to be executed.

Branching to labels is always the best approach and (IMHO) should always be done this way.

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Assembler - Packed Decimals - PACK in... PL/I & Assembler 3
No new posts Using L' to get length of instruction PL/I & Assembler 1
No new posts LA instruction in assembler PL/I & Assembler 4
No new posts The Test under Mask (TM) Instruction PL/I & Assembler 7
No new posts Control-M restart instruction CA Products 2
Search our Forums:

Back to Top