Si4010-C2
88
Rev. 1.0
25.2. XREG Registers
The chip contains another set of registers implemented in the
XREG
memory area. These registers are
located in the XDATA address space, addressable by MOVX instructions only. From CPU perspective it is
a regular external memory.
The advantage of the XREG registers is that they are viewed by the CPU as a regular memory. Therefore,
they can be declared as different data types, structures, array of bytes, and so on. With SFR we only have
special registers and it is not possible to declare them as long integers, for example. On the other hand the
SFR register access is faster and one can use arithmetic and logical operations on them.
Note registers in the XREG regions are aligned at 8, 16, and 32 bit boundaries and they are stored in
big
endian fashion. This is to support Keil C compiler, which uses
big endian
. Note that if the register is, say
23 bits wide, the 32 bits (4 bytes) are allocated for the register and the register is aligned in big endian
fashion.
Therefore, the LSB byte of the register will be at the address
<reg_addr>
+ 3, while the byte directly at the
<reg_addr>
is the MSB byte and is empty (read as 0x0), since the register itself is only 23 bits wide.
Table 25.3 shows a memory map of the XREG registers in the external memory space.