mirror of
https://github.com/cc65/cc65.git
synced 2025-03-04 16:30:33 +00:00
Behave more like BASIC.SYSTEM and allow for argv[0].
This commit is contained in:
parent
24e902059c
commit
ae4f9336b3
@ -28,6 +28,20 @@ _exec:
|
|||||||
jsr pushname
|
jsr pushname
|
||||||
bne oserr
|
bne oserr
|
||||||
|
|
||||||
|
; ProDOS TechRefMan, chapter 5.1.5.1:
|
||||||
|
; "The complete or partial pathname of the system program
|
||||||
|
; is stored at $280, starting with a length byte."
|
||||||
|
; In fact BASIC.SYSTEM does the same for BLOAD and BRUN of
|
||||||
|
; binary programs so we should do the same too in any case
|
||||||
|
; especially as _we_ rely on it in mainargs.s for argv[0].
|
||||||
|
ldy #$00
|
||||||
|
lda (sp),y
|
||||||
|
tay
|
||||||
|
: lda (sp),y
|
||||||
|
sta $0280,y
|
||||||
|
dey
|
||||||
|
bpl :-
|
||||||
|
|
||||||
; Set pushed name
|
; Set pushed name
|
||||||
lda sp
|
lda sp
|
||||||
ldx sp+1
|
ldx sp+1
|
||||||
@ -53,17 +67,6 @@ _exec:
|
|||||||
cmp #$FF ; SYS file?
|
cmp #$FF ; SYS file?
|
||||||
bne binary ; No, check for BIN file
|
bne binary ; No, check for BIN file
|
||||||
|
|
||||||
; ProDOS TechRefMan, chapter 5.1.5.1:
|
|
||||||
; "The complete or partial pathname of the system program
|
|
||||||
; is stored at $280, starting with a length byte."
|
|
||||||
ldy #$00
|
|
||||||
lda (sp),y
|
|
||||||
tay
|
|
||||||
: lda (sp),y
|
|
||||||
sta $0280,y
|
|
||||||
dey
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
; SYS programs replace BASIC.SYSTEM so set in the ProDOS system bit map
|
; SYS programs replace BASIC.SYSTEM so set in the ProDOS system bit map
|
||||||
; protection for pages $80 - $BF just in case BASIC.SYSTEM is there now
|
; protection for pages $80 - $BF just in case BASIC.SYSTEM is there now
|
||||||
ldx #$0F ; Start with protection for pages $B8 - $BF
|
ldx #$0F ; Start with protection for pages $B8 - $BF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user