Multi-bit operations just take a little bit of additional parsing and error checking in the macros. Of course, that's not worth doing if you're never going to need them.
I was assuming that the flags wouldn't always be in the same register. If they are, then the macro could also determine the register implicitly. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Assembler List [[email protected]] on behalf of Steve Smith [[email protected]] Sent: Thursday, August 17, 2023 10:06 AM To: [email protected] Subject: Re: Self-documenting Bit Settings Yeah, I was hesitant to go there on this thread, but I have a couple of flag-intense programs that maintain them in a register (I think of it as my "control" register). The register immediate instructions provide all the same operations, with the bonus they operate on 16 bits each. Helper macros would be more complex, but presumably save the trouble of having to remember whether HH, HL, LH, or LL was needed for each particular flag. As Shmuel said,... For the record, I coded it all without creating such macros (maybe next time). Note that one possible drawback of all these schemes is they don't easily support multiple bit operations. But that's typically not important. sas On Thu, Aug 17, 2023 at 7:18 AM Seymour J Metz <[email protected]> wrote: > With some extra work, you could do something like this > > NAME FLAGS FOO+BAZ > FOO FLAG X'80' > BAR FLAG X'40' > BAZ FLAG X'20' > ... > FON BAR+BAZ > ... > FOFF FOO > ... > FTM FOO+BAR > > or even this > > > NAME FLAGS HH,[FOO+BAZ] > * STORAGE - Generate DC AL1, use storage immediate > * HH - Optional DC AL2, use register immediate > * HL - Optional DC AL2, use register immediate > * LH - Optional DC AL2, use register immediate > * LL - Optional DC AL2, use register immediate > FOO FLAG X'80' > BAR FLAG X'40' > BAZ FLAG X'20' > ... > MYINIT FDC FOO+BAZ > ... > FON BAR+BAZ,REG=MYREG > ... > FOFF FOO,REG=MYREG > ... > FTM FOO+BAR,REG=MYREG > > or even count bits automatically. > > > > -- > Shmuel (Seymour J.) Metz > http://mason.gmu.edu/~smetz3 > >
