Download XC164CM
Transcript
XC164CM System Units (Vol. 1 of 2) Central Processing Unit (CPU) 4.7.3 Indirect Addressing Modes Indirect addressing modes can be considered as a combination of short and long addressing modes. This means that the “long” 16-bit pointer is provided indirectly by the contents of a word GPR which itself is specified directly by a short 4-bit address (‘Rw’ = 0 … 15). There are indirect addressing modes, which add a constant value to the GPR contents before the long 16-bit address is calculated. Other indirect addressing modes can decrement or increment the indirect address pointers (GPR contents) by 2 or 1 (referring to words or bytes) or by the contents of the offset registers QR0 or QR1. Table 4-19 Generating Physical Addresses from Indirect Pointers Step Executed Action Calculation Notes see Table 4-17 1 Calculate the address of the GPR Address = indirect pointer (word GPR) 2 × Short Addr. [+ (CP)] from its short address 2 Pre-decrement indirect pointer (‘-Rw’) depending on datatype (∆ = 1 or 2 for byte or word operations) (GPR Address) = Optional step, executed only if (GPR Address) required by addressing mode -∆ 3 Adjust the pointer by a constant value (‘Rw + const16’) Pointer = (GPR Address) + Constant 4 Calculate the physical 24-bit Physical Addr. = Uses DPPs or page/segment address using the resulting Page/Segment + override mechanisms, pointer Pointer offset see Table 4-18 5 Post-in/decrement indirect (GPR Address) = Optional step, executed only if pointer (‘Rw±’) depending required by addressing mode (GPR Address) on datatype (∆ = 1 or 2 for ± ∆ byte or word operations), or depending on offset registers (∆ = QRx)1) Optional step, executed only if required by addressing mode 1) Post-decrement and QRx-based modification is provided only for CoXXX instructions. Note: Some instructions only use the lowest four word GPRs (R3 … R0) as indirect address pointers, which are specified via short 2-bit addresses in that case. The following indirect addressing modes are provided: User’s Manual CPUSV2_X, V2.2 4-45 V1.2, 2006-03