From: ol.sc Date: Sun, 10 Jun 2012 21:05:51 +0000 (+0000) Subject: Moved Apple EXEHDR to separate module (similiar to CBMs). X-Git-Tag: V2.14~360 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9cc99876b23274f73d58b2aa0e519799ba49e049;p=cc65 Moved Apple EXEHDR to separate module (similiar to CBMs). git-svn-id: svn://svn.cc65.org/cc65/trunk@5708 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/apple2/Makefile b/libsrc/apple2/Makefile index 242893d1e..9b0a4938e 100644 --- a/libsrc/apple2/Makefile +++ b/libsrc/apple2/Makefile @@ -72,6 +72,7 @@ S_OBJS= _scrsize.o \ dosdetect.o \ drives.o \ exec.o \ + exehdr.o \ filedes.o \ filename.o \ get_ostype.o \ diff --git a/libsrc/apple2/crt0.s b/libsrc/apple2/crt0.s index 83daf0740..9bc8ac68b 100644 --- a/libsrc/apple2/crt0.s +++ b/libsrc/apple2/crt0.s @@ -1,33 +1,22 @@ ; -; Oliver Schmidt, 15.09.2009 +; Oliver Schmidt, 2009-09-15 ; ; Startup code for cc65 (Apple2 version) ; .export _exit, done, return - .export __STARTUP__ : absolute = 1 ; Mark as startup + .export __STARTUP__ : absolute = 1 ; Mark as startup .import zerobss .import initlib, donelib .import callmain, callirq - .import __RAM_START__ , __RAM_LAST__ ; Linker generated - .import __MOVE_START__, __MOVE_LAST__ ; Linker generated - .import __LC_START__ , __LC_LAST__ ; Linker generated - .import __ZPSAVE_RUN__, __INIT_SIZE__ ; Linker generated + .import __RAM_LAST__, __ZPSAVE_RUN__ ; Linker generated + .import __LC_START__, __LC_LAST__ ; Linker generated + .import __INIT_SIZE__ ; Linker generated .import __INTERRUPTOR_COUNT__ ; Linker generated .include "zeropage.inc" .include "apple2.inc" - .linecont + - -; ------------------------------------------------------------------------ - - .segment "EXEHDR" - - .addr __RAM_START__ ; Start address - .word __ZPSAVE_RUN__ - __RAM_START__ + \ - __MOVE_LAST__ - __MOVE_START__ ; Size - ; ------------------------------------------------------------------------ .segment "STARTUP" diff --git a/libsrc/apple2/exehdr.s b/libsrc/apple2/exehdr.s new file mode 100644 index 000000000..5ebd6f7f1 --- /dev/null +++ b/libsrc/apple2/exehdr.s @@ -0,0 +1,20 @@ +; +; Oliver Schmidt, 2012-06-10 +; +; This module supplies a 4 byte DOS 3.3 header +; containing the load address and load length. +; + + .export __EXEHDR__ : absolute = 1 ; Linker referenced + .import __RAM_START__, __ZPSAVE_RUN__ ; Linker generated + .import __MOVE_START__, __MOVE_LAST__ ; Linker generated + + .linecont + + +; ------------------------------------------------------------------------ + + .segment "EXEHDR" + + .addr __RAM_START__ ; Start address + .word __ZPSAVE_RUN__ - __RAM_START__ + \ + __MOVE_LAST__ - __MOVE_START__ ; Size diff --git a/libsrc/apple2enh/Makefile b/libsrc/apple2enh/Makefile index 746bc1bc5..4d984901f 100644 --- a/libsrc/apple2enh/Makefile +++ b/libsrc/apple2enh/Makefile @@ -75,6 +75,7 @@ S_OBJS= _scrsize.o \ dosdetect.o \ drives.o \ exec.o \ + exehdr.o \ filedes.o \ filename.o \ get_ostype.o \ diff --git a/src/ld65/cfg/apple2-dos33.cfg b/src/ld65/cfg/apple2-dos33.cfg index a8155e492..091406e5c 100644 --- a/src/ld65/cfg/apple2-dos33.cfg +++ b/src/ld65/cfg/apple2-dos33.cfg @@ -4,6 +4,7 @@ FEATURES { STARTADDRESS: default = $0803; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2-loader.cfg b/src/ld65/cfg/apple2-loader.cfg index c1eb81fd4..68556a277 100644 --- a/src/ld65/cfg/apple2-loader.cfg +++ b/src/ld65/cfg/apple2-loader.cfg @@ -4,6 +4,7 @@ FEATURES { STARTADDRESS: default = $0800; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2-reboot.cfg b/src/ld65/cfg/apple2-reboot.cfg index e24eff04a..82b2ea59b 100644 --- a/src/ld65/cfg/apple2-reboot.cfg +++ b/src/ld65/cfg/apple2-reboot.cfg @@ -5,6 +5,7 @@ FEATURES { STARTADDRESS: default = $0800; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2-system.cfg b/src/ld65/cfg/apple2-system.cfg index f888f3bcb..187cc7907 100644 --- a/src/ld65/cfg/apple2-system.cfg +++ b/src/ld65/cfg/apple2-system.cfg @@ -1,6 +1,7 @@ # Configuration for ProDOS 8 system programs (without the header) SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2.cfg b/src/ld65/cfg/apple2.cfg index 64a1b4f63..00d615644 100644 --- a/src/ld65/cfg/apple2.cfg +++ b/src/ld65/cfg/apple2.cfg @@ -4,6 +4,7 @@ FEATURES { STARTADDRESS: default = $0803; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2enh-dos33.cfg b/src/ld65/cfg/apple2enh-dos33.cfg index a8155e492..091406e5c 100644 --- a/src/ld65/cfg/apple2enh-dos33.cfg +++ b/src/ld65/cfg/apple2enh-dos33.cfg @@ -4,6 +4,7 @@ FEATURES { STARTADDRESS: default = $0803; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2enh-loader.cfg b/src/ld65/cfg/apple2enh-loader.cfg index c1eb81fd4..68556a277 100644 --- a/src/ld65/cfg/apple2enh-loader.cfg +++ b/src/ld65/cfg/apple2enh-loader.cfg @@ -4,6 +4,7 @@ FEATURES { STARTADDRESS: default = $0800; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2enh-reboot.cfg b/src/ld65/cfg/apple2enh-reboot.cfg index e24eff04a..82b2ea59b 100644 --- a/src/ld65/cfg/apple2enh-reboot.cfg +++ b/src/ld65/cfg/apple2enh-reboot.cfg @@ -5,6 +5,7 @@ FEATURES { STARTADDRESS: default = $0800; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2enh-system.cfg b/src/ld65/cfg/apple2enh-system.cfg index f888f3bcb..187cc7907 100644 --- a/src/ld65/cfg/apple2enh-system.cfg +++ b/src/ld65/cfg/apple2enh-system.cfg @@ -1,6 +1,7 @@ # Configuration for ProDOS 8 system programs (without the header) SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY { diff --git a/src/ld65/cfg/apple2enh.cfg b/src/ld65/cfg/apple2enh.cfg index 64a1b4f63..00d615644 100644 --- a/src/ld65/cfg/apple2enh.cfg +++ b/src/ld65/cfg/apple2enh.cfg @@ -4,6 +4,7 @@ FEATURES { STARTADDRESS: default = $0803; } SYMBOLS { + __EXEHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2k stack } MEMORY {