8BIT wrote:
I discovered that wanting to code a absolute long address mode with a variable that was word-sized resulted in the instruction getting coded as absolute. it seems that the backslash is the only special character not used, so I tried it as an experiment.
I have updated this a little to increase flexibility. I've added a numeric after the \ to indicate the number of bytes to use. This allows for specific modes when needed, such as forcing Absolute long in bank zero, or using absolute vs. direct page addressing for addresses < 256.
The format looks like this:
\1 byte sized - takes least significant byte of the operand
\2 word sized - takes least significant 2 bytes of the operand
\3 long sized - takes full 24 bit value of the operand
Code:
long = $123456
word = $007890
byte = $89
BF 56 34 12 LDA long, X ; good
BF 90 78 00 LDA \3word, X ; force long mode
BF 89 00 00 LDA \3byte, X ; force long mode
BD 89 00 LDA \2byte, X ; force absolute mode vs direct.
BF FF FF 00 LDA \3$FFFF, X ; can be used with numeric constants also.
My next task is to expand the memory coverage to the full 16MB space, and address any issue that get found along the way.
Daryl
_________________
Please visit my website ->
https://sbc.rictor.org/