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 <sme...@gmu.edu> 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
>
>

Reply via email to