-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.mac
66 lines (66 loc) · 819 Bytes
/
util.mac
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
macro
&lab stzl &address
stz &address
stz &address+2
mend
macro
&lab plax
&lab pla
plx
mend
macro
&lab ldax &address,&off
lclc &c
&lab anop
&c amid &address,1,1
aif "&c"="[",.deref
aif "&c"="#",.imm
lda &address
ldx &address+2
mexit
.deref
mexit
.imm
aif "&address"="0",.imm0
&address amid &address,2,l:&address-1
lda #&address
ldx #^&address
mexit
.imm0
lda #0
tax
mexit
.deref
&address amid &address,2,l:&address-2
aif c:&off=0,.deref0
aif "&off"="y",.derefy
&c amid &off,1,1
aif "&c"<>"#",.derefldy
ldy &off+2
ago .deref2
.derefldy
ldy &off
.derefy
iny
iny
.deref2
lda [&address],y
tax
dey
dey
lda [&address],y
mexit
.deref0
ldy #2
lda [&address],y
tax
lda [&address]
mend
macro
&lab stax &address
lclc &c
&lab anop
&c amid &address,1,1
sta &address
stx &address+2
mend