Fantastic, someone used the alternate SPC700 syntax in actual code :D
Shiru: May I ask what your overall impression was of the idea? It's meant to mimic 65816 assembly syntax.
Also if you had any ideas for improvement, that'd be great too. I'll be using that syntax in future bsnes debugger builds.
(Note that I did change the +n syntax to ,n to further match the 65816 in my WIP builds. Apologies, I can make you a table if you'd prefer not to change your code and have it work with bass v05+.)
Alternate SPC700 syntax
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
Alternate SPC700 syntax was really comfortable to use. I started with other SPC700 assemblers initially, and had problems figuring out opcodes betweed different docs and these assemblers. The alternate syntax was more 6502-like, except for that +n.
I can change +n to ,n in the source and update the archive when you release bass with this change, no problem.
I can change +n to ,n in the source and update the archive when you release bass with this change, no problem.
Appreciate the flexibility :DI can change +n to ,n in the source and update the archive when you release bass with this change, no problem.
Here's the updated version:
Code: Select all
http://byuu.org/files/bass_v05.tar.bz2+n -> ,n
x,y -> x=y (to prevent ambiguity with ,n indexing and to clarify operator order)
addr.bit -> addr:bit
sti -> stc, str (c = carry, r = RAM)
ldi -> ldc, ldr
ori -> orc, orr
not -> cmc (complement carry)
cbn, dbn -> bne, bnz
bnz sucks, so I was thinking about maybe bne y-=target and bne $00-=target; to match the lda (x)+ style. Not sure yet.
If you have any suggestions, I'm open to change. The table file is in bass/arch/table/snes-smp.arch; so feel free to experiment if you like.
As such, I can't guarantee this instruction set is 100% finalized until I have some peer review. If you'd rather wait for it to be settled instead of aiming for a moving target, I completely understand.
EDIT: okay, made these changes.
bnz *08=*08 -> bne --*08=*08
bnz y=*08 -> bne --y=*08
lda (x)+ -> lda (x++)
sta (x)+ -> sta (x++)
Prefix/postfix matches the actual opcode behavior.
Indeed, the "official" instruction set for the SPC700 was just painfully bad. The architecture is very much like a 6502, right down to the addressing modes [eg (dp,x) and (dp),y ]. It just extends things and adds a few curve-balls that make a direct mapping difficult (multiple argument instructions, mostly.)I had known for years that inside every SPC700 was a 6502 struggling to get out, and I was just waiting for someone to open the gate.
Stupidly, 6502 (and as a result, 65816) use addr,x instead of addr+x, which is a major problem for the SPC700's multiple arguments. I figure that it'd be an infinitely more difficult battle to get 6502/65816 users to start using lda $2000+x, so I had to change the multi-argument syntax for the SPC700 to =, eg and $08=#$20 ($08 &= #$20)
(Sorry for off-topic comment, let's split this thread [including the second-half of this comment] if discussion is to continue, please.)