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
 

 

What Does "OC" Instruction means in Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: What Does "OC" Instruction means in Assembler
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Apr 17, 2012 12:55 pm    Post subject: Reply to: What Does "OC THREAD, THREAD" Instructio
Reply with quote

the POP ( principles of operations )

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

or here
http://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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Apr 17, 2012 1:50 pm    Post subject: Reply to: What Does "OC" Instruction means in Asse
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: 2422
Location: Netherlands, Amstelveen

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

http://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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Apr 19, 2012 8:44 pm    Post subject: Reply to: What Does "OC" Instruction means in Asse
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    Post subject:
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    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 Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts "DFSRRC00 vs IKJEFT01" for ... arunsoods All Other Mainframe Topics 5 Fri Aug 12, 2016 9:54 pm
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm


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