I use r0:r15 for 32 bit reg references, g0:g15 for 64 bit reg references. Where the instruction references, or sets, bits 0:31 of a 64 bit reg, I use the appropriate "gn" symbolic to identify the register, else I use the appropriate "rn" symbolic.
For the assembler to "police" this in some way I'd imagine having a set of 32 directives like: g0 gpr64 0 g1 gpr64 1 .. r0 gpr32 0 r1 gpr32 1 .. which would both define the symbols -and- authorise the assembler to issue a warning message if, for example, it found a "gpr32" symbolic used where an instruction operand references a 64 bit reg. Cheers, Graeme G. > On 22 Jul 2017, at 11:03 PM, Charles Mills <[email protected]> wrote: > > Two sets of registers would change the whole architecture. I'm sure as the > gurus of the hardware sat around 20 (?) years ago pondering how to deal with > 64-bit as the architecture went forward, certainly two separate sets of > registers crossed their whiteboards. > > But I really like your "USING" idea. It's so easy to write a string of 64-bit > code and accidentally code an LR instead of an LGR or an AHI instead of an > AGHI somewhere in the middle. > > Charles > > > -----Original Message----- > From: IBM Mainframe Assembler List [mailto:[email protected]] > On Behalf Of Brent Longborough > Sent: Saturday, July 22, 2017 3:00 AM > To: [email protected] > Subject: Re: Superior IBM supplied "register equate" macro? > > Unfortunately, (like base registers), registers can change the "meaning" > of their contents at different points in the program. > > Rather than static equates giving the same register two different names, I > think it would be cleaner, and safer, to have a directive analogous to USING > which would say to HLASM (for example) "From this point in the code until > further notice, R0 being used for a 64-bit value". > > Or, better yet, maybe(in my dreams!?) have two sets of registers -- one for > 32-bit ops and one for 64-bit. > > I'm not holding my breath for either, though. > > Brent Longborough
