mirror of
https://github.com/cc65/cc65.git
synced 2025-02-20 14:29:03 +00:00
Merge pull request #312 from groessler/atari-exec-devel
Fix exec() for atarixl target.
This commit is contained in:
commit
a7323d399e
@ -11,11 +11,9 @@
|
|||||||
.import __dos_type
|
.import __dos_type
|
||||||
.import findfreeiocb
|
.import findfreeiocb
|
||||||
.import incsp2
|
.import incsp2
|
||||||
.import __do_oserror
|
|
||||||
.import excexit ; from crt0.s
|
.import excexit ; from crt0.s
|
||||||
.import SP_save ; from crt0.s
|
.import SP_save ; from crt0.s
|
||||||
.ifdef UCASE_FILENAME
|
.ifdef UCASE_FILENAME
|
||||||
.importzp tmp3
|
|
||||||
.import ucase_fn
|
.import ucase_fn
|
||||||
.import addysp
|
.import addysp
|
||||||
.endif
|
.endif
|
||||||
@ -24,7 +22,10 @@
|
|||||||
.include "errno.inc"
|
.include "errno.inc"
|
||||||
.include "atari.inc"
|
.include "atari.inc"
|
||||||
|
|
||||||
CMDLINE_BUFFER = $0100 ; put progname + cmdline as one single string there
|
; area $0100 to $0128 might be in use (e.g. Hias' high speed patch)
|
||||||
|
CMDLINE_BUFFER = $0129 ; put progname + cmdline as one single string there
|
||||||
|
; alternatively:
|
||||||
|
;CMDLINE_BUFFER = $0480 ; put progname + cmdline as one single string there
|
||||||
CMDLINE_MAX = 40+3 ; max. length of drive + progname + cmdline
|
CMDLINE_MAX = 40+3 ; max. length of drive + progname + cmdline
|
||||||
|
|
||||||
.code
|
.code
|
||||||
@ -85,6 +86,11 @@ copyp: lda (ptr4),y
|
|||||||
; programe name too long
|
; programe name too long
|
||||||
beq invret
|
beq invret
|
||||||
|
|
||||||
|
.ifndef UCASE_FILENAME
|
||||||
|
invret: lda #EINVAL
|
||||||
|
bne seterr
|
||||||
|
.endif
|
||||||
|
|
||||||
; file name copied, check for args
|
; file name copied, check for args
|
||||||
|
|
||||||
copypd: tya ; put Y into X (index into CMDLINE_BUFFER)
|
copypd: tya ; put Y into X (index into CMDLINE_BUFFER)
|
||||||
@ -171,12 +177,12 @@ openok: lda #>buf
|
|||||||
; program file appears to be available and good
|
; program file appears to be available and good
|
||||||
; here's the point of no return
|
; here's the point of no return
|
||||||
|
|
||||||
|
ldx SP_save
|
||||||
|
txs ; reset stack pointer to what it was at program entry
|
||||||
lda tmp4 ; get IOCB index
|
lda tmp4 ; get IOCB index
|
||||||
pha ; and save it ('excexit' calls destructors and they might destroy tmp4)
|
pha ; and save it ('excexit' calls destructors and they might destroy tmp4)
|
||||||
jsr excexit
|
jsr excexit ; on atarixl this will enable the ROM again, making all high variables inaccessible
|
||||||
pla
|
pla
|
||||||
ldx SP_save
|
|
||||||
txs ; reset stack pointer
|
|
||||||
tax ; IOCB index in X
|
tax ; IOCB index in X
|
||||||
|
|
||||||
lda #<CMDLINE_BUFFER
|
lda #<CMDLINE_BUFFER
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
.include "fcntl.inc"
|
.include "fcntl.inc"
|
||||||
.include "errno.inc"
|
.include "errno.inc"
|
||||||
.include "fd.inc"
|
.include "fd.inc"
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
.export _open
|
.export _open
|
||||||
.destructor closeallfiles, 5
|
.destructor closeallfiles, 5
|
||||||
@ -19,9 +20,7 @@
|
|||||||
.import incsp4
|
.import incsp4
|
||||||
.import ldaxysp,addysp
|
.import ldaxysp,addysp
|
||||||
.import __oserror
|
.import __oserror
|
||||||
.importzp tmp4,tmp2
|
|
||||||
.ifdef UCASE_FILENAME
|
.ifdef UCASE_FILENAME
|
||||||
.importzp tmp3
|
|
||||||
.import ucase_fn
|
.import ucase_fn
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user