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

What Does "OC" Instruction means in Assembler


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

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Tue Apr 17, 2012 12:52 pm
Reply with quote

Hi,

I am trying to convert an Assembler program to COBOL and need some help.
Can someone plz tell me what exactly below instructions means? I tried everywhere, but couldn't find the exact info on OC command.

Thread is declared as below.
Code:
THREAD   DS    A                    THREAD POINTER


Below we have 2 more instructions. Is it trying to compare and see if THREAD already has value? if Yes, Branch it? What exactly "OC" means?

Code:
OC    THREAD,THREAD             SET ALREADY ?
BNZ   BCRIT                                       YES, BR 


What would be the COBOL converted code for above stmts?
Plz help.

Thanks & Regards,
JP
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Apr 17, 2012 12:55 pm
Reply with quote

the POP ( principles of operations )

available here
www-01.ibm.com/support/docview.wss?uid=isg2b9de5f05a9d57819852571c500428f9a

or here
www-03.ibm.com/systems/z/os/zos/bkserv/r11pdf/#zarchpops

will tell all You might want to know about the OC opcode

revision 8 is the last one, but for Your needs revision 7 is more than enough
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Tue Apr 17, 2012 1:43 pm
Reply with quote

Enrico,

Thanks for the reply. However, I did go thru that manual and couldn't help much.

Is it possible for you to provide Cobol converted code?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Apr 17, 2012 1:50 pm
Reply with quote

Quote:
I did go thru that manual and couldn't help much.

then You did not read/meditate on it carefully enough !

the OC is a logical or which sets the condition code if any of the bits are non zero

the BNZ is , the name tells, Branch if Not Zero

using the OC is a way of testing a <switch> without caring for it' s length

otherwise You would have had to use a compare instruction with a proper lenght constant operand


the equivalent pseudo code is

if <somevar> equal <environment dependent ZERO/FALSE>
goto <some label>
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Apr 17, 2012 1:51 pm
Reply with quote

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea3160/2.1.1
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Tue Apr 17, 2012 2:05 pm
Reply with quote

Thank you so much.
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: Thu Apr 19, 2012 8:44 pm
Reply with quote

Besides the 'OC' of the label itself, if you come across an ICM (Insert Character Under Mask) -

Code:

ICM    Rx,B'1111',THREAD
BNZ    BCRIT   

In an ICM instruction, Rx is any register you choose and (in this example) the mask of B'1111' represents all bytes in the register (decimal 15) because you need to load all four bytes of THREAD. The BNZ (CC=7) mnemonic represents that Rx contains other than X'00000000' (same CC after 'OC').

The COBOL equivilent of an 'OC' and an 'ICM' is an IF check against a POINTER variable (or an ADDRESS OF) for EQUAL or NOT EQUAL to NULL.

HTH....
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Fri Apr 20, 2012 2:23 pm
Reply with quote

Thank you all. Got it resolved.
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
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts How Can I Recall a Migrated Data Set ... PL/I & Assembler 3
Search our Forums:

Back to Top