The Keil assembler has eight 8 bit registers which can be alternatively used in some versions of the 8051 as four 16 bit registers or even two 32 bit registers:
8 bit: R0 R1 R2 R3 R4 R5 R6 R7 16 bit: WR0=R0:R1 WR2=R2:R3 WR4=R4:R5 WR6=R6:R7 32 BIR: DR0=R0:R1:R2:R3 DR4=R4:R5:R6:R7I would like to write some macros to ease the usage of the WRx and DRx register combinations. If the argument is WR4, a sequence of instructions like
ADD .. R5 ADDC .. R4
and if the argument is DR0, a sequence like
ADD .. R3 ADDC .. R2 ADDC .. R1 ADDC .. R0
shall be generated. How can this be easily done?