On Tue, Feb 18, 2014 at 10:02 PM, Robert A. Rosenberg <[email protected]>wrote:
> At 17:42 -0500 on 02/18/2014, Gerhard Postpischil wrote about Re: > assembler: > > > You seem to be deliberately confounding the issue. There is no efficient >> way of testing the validity of a bit number using only bytes. Let me >> simplify this for you - when the OP has 62 stores, then the allocation >> obviously is for a minimum of 8 bytes, but the value for checking validity >> of a bit is 62, not 8, and not 8*8. >> > > That is true. OTOH, once you validate the store number, the bit number > (ie: Offset into the byte) is mod (store#,8) [IOW: The remainder of > dividing the store# by 8] and the byte offset is floor(store#/8). Thus > there is no way to get a bit number of 6 or 7 in byte 8 since these bits > are invalid with only 62 stores. > > Going a bit OT on this, but this talk about bits - the testing and setting thereof, makes me curious about why IBM doesn't simplify it a "bit" (pun intended). They have done some, such as with Find LeftMost One and Population Count (could somebody explain to me what this might really be used for?). So why not a "test bit" instruction, instead of needing to generate a "bit mask" from the "bit number", then do something like an EX of an NI or some such (as I'm sure many have seen and done). This could be a simple RX format instruction. The register would contain the bit number, from 0 to 7 (specification exception if not in range), SLR R0,R0 L R1,STORE_NUM D R0,=F'8' TBIT R0,STORE_BIT_STRING(R1) JZ CLOSED -- Wasn't there something about a PASCAL programmer knowing the value of everything and the Wirth of nothing? Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
