-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
88 lines (66 loc) · 1.9 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
snap (Super Nintendo Assembling Program) is a multi-pass 65816 assembler.
snap is GPL'd software.
If you want to change it or improve it, please do so for everyone. Thanks!
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)
Syntax generally follows that laid out in the WDC 65816 docs and datasheets.
COMPILING:
run make. copy/install snap to your bin directory if that makes you happy.
TODO:
-absolute modifiers
-more math/expression parsing - right now snap only supports + and -
-a bunch more directives
-more features for the existing directives
-riddled with bugs I am sure
WHAT'S DONE:
-all instructions/addressing modes
-very very basic math/expression parsing
-multipass optimization
-memmap output - very handy!
It's very important that when you modify D or DBR you pass this
info to the assember so that it resolves labels correctly.
LDA #$80
PHA
PLD
SETDBR #$80
LDA #$0800
TCD
SETD #$0800
; comments look like this
LabelsLookLikeThis:
JMP LabelsLookLikeThis
.localLabelsLookLikeThis:
beq .localLabelsLookLikeThis
LabelsCanGoOnTheSameLine: bra LabelsCanGoOnTheSameLine
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
STA $20+5 ; maths!
STA $20-5
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
MultiByteDefine1:
DB 0,1,2,3,4,5,6
MultiByteDefine2: DW 1,2,3,4,5,6