diff --git a/README.md b/README.md index a5bc4db..82389ad 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,9 @@ A variation of asm.py to emulate a MiMa (minimal machine). No, the compiler can ### asmCust.py Does not work (I think...) +--- + +I wrote this before learning about compilers or such, accidentally invented some things I learned about later. Making stuff up as I went along led to very bad code, no sensible abstractions. Basis were mostly Minecraft redstone-computer tutorials. + +I even made the same mistake with the current compiler implementation as early versions of Pascal: +We don't support self recursion (neither direct nor indirect) as we store return addresses for function calls in memory slots specific to functions. Any self recursion thus overrides the return pointer of an outer invocation with the address for the inner invocation. Returning from the outer function call thus steps down again leading to an infinite loop. The beta compiler (if actually functional) solves this the way the Pascal devs did back then: Using a stack for return pointers. The concept of local vars / scoping via stack is still missing thought. \ No newline at end of file