|
Each Byte consists of 8 bits identified reletive to Zero from left to right. Therefore bit one of a byte is Bit 0, Bit two is identified as BIT 1 etc. The Biton and Bitoff commands simply turn the bit identified in the Factor two field on or off (depending on which command you use) of the Byte idenfiled in the Result field, thereby changing the value of the Result field. C Bitoff '01234567' SS1 will turn all the 8 bits off resulting in SS1 = Hex 00 or Binary=00000000 then if the line is executed w/ *IN 60 on : C 60 Biton '0' SS1 will = Hex 80 or Binary 1000000 then if the line is executed w/ *IN 61 on : C 61 Biton '1' SS1 will = Hex C0 or Binary 1100000 Setting bits on/off can be useful but you really need to have a chart to cross-reference the binary values to hex or EDCDIC representation to know what your changing it to. I don't know what your program is trying to acheive from your example but hope this helps. One use I had found for Biton/Bitoff commands in earlier versions of RPG was to issue BITON '1' for each Byte in an alpha field which would result in switching any letter in the field to uppercase. BITOFF'1' would conversely change them to lowercase. There are better ways to do this now however. > +++++++++++++++++++++++++++ > > Jack Shoaf > Director of MIS > The Echo Design Group, Inc > 1050 Valley Brook Avenue > Lyndhurst, NJ 07071 > > Phone: 201-842-0088 > Fax : 212-686-5017 > E-mail : Jshoaf@echodesign.com > > -----Original Message----- > From: Scott Swaim [SMTP:scott71@hpnc.com] > Sent: Friday, March 20, 1998 4:14 PM > To: MIDRANGE-L@midrange.com > Subject: Biton/Bitoff > > Never having programmed the to opcodes, What are they? That > do they do? > > Please explain what is happening with this code. > > > C BITOFF '01234567' SS1 > 1 > C 60 BITON '0' > SS1 > C 61 BITON '1' > SS1 > > > > > TIS > > > > Scott Swaim > scott71@hpnc.com <mailto:scott71@hpnc.com> > http://www.qualitycorps.com > +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.