
10.4 Sets and Regular Expressions as Language Constructs 265
be an assembler-recognized register. For the microarchitecture references, we can
define the physical registers as generic 32-bit registers using a built-in ar tifact:
register file
gpr [8, 32] # 8 registers, 32 bits each
"%reg0" 0, "%reg1" 1, "%reg2" 2, "%reg3" 3,
"%reg4" 4, "%reg5" 5, "%reg6" 6, "%reg7" 7;
We can now use a union to define the symbolic registers and the parts of the physical
register used. In the notation
[start_bit:length] bits are numbered from high bit down
to zero.
union
"%eax" %reg0[31:32], "%ecx" %reg1[31:32], .... # 32 bit registers
"%ax" %reg0[15:16], "%cx" %reg1[15:16], ...