static void Software_Trim();
#define MCLK_FREQ_MHZ (8) // MCLK = 8MHz
-#define ALEE_RODICTSIZE (7000)
+#define ALEE_RODICTSIZE (9200)
__attribute__((section(".lodict")))
#include "core.fth.h"
static bool exitLpm;
static Addr isr_list[24] = {};
-static SplitMemDictRW<ALEE_RODICTSIZE, 32767> dict (alee_dat, 0x10000);
+
+using DictType = SplitMemDictRW<ALEE_RODICTSIZE, 32767>;
+
+alignas(DictType)
+static unsigned char dictbuf[sizeof(DictType)];
+static auto dict = reinterpret_cast<DictType *>(dictbuf);
int main()
{
SYSCFG0 = FRWPPW;
(void)alee_dat_len;
- State state (dict, readchar);
+ dict->lodict = alee_dat;
+ dict->hidict = 0x10000;
+ State state (*dict, readchar);
Parser::customParse = findword;
serputs("alee forth\n\r");
const Addr isr = isr_list[index];
if (isr != 0) {
- State isrstate (dict, readchar);
+ State isrstate (*dict, readchar);
exitLpm = false;
isrstate.execute(isr);
return exitLpm;
.rodata :\r
{\r
. = ALIGN(2);\r
- *(.plt)\r
*(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)\r
*(.rodata1)\r
- KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)\r
} > FRAM\r
\r
/* Note: This is a separate .rodata section for sections which are\r
KEEP (*(SORT(.fini_array.*)))\r
PROVIDE (__fini_array_end = .);\r
. = ALIGN(2);\r
- *(.eh_frame_hdr)\r
- KEEP (*(.eh_frame))\r
\r
/* gcc uses crtbegin.o to find the start of the constructors, so\r
we make sure it is first. Because this is a wildcard, it\r
KEEP (*(.dtors))\r
} > FRAM\r
\r
- /* This section contains data that is initialised during load\r
- but not on application reset. */\r
- .persistent :\r
- {\r
- . = ALIGN(2);\r
- PROVIDE (__persistent_start = .);\r
- *(.persistent)\r
- . = ALIGN(2);\r
- PROVIDE (__persistent_end = .);\r
- } > FRAM\r
-\r
.tinyram : {} > TINYRAM\r
\r
.data :\r
. = ALIGN(2);\r
PROVIDE (__datastart = .);\r
\r
- KEEP (*(.jcr))\r
- *(.data.rel.ro.local) *(.data.rel.ro*)\r
- *(.dynamic)\r
-\r
*(.data .data.* .gnu.linkonce.d.*)\r
KEEP (*(.gnu.linkonce.d.*personality*))\r
SORT(CONSTRUCTORS)\r
*(.data1)\r
- *(.got.plt) *(.got)\r
\r
/* We want the small data sections together, so single-instruction offsets\r
can access them all, and initialized data all before uninitialized, so\r
{\r
. = ALIGN(2);\r
PROVIDE (__bssstart = .);\r
- *(.dynbss)\r
*(.sbss .sbss.*)\r
*(.bss .bss.* .gnu.linkonce.b.*)\r
. = ALIGN(2);\r
PROVIDE (__noinit_end = .);\r
} > RAM\r
\r
- /* We create this section so that "end" will always be in the\r
- RAM region (matching .stack below), even if the .bss\r
- section is empty. */\r
- .heap (NOLOAD) :\r
- {\r
- . = ALIGN(2);\r
- __heap_start__ = .;\r
- _end = __heap_start__;\r
- PROVIDE (end = .);\r
- KEEP (*(.heap))\r
- _end = .;\r
- PROVIDE (end = .);\r
- /* This word is here so that the section is not empty, and thus\r
- not discarded by the linker. The actual value does not matter\r
- and is ignored. */\r
- LONG(0);\r
- __heap_end__ = .;\r
- __HeapLimit = __heap_end__;\r
- } > RAM\r
- /* WARNING: Do not place anything in RAM here.\r
- The heap section must be the last section in RAM and the stack\r
- section must be placed at the very end of the RAM region. */\r
-\r
.stack (ORIGIN (RAM) + LENGTH(RAM)) :\r
{\r
PROVIDE (__stack = .);\r
. = ALIGN(2);\r
KEEP (*(SORT(.crt_*)))\r
\r
- . = ALIGN(2);\r
- KEEP (*(.lowtext))\r
-\r
. = ALIGN(2);\r
*(.text .stub .text.* .gnu.linkonce.t.* .text:*)\r
\r
- KEEP (*(.text.*personality*))\r
- /* .gnu.warning sections are handled specially by elf32.em. */\r
- *(.gnu.warning)\r
- *(.interp .hash .dynsym .dynstr .gnu.version*)\r
- PROVIDE (__etext = .);\r
- PROVIDE (_etext = .);\r
- PROVIDE (etext = .);\r
. = ALIGN(2);\r
KEEP (*(.init))\r
KEEP (*(.fini))\r