Question:
1. Is the below variations of code documented anywhere? The LDX instruction?
2. What happens when using the rts_ext.lib. I tried this w/ Ver 1.20 code gen tools and
when I placed the .bss section in an extended mem portion -
the boot routine failed ( no autoinit done ).
3. Basically, what. should we do at the C level?
Please clarify the following:
Some variation of the following code will work, at the assembly level.
| LDX |
#address,16,A |
; loads upper 7 bits of the 23 bits
; of #address and shifts it into the
; upper part of AccA |
| OR |
#address,A,A |
; adds in the lower 16bits of #address
; into the lower half of AccA |
READA
WRITEA |
*AR....
*AR... |
; Now the full 23 bits of address is
; in the accumulator. |
Answer: The LDX
instruction is not documented because it is not a real
instruction (meaning it has no unique opcode from LD). It is a pseudo-instruction used by the C compiler.
This name LDX simply tells the assembler to assemble an LD instruction, but use the upper
half of the long address as the long constant instead of the lower half. This is not an issue in C because the C compiler uses this method
already (this is where it cam from). |