Non-constant literal initialization is not supported
Open
compiler
documentation
- Dominant language
- Scala
- Stars
- 279
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
The compiler allows you to initialize a global variable with a literal: `const byte test = 1`, but doesn't actually generate any code to initialize those variables on program start.
```
word input = 1000
byte output
void main() {
func(input)
if (output == 0) {
asm {
kil
}
}
while (true) {}
}
void func(word func_input) {
output = func_input.hi
}
void nmi() {
}
void irq() {
}
```
Built with `java -jar millfork.jar main.mfk -o build/rom.nes -t nes_small -g -s -fsource-in-asm -fillegals`
Contributor guide
Assessment
This issue has not been assessed yet.