I wanted to get a basic interpreter running on an WeMos D1 ESP8266-based board, and when I saw https://github.com/BleuLlama/TinyBasicPlus/issues/35 was encouraged. However, when running TinyBasicPlus I encountered this error:
and others like it. An Exception 9 is apparently a "LoadStoreAlignmentCause: Load or store to an unaligned address" error. This error was being caused by dereferencing the short int binary-format program line numbers (the 10 part of 10 PRINT A). After a bit of Googling I found https://readmodifywrite.github.io/blog/html/2016/12/15/2016_12_15_memory_alignment_esp8266.html which suggested the error was because the memory address was unaligned, which in this case translated to an odd numbered address. To prevent crashes and let TinyBasicPlus run on this particular ESP8266 chip, I've created a patch that when #define ALIGN_MEMORY 1 is selected, ensures that all line numbers are written to even addresses (are aligned).
I wanted to get a basic interpreter running on an WeMos D1 ESP8266-based board, and when I saw https://github.com/BleuLlama/TinyBasicPlus/issues/35 was encouraged. However, when running TinyBasicPlus I encountered this error:
and others like it. An Exception 9 is apparently a "LoadStoreAlignmentCause: Load or store to an unaligned address" error. This error was being caused by dereferencing the
short int
binary-format program line numbers (the10
part of10 PRINT A
). After a bit of Googling I found https://readmodifywrite.github.io/blog/html/2016/12/15/2016_12_15_memory_alignment_esp8266.html which suggested the error was because the memory address was unaligned, which in this case translated to an odd numbered address. To prevent crashes and let TinyBasicPlus run on this particular ESP8266 chip, I've created a patch that when#define ALIGN_MEMORY 1
is selected, ensures that all line numbers are written to even addresses (are aligned).