Skip to content

Commit 4ba42d9

Browse files
LOAD/RUN now don't clear if file doesn't exist. Saves 12 bytes.
1 parent 9b65ada commit 4ba42d9

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

intbasic.system.s

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,12 @@ done_path:
270270
;;; Load program (if given) and invoke Integer BASIC
271271

272272
.proc Initialize
273-
;; Cold start - initialize Integer BASIC
274-
jsr ColdStart
275-
276273
;; Do we have a path?
277274
lda PATHBUF
278275
bne have_path
279276

280277
;; No, just show with prompt
278+
jsr ColdStart
281279
jsr SwapZP ; ProDOS > IntBASIC
282280
jmp intbasic::WARM
283281

@@ -286,12 +284,11 @@ done_path:
286284

287285
have_path:
288286
jsr LoadINTFile
289-
beq :+
290-
jmp QuitCmd ; fail - just QUIT back to ProDOS
291-
:
292-
;; Run the program
287+
bne quit
293288
jsr SwapZP ; ProDOS > IntBASIC
294289
jmp intbasic::RUN
290+
291+
quit: jmp QuitCmd ; fail - just QUIT back to ProDOS
295292
.endproc ; Initialize
296293

297294
;;; ============================================================
@@ -335,6 +332,9 @@ open:
335332
;; In theory we should check geteof_eof+2 and fail
336333
;; if > 64k, but how would such a file be created?
337334

335+
;; At this point we're committed - reset HIMEM etc.
336+
jsr ColdStart
337+
338338
;; Set up zero page locations for the calculation
339339
jsr SwapZP ; ProDOS > IntBASIC
340340
LDXY geteof_eof
@@ -1092,33 +1092,22 @@ seen_params:
10921092
;;; "LOAD pathname"
10931093

10941094
.proc LoadCmd
1095-
;; Pop out of command hook - no going back now
1096-
pla
1097-
pla
1098-
1099-
jsr ColdStart
11001095
jsr LoadINTFile
1101-
bne err
1096+
bne ret
11021097

11031098
jsr SwapZP ; ProDOS > IntBASIC
11041099
jmp intbasic::WARM
11051100

1106-
err:
1107-
jsr ColdStart
1108-
jmp ShowError
1101+
ret: rts
11091102
.endproc ; LoadCmd
11101103

11111104
;;; ============================================================
11121105
;;; "RUN pathname"
11131106

11141107
.proc RunCmd
1115-
;; Pop out of command hook - no going back now
1116-
pla
1117-
pla
1118-
1119-
jsr ColdStart
11201108
jsr LoadINTFile
1121-
bne LoadCmd::err
1109+
bne LoadCmd::ret
1110+
11221111
jsr SwapZP ; ProDOS > IntBASIC
11231112
jmp intbasic::RUN
11241113
.endproc ; RunCmd

0 commit comments

Comments
 (0)