Fix exec() for atarixl target.

The final part of exec() called 'excexit' and only then restored the
stack pointer to its value at program entry.  'excexit' does all
cleanup (the same as '_exit()'), which means that on the atarixl
target the ROM is banked in again.  On big programs the 'SP_save'
variable might reside at a high memory address which is no longer
accessible after the ROM has been banked in.
The change just moves the restoration of the stack pointer before
the call to 'excexit'.

Another change lets exec.s compile if UCASE_FILENAME is not defined.
And some other small cleanups, also in open.s.
This commit is contained in:
Christian Groessler
2016-06-15 23:52:16 +02:00
parent 2c8b8d90bf
commit ec7751332f
2 changed files with 14 additions and 9 deletions

View File

@@ -8,6 +8,7 @@
.include "fcntl.inc"
.include "errno.inc"
.include "fd.inc"
.include "zeropage.inc"
.export _open
.destructor closeallfiles, 5
@@ -19,9 +20,7 @@
.import incsp4
.import ldaxysp,addysp
.import __oserror
.importzp tmp4,tmp2
.ifdef UCASE_FILENAME
.importzp tmp3
.import ucase_fn
.endif