Hi, I'm trying to emulate the SPC700, and the only two docs I've found on it are both a bit vague on how the address modes work. I can't find any official datasheets. I'm not expert at this stuff and it's tough to figure out exactly what to load from where.
By "address modes", I mean every type of comma-separated operand that could possibly follow a mnemonic in assembler source, because I need it divided up that finely for the trace debugger to know how to disassemble/format things for display and I need the debugger to make sure I implemented the rest of the processor right. :-/
Can those with more knowledge and experience on this advise me on whether I've got this right? I've made a list of all the address modes and how (I think) they're supposed to work. The symbols/formatting, too, I'm very unsure of. I've never done SPC700 assembly, so I'm sorta coming at this backwards.
Code: Select all
== Implied ==
Address: N/A
Value: Uses flags or addresses implied by the mnemonic.
== A ==
Address: none
Value: Accumulator
== X ==
Address: none
Value: Index X
== Y ==
Address: none
Value: Index Y
== YA ==
Address: none
Value: Word, using Y as the high byte and A as the low byte.
== SP ==
Address: none
Value: The stack pointer
== Carry ==
Symbol: C
Address: none
Value: The carry flag
== Immediate ==
Symbol: #$xx
Address: none
Value: Byte following the opcode
== Absolute ==
Symbol: !$xxxx
Address: 16-bit following the opcode
Value: At that address
== Absolute X ==
Symbol: !$xxxx+X
Address: 16-bit address following the opcode, + X
Wraps: Within 64 kB
Value: At that address
== Absolute Y ==
Like above.
== Absolute (Not) Bit ==
Symbol: !$xxx.d
Address: 16 bit-value follows the opcode. Low 13-bits are an absolute byte address. High 3-bits are a bit address within that byte.
Value: That bit.
== Direct ==
Symbol: $xx
Address: 0x0100 or 0x0000 plus the byte that follows the opcode.
Wraps: Within the direct page??
== Direct X ==
Symbol: $xx+X
Address: 0x0100 or 0x0000 plus the byte that follows the opcode plus X
Wraps: Within the direct page??
== Direct Y ==
Like above.
== Direct Indexed Indirect ==
Symbol: ($xx+X)
Address: 16-bit absolute address loaded from the Direct X location.
== Direct Indirect Indexed ==
Symbol: ($xx)+Y
Address: 16-bit absolute address loaded from the Direct location, then plus Y.
Wraps: Within 64 kB
== Indirect X ==
Symbol: (X)
Address: 0x0000 + X (so, does this mean it has range within page zero only???)
== Indirect Y ==
Like above.
== Direct Bit ==
Symbol: $xx.d
Address: Byte follows the opcode, added to 0x0100 or 0x0000. Bit is always encoded as part of the opcode (?)
== Relative ==
Symbol: label, probably, or $xx
Address: Byte follows the opcode, treated as signed, added to the instruction register
== Table Call ==
Symbol: decimal number
Address: 0xFFDE - (number * 2) loaded into instruction register
== PCall (what's this?) ==
Symbol: $xx (just a guess)
Address: Byte follows the opcode. Add to 0xFF00, then load into the instruction register.
Thank you for all help you can give.