Hey all,
I had some free time and decided to write myself a 65816 assembler. If, for whatever reason, you're not satisfied with the excellent 65816 assemblers out there already, check it out on github.
Any feature requests, bug reports, complaints or praises welcome.
Cheers!
The readme looks something like this:
I had some free time and decided to write myself a 65816 assembler. If, for whatever reason, you're not satisfied with the excellent 65816 assemblers out there already, check it out on github.
Any feature requests, bug reports, complaints or praises welcome.
Cheers!
The readme looks something like this:
Code:
snap (Super Nintendo Assembling Program) is a multi-pass 65816 assembler.
USAGE:
snap [-s <sym-file>] <in-file> <out-file>
(<sym-file> is where the assembler will dump its symbol table in the end.
This way you can easily determine what address a procedure is located at,
so you can add breakpoints or whatever)
Expression parsing isn't done yet. It may be, one day. As need basis.
Macros are not implemented. They may never be.
Syntax generally follows that laid out in the WDC 65816 docs and datasheets.
COMPILING:
just compiling all the C files and linking them together should do it.
One day I might write a makefile.
gcc -ansi -Wall -g -c *.c
gcc -ansi -Wall -g *.o -o snap
TODO:
-absolute modifiers
-more math/expression parsing
-a bunch more directives
-more features for the existing directives
-riddled with bugs I am sure
-a makefile
WHAT'S DONE:
-all instructions/addressing modes
-very very basic math/expression parsing
-multipass optimization
-memmap output - very handy!
; comments look like this
LabelsLookLikeThis:
JMP LabelsLookLikeThis
.localLabelsLookLikeThis:
beq .localLabelsLookLikeThis
DefinesLookLikeThis: equ $20
LDA #DefinesLookLikeThis
STA DefinesLookLikeThis
INCSRC "defines.asm"
INCBIN "binarydata.bin"
ORG $8000 ; doesn't actually write any data, just changes the current PC
; the usual 65816 stuff
XCE
CLC
lda #$12 ; case insensitivity
sta $2100
LdA #%10010100 ; case insensitivity!
STA $00
LONGA ON
LONGA OFF
LONGI ON
LONGI OFF ; these don't actually emit the necessary REP/SEP ops - they're for
; the assembler only
PAD $FFC0 ; writes 0s until PC = operand
ASCII "GAME TITLE"
PAD $FFD5
DB $20
PAD $FFFC
DW Start
USAGE:
snap [-s <sym-file>] <in-file> <out-file>
(<sym-file> is where the assembler will dump its symbol table in the end.
This way you can easily determine what address a procedure is located at,
so you can add breakpoints or whatever)
Expression parsing isn't done yet. It may be, one day. As need basis.
Macros are not implemented. They may never be.
Syntax generally follows that laid out in the WDC 65816 docs and datasheets.
COMPILING:
just compiling all the C files and linking them together should do it.
One day I might write a makefile.
gcc -ansi -Wall -g -c *.c
gcc -ansi -Wall -g *.o -o snap
TODO:
-absolute modifiers
-more math/expression parsing
-a bunch more directives
-more features for the existing directives
-riddled with bugs I am sure
-a makefile
WHAT'S DONE:
-all instructions/addressing modes
-very very basic math/expression parsing
-multipass optimization
-memmap output - very handy!
; comments look like this
LabelsLookLikeThis:
JMP LabelsLookLikeThis
.localLabelsLookLikeThis:
beq .localLabelsLookLikeThis
DefinesLookLikeThis: equ $20
LDA #DefinesLookLikeThis
STA DefinesLookLikeThis
INCSRC "defines.asm"
INCBIN "binarydata.bin"
ORG $8000 ; doesn't actually write any data, just changes the current PC
; the usual 65816 stuff
XCE
CLC
lda #$12 ; case insensitivity
sta $2100
LdA #%10010100 ; case insensitivity!
STA $00
LONGA ON
LONGA OFF
LONGI ON
LONGI OFF ; these don't actually emit the necessary REP/SEP ops - they're for
; the assembler only
PAD $FFC0 ; writes 0s until PC = operand
ASCII "GAME TITLE"
PAD $FFD5
DB $20
PAD $FFFC
DW Start