John,

Good thoughts, I do see where you are going with that design.  However, in my 
particular case I don't *think* that I want the flag names ordered 
lexicographically, since the flag names themselves are not a patterned set of 
names but a wide range of vastly different names explicitly descriptive of the 
"meaning" of each flag.  I do want the flags to occur (i.e., be defined) in 
precisely the order that I specify because flags likely to be tested or 
set/unset/etc. together by the application code are currently already grouped 
into the same flag byte.  Unless I am misunderstanding your reason for ordering 
the names lexicographically?

John Erhman's SHARE presentation that Abe pointed out has a nearly complete 
(minus some error checking) set of macros to do pretty much what I envisioned 
doing.

I think it is sufficient for my purposes to have a set of created GBLA 
variables whose name is the name of the flag and whose value is the byte number 
of the flag byte array, thus permitting set/unset/etc. and test macros to use 
that byte number as an offset into the flag byte array.

However, if you have a better implementation of this concept I would be very 
happy indeed to see it.

Thanks again for your help.

Peter

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of John Gilmore
Sent: Saturday, October 04, 2014 8:29 PM
To: [email protected]
Subject: Re: Syntax for using created SET symbols in a SETC value?

Peter (again),

Something to think about until I get back to you tomorrow.

A set of flags Flag1, Flag2, . . . , Flag8 can be viewed as an array

f(1)          f(2)                   f(8)
|                |                |       |
|bbbbbbbb|bbbbbbbb| . . . |bbbbbbbb|

in each element of which the eight bit positions are labeled

|b b b b b b b b|
 1 2 3 4 5 6 7 8

If then 0 < i <= 8 is a byte subscript and 0 < j <= 8 is a bit
subscript in some byte j can also be used to subscript an array of 8
masks

mask(1), BL1'10000000'
mask(2), BL1'01000000'
mask(3), BL1'00100000'
mask(4), BL1'00010000'
mask(5), BL1'00001000'
mask(6), BL1'00000100'
mask(7), BL1'00000010'
mask(8), BL1'00000001'

usable to test any bit position in any byte-array element.

If then having put flag names in ascending lexicographic sequence the
position p of a flag name in this (also one-origin) sequence
determines both i and j.  We have

i =  floor[p/8] + 1
j = mod(p,8) + 1

The construction of a one-origin lexicographically ordered sequence of
flag names is thus the only really interesting task here.

--


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

Reply via email to