]> git.sur5r.net Git - cc65/commitdiff
Set default start address to 0x300.
authorStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Sun, 16 Nov 2014 19:07:59 +0000 (20:07 +0100)
committerStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Sun, 16 Nov 2014 19:07:59 +0000 (20:07 +0100)
Make start address configurable via --start-addr.

cfg/c1p.cfg
src/c1p65/main.c

index f1d73921574db7d697f62ae33d378467c3df41b6..d4c248c4f895cf59f99868cd91cec058c19eae64 100644 (file)
@@ -1,9 +1,21 @@
+FEATURES {
+    CONDES: type    = constructor,
+            label   = __CONSTRUCTOR_TABLE__,
+            count   = __CONSTRUCTOR_COUNT__,
+            segment = INIT;
+    CONDES: type    = destructor,
+            label   = __DESTRUCTOR_TABLE__,
+            count   = __DESTRUCTOR_COUNT__,
+            segment = RODATA;
+    STARTADDRESS: default = $0300;
+}
 SYMBOLS {
     __STACKSIZE__: type = weak, value = $0400; # 1k stack
+    __HIMEM__:     type = weak, value = $2000; # Presumed RAM end
 }
 MEMORY {
     ZP:       file = "", define = yes, start = $0002, size = $001A;
-    RAM:      file = %O, define = yes, start = $0400, size = $2000 - __STACKSIZE__;
+    RAM:      file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
 }
 SEGMENTS {
     STARTUP:  load = RAM, type = ro;
@@ -15,13 +27,3 @@ SEGMENTS {
     BSS:      load = RAM, type = bss, define = yes;
     ZEROPAGE: load = ZP,  type = zp;
 }
-FEATURES {
-    CONDES: type    = constructor,
-            label   = __CONSTRUCTOR_TABLE__,
-            count   = __CONSTRUCTOR_COUNT__,
-            segment = INIT;
-    CONDES: type    = destructor,
-            label   = __DESTRUCTOR_TABLE__,
-            count   = __DESTRUCTOR_COUNT__,
-            segment = RODATA;
-}
index 467953c57cbc5e243ff3f43d86e7103f7e212489..e4358ddcd38c2b4abf5b4c09273242ece27d809f 100644 (file)
@@ -133,7 +133,7 @@ int main (int argc, char *argv[])
        FILE *OutputFileFp = 0;\r
 \r
        /* Initialize with default start address defined in c1p.cfg */\r
-       unsigned long StartAddr = 0x400;\r
+       unsigned long StartAddr = 0x300;\r
 \r
     unsigned int I;\r
 \r