On 04/29/2013 07:11 AM, Bill Godfrey wrote:
On Mon, 29 Apr 2013 03:58:41 -0500, Ron Thomas wrote:

Ok. in that case what does this statement does?

OC    INSTR1+1(1),0(R5)

I believe this will have the function either CLI,NI,TM,OI,XI.  so why this  
"OR" aganist XL8'8040201008040201'.  So how is the result going to be ?

The OC is part of a loop that is building the bits of a mask byte from an 
8-character string. Each charcter '1' in the string will result in a 
corresponding bit being turned on in the mask byte. The first time through the 
loop, R5 points to the first byte of  XL8'8040201008040201', so the mask byte 
will be or'd with hex 80. The second time, R5 will point to the hex 40, and so 
on.

Bill

...
More specifically, PNBITMSK is a subroutine designed to be called with two parameters:
(1)addr of 1 byte field (input and output)
(2)addr of 18 byte field (must be half-word aligned) containing following subfields 6-byte work area (used internally for building two machine instructions) FCTN: 3-char Function name ("TM " ,"NI " , "CLI", "OI ", or "XI ") (input value) MASK: 8-char Mask containing binary representation of 1 byte in "0" and "1" characters (input) CONDCODE: 1-char condition code set to "0", "1", "2", "3", or "4" (output)

If the supplied function name in the 2nd operand is not one of the 5 acceptable values, the CONDCODE subfield is set to "4".

If the function name in FCTN is valid (the VFY@FCTN loop), then the hardware instruction corresponding to that assembler mneumonic is built, with an "immediate" byte component (the 2nd byte of the generated machine instruction, at INSTR1+1) constructed from the 8 MASK characters (the BLD@MASK loop), and that operation is then executed (as a tiny subroutine via the BAL) against the one-byte data field represented by the first parameter address, and the returned CONDCODE value is set to a character value of "0", "1", "2", or "3" based on the condition code set by the constructed hardware instruction (see Principle of Op manual for CC meanings for each instruction).

The subroutine modifies no internal storage, so it would be re-entrant, and the return code from the subroutine call itself is set to zero.

As previously remarked, the intent would be to provide to a high-level language that doesn't have good bit manipulation support, or the ability to imbed assembler instructions, indirect access to hardware level instructions to test and set individual bits within a byte of storage.

Although the characters in the MASK field are obviously intended to be "0" or "1", no explicit test for "0" is done and any character other than "1" will be interpreted as a "0".

--
Joel C. Ewing,    Bentonville, AR       jcew...@acm.org 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to