From 2ceb70dfff1f0c395986e102b199fdb356db57cf Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 18 Jul 2020 13:15:35 +0200 Subject: [PATCH] fixes #330 Move EEPROMBASE from forth.asm to target.inc --- C0135/target.inc | 9 +++++---- CORE/target.inc | 9 +++++---- DCDC/target.inc | 11 ++++++----- DOUBLECOM/target.inc | 9 +++++---- MINDEV/target.inc | 9 +++++---- STM8L-DISCOVERY/target.inc | 7 ++++--- STM8L051F3/target.inc | 9 +++++---- STM8S001J3/target.inc | 9 +++++---- STM8S105K4/target.inc | 9 +++++---- STM8S207RB/target.inc | 9 +++++---- SWIMCOM/target.inc | 9 +++++---- W1209-CA-V2/target.inc | 11 ++++++----- W1209-CA/target.inc | 11 ++++++----- W1209-FD/target.inc | 11 ++++++----- W1209/target.inc | 11 ++++++----- W1219/target.inc | 11 ++++++----- W1401/target.inc | 11 ++++++----- XH-M188/target.inc | 9 +++++---- XH-M194/target.inc | 10 +++++----- XY-LPWM/target.inc | 12 ++++++------ XY-PWM/target.inc | 11 ++++++----- forth.asm | 1 - main.c | 9 ++++++++- test/target.inc | 9 +++++---- 24 files changed, 126 insertions(+), 100 deletions(-) diff --git a/C0135/target.inc b/C0135/target.inc index 837ec42..b52853e 100644 --- a/C0135/target.inc +++ b/C0135/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/CORE/target.inc b/CORE/target.inc index 837ec42..b52853e 100644 --- a/CORE/target.inc +++ b/CORE/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/DCDC/target.inc b/DCDC/target.inc index 55830fd..943259f 100644 --- a/DCDC/target.inc +++ b/DCDC/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/DOUBLECOM/target.inc b/DOUBLECOM/target.inc index 837ec42..b52853e 100644 --- a/DOUBLECOM/target.inc +++ b/DOUBLECOM/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/MINDEV/target.inc b/MINDEV/target.inc index 837ec42..b52853e 100644 --- a/MINDEV/target.inc +++ b/MINDEV/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/STM8L-DISCOVERY/target.inc b/STM8L-DISCOVERY/target.inc index 3aeba01..bb2bba6 100644 --- a/STM8L-DISCOVERY/target.inc +++ b/STM8L-DISCOVERY/target.inc @@ -2,11 +2,12 @@ TARGET = STM8L152C6 - RAMEND = 0x07FF ; system (return) stack, growing down - EEPROMEND = 0x43FF ; STM8L051F3: 1024 bytes EEPROM + RAMEND = 0x07FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x1000 ; "EESTART" EEPROM start address + EEPROMEND = 0x13FF ; "EEEND" 1024 bytes EEPROM FLASHEND = 0xFFFF ; 32K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 2K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 2K RAM SPPLOC = 0x0750 ; SPP (data stack top), TIB start diff --git a/STM8L051F3/target.inc b/STM8L051F3/target.inc index 63fcbc8..4b681fa 100644 --- a/STM8L051F3/target.inc +++ b/STM8L051F3/target.inc @@ -2,11 +2,12 @@ TARGET = STM8L051F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x41FF ; STM8L051F3: 256 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x1000 ; "EESTART" EEPROM start address + EEPROMEND = 0x10FF ; "EEEND" 256 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/STM8S001J3/target.inc b/STM8S001J3/target.inc index 837ec42..b52853e 100644 --- a/STM8S001J3/target.inc +++ b/STM8S001J3/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/STM8S105K4/target.inc b/STM8S105K4/target.inc index b10767f..9cbde11 100644 --- a/STM8S105K4/target.inc +++ b/STM8S105K4/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S105K4 - RAMEND = 0x07FF ; system (return) stack, growing down - EEPROMEND = 0x43FF ; STM8S105K4: 1024 bytes EEPROM - FLASHEND = 0xBFFF ; 16 KiB devices + RAMEND = 0x07FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x43FF ; "EEEND" 640 bytes EEPROM + FLASHEND = 0xFFFF ; "FLASHEND" 32K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 2KiB RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 2KiB RAM SPPLOC = 0x0750 ; SPP (data stack top), TIB start diff --git a/STM8S207RB/target.inc b/STM8S207RB/target.inc index 2e197e2..3979124 100644 --- a/STM8S207RB/target.inc +++ b/STM8S207RB/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S207RB - RAMEND = 0x17FF ; system (return) stack, growing down - EEPROMEND = 0x47FF ; STM8S207RB: 2048 bytes EEPROM - FLASHEND = 0xFFFF ; 32 KiB devices (+96 KiB > 0xFFFF ) + RAMEND = 0x17FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x47FF ; "EEEND" 640 bytes EEPROM + FLASHEND = 0xFFFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 6KiB RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 6KiB RAM SPPLOC = 0x1680 ; SPP (data stack top), TIB start diff --git a/SWIMCOM/target.inc b/SWIMCOM/target.inc index 837ec42..b52853e 100644 --- a/SWIMCOM/target.inc +++ b/SWIMCOM/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/W1209-CA-V2/target.inc b/W1209-CA-V2/target.inc index 55830fd..943259f 100644 --- a/W1209-CA-V2/target.inc +++ b/W1209-CA-V2/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/W1209-CA/target.inc b/W1209-CA/target.inc index 55830fd..f082179 100644 --- a/W1209-CA/target.inc +++ b/W1209-CA/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 ; Complatible with STM8S003F3 - specs differ - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/W1209-FD/target.inc b/W1209-FD/target.inc index 55830fd..f082179 100644 --- a/W1209-FD/target.inc +++ b/W1209-FD/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 ; Complatible with STM8S003F3 - specs differ - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/W1209/target.inc b/W1209/target.inc index 55830fd..943259f 100644 --- a/W1209/target.inc +++ b/W1209/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/W1219/target.inc b/W1219/target.inc index 55830fd..f082179 100644 --- a/W1219/target.inc +++ b/W1219/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 ; Complatible with STM8S003F3 - specs differ - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/W1401/target.inc b/W1401/target.inc index 55830fd..f082179 100644 --- a/W1401/target.inc +++ b/W1401/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 ; Complatible with STM8S003F3 - specs differ - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/XH-M188/target.inc b/XH-M188/target.inc index 837ec42..b52853e 100644 --- a/XH-M188/target.inc +++ b/XH-M188/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/XH-M194/target.inc b/XH-M194/target.inc index b10767f..4b2124a 100644 --- a/XH-M194/target.inc +++ b/XH-M194/target.inc @@ -2,13 +2,13 @@ TARGET = STM8S105K4 - RAMEND = 0x07FF ; system (return) stack, growing down - EEPROMEND = 0x43FF ; STM8S105K4: 1024 bytes EEPROM - FLASHEND = 0xBFFF ; 16 KiB devices + RAMEND = 0x07FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x43FF ; "EEEND" 640 bytes EEPROM + FLASHEND = 0xFFFF ; "FLASHEND" 32K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 2KiB RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 2KiB RAM SPPLOC = 0x0750 ; SPP (data stack top), TIB start RPPLOC = RAMEND ; RPP (return stack top) - diff --git a/XY-LPWM/target.inc b/XY-LPWM/target.inc index 28700f2..f082179 100644 --- a/XY-LPWM/target.inc +++ b/XY-LPWM/target.inc @@ -1,13 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 ; Complatible with STM8S003F3 - specs differ - RAMEND = 0x03FF ; system (return) stack, growing down - ; EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/XY-PWM/target.inc b/XY-PWM/target.inc index 55830fd..f082179 100644 --- a/XY-PWM/target.inc +++ b/XY-PWM/target.inc @@ -1,12 +1,13 @@ ; STM8S003F3 device and memory layout configuration - TARGET = STM8S003F3 + TARGET = STM8S103F3 ; Complatible with STM8S003F3 - specs differ - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x407F ; STM8S003F3: 128 bytes EEPROM (maybe more, YMMV) - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start diff --git a/forth.asm b/forth.asm index 9b73d85..d39dcad 100644 --- a/forth.asm +++ b/forth.asm @@ -130,7 +130,6 @@ ;****** STM8 memory addresses ****** RAMBASE = 0x0000 ; STM8 RAM start - EEPROMBASE = 0x4000 ; STM8 EEPROM start ; STM8 device specific include (provided by file in board folder) ; sets "TARGET" and memory layout diff --git a/main.c b/main.c index b7be608..577f0cc 100644 --- a/main.c +++ b/main.c @@ -13,7 +13,14 @@ // Density or High Density devices, assign memory by matching // forthData[] start and size with the range in target.inc -volatile __at(0x30) uint8_t forthData[0x03FF-0x30]; +#define FORTHRAM 0x30 +#define UPPEND 0x7f +#define CTOPLOC 0x80 +#define RAMEND 0x03FF + +// Reserve RAM for Forth (not available for C) +volatile __at(FORTHRAM) uint8_t forthUser[1+UPPEND-FORTHRAM]; +volatile __at(CTOPLOC) uint8_t forthData[1+RAMEND-CTOPLOC]; // declare trap handler void TRAP_Handler() __trap; diff --git a/test/target.inc b/test/target.inc index 837ec42..b52853e 100644 --- a/test/target.inc +++ b/test/target.inc @@ -2,11 +2,12 @@ TARGET = STM8S103F3 - RAMEND = 0x03FF ; system (return) stack, growing down - EEPROMEND = 0x427F ; STM8S103F3: 640 bytes EEPROM - FLASHEND = 0x9FFF ; 8K devices + RAMEND = 0x03FF ; "RAMEND" system (return) stack, growing down + EEPROMBASE = 0x4000 ; "EESTART" EEPROM start address + EEPROMEND = 0x427F ; "EEEND" 640 bytes EEPROM + FLASHEND = 0x9FFF ; "FLASHEND" 8K devices - FORTHRAM = 0x0040 ; Start of RAM controlled by Forth + FORTHRAM = 0x0030 ; Start of RAM controlled by Forth UPPLOC = 0x0060 ; UPP (user/system area) location for 1K RAM CTOPLOC = 0x0080 ; CTOP (user dictionary) location for 1K RAM SPPLOC = 0x0350 ; SPP (data stack top), TIB start