First round of requested code changes

This commit is contained in:
Wayne Parham
2021-06-06 23:20:54 +01:00
parent ae9434e02e
commit 69e2313a63
18 changed files with 96 additions and 84 deletions

View File

@@ -5,42 +5,42 @@
# ld65 --config sym1-32k.cfg -o <prog>.bin <prog>.o # ld65 --config sym1-32k.cfg -o <prog>.bin <prog>.o
FEATURES { FEATURES {
STARTADDRESS: default = $0200; STARTADDRESS: default = $0200;
CONDES: segment = STARTUP, CONDES: segment = STARTUP,
type = constructor, type = constructor,
label = __CONSTRUCTOR_TABLE__, label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__; count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP, CONDES: segment = STARTUP,
type = destructor, type = destructor,
label = __DESTRUCTOR_TABLE__, label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__; count = __DESTRUCTOR_COUNT__;
} }
SYMBOLS { SYMBOLS {
__STACKSIZE__: type = weak, value = $0200; # 512 byte program stack __STACKSIZE__: type = weak, value = $0200; # 512 byte program stack
__STARTADDRESS__: type = export, value = %S; __STARTADDRESS__: type = export, value = %S;
} }
MEMORY { MEMORY {
ZP: start = $0000, size = $00F7, define = yes, file = %O; ZP: file = %O, define = yes, start = $0000, size = $00F7;
CPUSTACK: start = $0100, size = $0100, define = yes; CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: start = %S, size = $8000 - %S - __STACKSIZE__, define = yes, file = %O; RAM: file = %O, define = yes, start = %S, size = $8000 - %S - __STACKSIZE__;
MONROM: start = $8000, size = $1000, define = yes; MONROM: file = "", define = yes, start = $8000, size = $1000;
EXT: start = $9000, size = $1000, define = yes; EXT: file = "", define = yes, start = $9000, size = $1000;
IO: start = $A000, size = $1000, define = yes; IO: file = "", define = yes, start = $A000, size = $1000;
RAE1: start = $B000, size = $1000, define = yes; RAE1: file = "", define = yes, start = $B000, size = $1000;
BASROM: start = $C000, size = $1000, define = yes; BASROM: file = "", define = yes, start = $C000, size = $1000;
RAE2: start = $E000, size = $1000, define = yes; RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: start = $F000, size = $1000, define = yes; TOP: file = "", define = yes, start = $F000, size = $1000;
} }
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes; ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes; STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes; CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes; RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes; ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes; DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes; BSS: load = RAM, type = bss, define = yes;
} }

View File

@@ -5,42 +5,42 @@
# ld65 --config sym1-4k.cfg -o <prog>.bin <prog>.o # ld65 --config sym1-4k.cfg -o <prog>.bin <prog>.o
FEATURES { FEATURES {
STARTADDRESS: default = $0200; STARTADDRESS: default = $0200;
CONDES: segment = STARTUP, CONDES: segment = STARTUP,
type = constructor, type = constructor,
label = __CONSTRUCTOR_TABLE__, label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__; count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP, CONDES: segment = STARTUP,
type = destructor, type = destructor,
label = __DESTRUCTOR_TABLE__, label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__; count = __DESTRUCTOR_COUNT__;
} }
SYMBOLS { SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack __STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S; __STARTADDRESS__: type = export, value = %S;
} }
MEMORY { MEMORY {
ZP: start = $0000, size = $00F7, define = yes, file = %O; ZP: file = %O, define = yes, start = $0000, size = $00F7;
CPUSTACK: start = $0100, size = $0100, define = yes; CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: start = %S, size = $1000 - %S - __STACKSIZE__, define = yes, file = %O; RAM: file = %O, define = yes, start = %S, size = $1000 - %S - __STACKSIZE__;
MONROM: start = $8000, size = $1000, define = yes; MONROM: file = "", define = yes, start = $8000, size = $1000;
EXT: start = $9000, size = $1000, define = yes; EXT: file = "", define = yes, start = $9000, size = $1000;
IO: start = $A000, size = $1000, define = yes; IO: file = "", define = yes, start = $A000, size = $1000;
RAE1: start = $B000, size = $1000, define = yes; RAE1: file = "", define = yes, start = $B000, size = $1000;
BASROM: start = $C000, size = $1000, define = yes; BASROM: file = "", define = yes, start = $C000, size = $1000;
RAE2: start = $E000, size = $1000, define = yes; RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: start = $F000, size = $1000, define = yes; TOP: file = "", define = yes, start = $F000, size = $1000;
} }
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes; ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes; STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes; CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes; RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes; ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes; DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes; BSS: load = RAM, type = bss, define = yes;
} }

View File

@@ -5,42 +5,42 @@
# ld65 --config sym1-4k.cfg -o <prog>.bin <prog>.o # ld65 --config sym1-4k.cfg -o <prog>.bin <prog>.o
FEATURES { FEATURES {
STARTADDRESS: default = $0200; STARTADDRESS: default = $0200;
CONDES: segment = STARTUP, CONDES: segment = STARTUP,
type = constructor, type = constructor,
label = __CONSTRUCTOR_TABLE__, label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__; count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP, CONDES: segment = STARTUP,
type = destructor, type = destructor,
label = __DESTRUCTOR_TABLE__, label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__; count = __DESTRUCTOR_COUNT__;
} }
SYMBOLS { SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack __STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S; __STARTADDRESS__: type = export, value = %S;
} }
MEMORY { MEMORY {
ZP: start = $0000, size = $00F7, define = yes, file = %O; ZP: file = %O, define = yes, start = $0000, size = $00F7;
CPUSTACK: start = $0100, size = $0100, define = yes; CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: start = %S, size = $1000 - %S - __STACKSIZE__, define = yes, file = %O; RAM: file = %O, define = yes, start = %S, size = $1000 - %S - __STACKSIZE__;
MONROM: start = $8000, size = $1000, define = yes; MONROM: file = "", define = yes, start = $8000, size = $1000;
EXT: start = $9000, size = $1000, define = yes; EXT: file = "", define = yes, start = $9000, size = $1000;
IO: start = $A000, size = $1000, define = yes; IO: file = "", define = yes, start = $A000, size = $1000;
RAE1: start = $B000, size = $1000, define = yes; RAE1: file = "", define = yes, start = $B000, size = $1000;
BASROM: start = $C000, size = $1000, define = yes; BASROM: file = "", define = yes, start = $C000, size = $1000;
RAE2: start = $E000, size = $1000, define = yes; RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: start = $F000, size = $1000, define = yes; TOP: file = "", define = yes, start = $F000, size = $1000;
} }
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes; ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes; STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes; CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes; RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes; ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes; DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes; BSS: load = RAM, type = bss, define = yes;
} }

View File

@@ -4786,6 +4786,7 @@ compiler, depending on the target system selected:
<item><tt/__SIM6502__/ - Target system is <tt/sim6502/ <item><tt/__SIM6502__/ - Target system is <tt/sim6502/
<item><tt/__SIM65C02__/ - Target system is <tt/sim65c02/ <item><tt/__SIM65C02__/ - Target system is <tt/sim65c02/
<item><tt/__SUPERVISION__/ - Target system is <tt/supervision/ <item><tt/__SUPERVISION__/ - Target system is <tt/supervision/
<item><tt/__SYM1__/ - Target system is <tt/sym1/
<item><tt/__VIC20__/ - Target system is <tt/vic20/ <item><tt/__VIC20__/ - Target system is <tt/vic20/
</itemize> </itemize>

View File

@@ -1022,6 +1022,10 @@ The compiler defines several macros at startup:
This macro is defined if the target is the Supervision (-t supervision). This macro is defined if the target is the Supervision (-t supervision).
<tag><tt>__SYM1__</tt></tag>
This macro is defined if the target is the Sym-1 (-t sym1).
<tag><tt>__TELESTRAT__</tt></tag> <tag><tt>__TELESTRAT__</tt></tag>
This macro is defined if the target is the Telestrat (-t telestrat). This macro is defined if the target is the Telestrat (-t telestrat).

5
libsrc/sym1/ctype.s Normal file
View File

@@ -0,0 +1,5 @@
; Character specification table.
;
; uses the "common" definition
.include "ctype_common.inc"

View File

@@ -335,6 +335,7 @@ static void SetSys (const char* Sys)
break; break;
case TGT_SYM1: case TGT_SYM1:
NewSymbol ("__SYM1__", 1);
break; break;
default: default:

View File

@@ -291,6 +291,7 @@ static void SetSys (const char* Sys)
break; break;
case TGT_SYM1: case TGT_SYM1:
DefineNumericMacro ("__SYM1__", 1);
break; break;
default: default: