Skip to content

Commit ab9050f

Browse files
authored
Merge pull request #240 from davidgiven/neo
General zif updates.
2 parents 25360f7 + 0d552ba commit ab9050f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2018
-1979
lines changed

apps/adm3adrv.S

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ state2: ; read row, --> state 3
7777
state1: ; char after ESC, if '=' --> state 2, otherwise --> state 0
7878
pla
7979
cmp #'='
80-
zif_eq
80+
zif eq
8181
inc state
8282
rts
8383
zendif
@@ -88,26 +88,26 @@ state1: ; char after ESC, if '=' --> state 2, otherwise --> state 0
8888
state0:
8989
pla
9090
cmp #127 ; DEL/RUB (rubout)
91-
zif_eq
91+
zif eq
9292
inc rubout
9393
jmp do_rubout
9494
zendif
9595
cmp #32
96-
zif_cs ; normal ASCII
96+
zif cs ; normal ASCII
9797
ldy #SCREEN_PUTCHAR
9898
jsr SCREEN
9999

100100
advance_position:
101101
inc xpos
102102
lda xpos
103103
cmp width
104-
zif_cs
104+
zif cs
105105
lda #0
106106
sta xpos
107107
inc ypos
108108
lda ypos
109109
cmp height
110-
zif_cs
110+
zif cs
111111
dec ypos
112112
ldy #SCREEN_SCROLLUP
113113
jsr SCREEN
@@ -117,17 +117,17 @@ advance_position:
117117
zendif
118118

119119
cmp #$08
120-
zif_eq ; ^H backspace, move cursor to the left
120+
zif eq ; ^H backspace, move cursor to the left
121121
do_rubout:
122122
dec xpos
123123
lda xpos
124-
zif_mi
124+
zif mi
125125
ldx width
126126
dex
127127
stx xpos
128128
dec ypos
129129
lda ypos
130-
zif_mi
130+
zif mi
131131
inc ypos
132132
lda #0
133133
sta xpos
@@ -138,7 +138,7 @@ do_rubout:
138138
ldy #SCREEN_SETCURSOR
139139
jsr SCREEN
140140
lda rubout ; check flag
141-
zif_ne
141+
zif ne
142142
lda #' '
143143
ldy #SCREEN_PUTCHAR
144144
jsr SCREEN
@@ -149,11 +149,11 @@ do_rubout:
149149
zendif
150150

151151
cmp #$0a
152-
zif_eq ; ^J line feed, move cursor down one line, optional scroll
152+
zif eq ; ^J line feed, move cursor down one line, optional scroll
153153
inc ypos
154154
lda ypos
155155
cmp height
156-
zif_cs
156+
zif cs
157157
dec ypos
158158
ldy #SCREEN_SCROLLUP
159159
jsr SCREEN
@@ -162,35 +162,35 @@ do_rubout:
162162
zendif
163163

164164
cmp #$0b
165-
zif_eq ; ^K upline, move cursor up one line, bump against top
165+
zif eq ; ^K upline, move cursor up one line, bump against top
166166
dec ypos
167-
zif_mi
167+
zif mi
168168
inc ypos
169169
zendif
170170
jmp LEAVE
171171
zendif
172172

173173
cmp #$0c
174-
zif_eq ; ^L forward space, move cursor to the right, opt. scroll
174+
zif eq ; ^L forward space, move cursor to the right, opt. scroll
175175
jmp advance_position
176176
zendif
177177

178178
cmp #$0d
179-
zif_eq ; ^M carriage return, move cursor to begin of line
179+
zif eq ; ^M carriage return, move cursor to begin of line
180180
lda #0
181181
sta xpos
182182
jmp LEAVE
183183
zendif
184184

185185
cmp #$1a
186-
zif_eq ; ^Z clear screen, (home cursor?)
186+
zif eq ; ^Z clear screen, (home cursor?)
187187
ldy #SCREEN_CLEAR
188188
jsr SCREEN
189189
jmp home_cursor
190190
zendif
191191

192192
cmp #$1e
193-
zif_eq ; ^^ home cursor
193+
zif eq ; ^^ home cursor
194194
home_cursor:
195195
lda #0
196196
sta xpos
@@ -199,7 +199,7 @@ home_cursor:
199199
zendif
200200

201201
cmp #$1b ; ESC --> state 1
202-
zif_eq
202+
zif eq
203203
inc state
204204
rts
205205
zendif
@@ -236,7 +236,7 @@ zproc init
236236
ldy #BIOS_FINDDRV
237237
jsr BIOS
238238

239-
zif_cs
239+
zif cs
240240
lda #<noscreen
241241
ldx #>noscreen
242242
ldy #BDOS_WRITE_STRING
@@ -253,7 +253,7 @@ zproc init
253253
ldy #BIOS_ADDDRV
254254
jsr BIOS
255255

256-
zif_cc
256+
zif cc
257257
; claim memory
258258

259259
ldy #BIOS_GETTPA

apps/adm3atst.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.label test_string
44
.label BIOS
55

6-
.zproc start
6+
zproc start
77
lda #<test_string
88
ldx #>test_string
99
ldy #BDOS_PRINTSTRING
@@ -20,7 +20,7 @@ BIOS:
2020
jsr $1234
2121

2222
rts
23-
.zendproc
23+
zendproc
2424

2525
test_string:
2626
.byte 26, "ADM-3A TEST - Screen cleared", 11,11, 13,10

apps/asm.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,23 +1440,29 @@ static void consumeInclude()
14401440
token = currentByte = ';';
14411441
}
14421442

1443-
static void lookupAndCall(const SymbolCallbackEntry* entries)
1443+
static bool lookupAndCall(const SymbolCallbackEntry* entries)
14441444
{
14451445
for (;;)
14461446
{
14471447
if (strcmp(entries->string, parseBuffer) == 0)
14481448
{
14491449
consumeToken();
14501450
entries->callback();
1451-
return;
1451+
return true;
14521452
}
14531453
entries++;
14541454

14551455
if (!entries->string)
1456-
fatal("unknown pseudo-op");
1456+
return false;
14571457
}
14581458
}
14591459

1460+
static void lookupAndCallOrFail(const SymbolCallbackEntry* entries)
1461+
{
1462+
if (!lookupAndCall(entries))
1463+
fatal("unknown pseudo-op");
1464+
}
1465+
14601466
static void parse()
14611467
{
14621468
top = cpm_ram;
@@ -1469,6 +1475,11 @@ static void parse()
14691475
{"fill", consumeDotFill},
14701476
{"expand", consumeDotExpand},
14711477
{"label", consumeDotLabel},
1478+
{"include", consumeInclude},
1479+
{}
1480+
};
1481+
1482+
static const SymbolCallbackEntry nondotEntries[] = {
14721483
{"zproc", consumeZproc},
14731484
{"zendproc", consumeZendproc},
14741485
{"zloop", consumeZloop},
@@ -1479,7 +1490,6 @@ static void parse()
14791490
{"zuntil", consumeZuntil},
14801491
{"zif", consumeZif},
14811492
{"zendif", consumeZendif},
1482-
{"include", consumeInclude},
14831493
{}
14841494
};
14851495

@@ -1497,10 +1507,15 @@ static void parse()
14971507
case '.':
14981508
consumeToken();
14991509
expect(TOKEN_ID);
1500-
lookupAndCall(dotEntries);
1510+
lookupAndCallOrFail(dotEntries);
15011511
break;
15021512

15031513
case TOKEN_ID:
1514+
/* Pseudooperations. */
1515+
1516+
if (lookupAndCall(nondotEntries))
1517+
break;
1518+
15041519
/* Process instructions. */
15051520

15061521
if (tokenLength == 3)

0 commit comments

Comments
 (0)