Merge compiler and emulator progress from last few months into main. #11

Merged
zxq5 merged 55 commits from compiler into main 2026-02-14 11:54:15 +00:00
Owner

this is very WIP.

this is very WIP.
zxq5 added 50 commits 2026-02-14 02:47:33 +00:00
function to print.dsa for decimal numbers
simple conditionals
- basic pointers and reading values from pointers works
- writing to pointers not yet implemented (looks painful so a problem
  for tomorrow)
- updated print library. the compiler has this hardcoded in all programs
  for now
- updated lexer to allow hex and binary integer literals
- updated parser with support for writing to pointers
- updated code generation to support writing to pointers
- fixed a bug with codegen where args are loaded from incorrect offsets
  due to saving registers prior to calling.
provided an API for the editor to use.
TODO: improve logging
frontend/backend distinction or use of standard model)
- If statements work properly now (hopefully)
- still issues with while loops pushing vars to the stack. need scoping
  implemented to fix this!

- refactored registers.rs and fixed faulty logic.
- made register allocation optimisations
(only the unary operators from this are implemented for now)
- updated emulator to support new shift implementation
- updated emulator to rename NoReg to Null as in the common lib
5`
- implementation of logical and shift operations in parser and codegen.
- implementation of sizeof keyword as unary operator

in progress (non functional)
- implementation of prefix and postfix inc/dec operators

- array access by index (implemented, untested as arrays aren't
  implemented yet). essentially just a pointer write with offset.
- struct/member access (parsing implemented, untested.)
- implemented type parsing including custom types and generics (useless
  for now as we do no semantic analysis)
- implemented struct literal parsing
- implemented struct definition parsing (no generics yet)
- implemented tuple parsing
- registers are now allocated starting from zero
- updated to-dos
DSC that we can follow as a reference for implementation.
proving to be a challenge
zxq5 added 1 commit 2026-02-14 11:05:18 +00:00
- updated comments in compiler codegen
- deleted old dsa compiler outputs
- settings for zed
zxq5 added 1 commit 2026-02-14 11:09:39 +00:00
zxq5 added this to the Damn Simple Architecture project 2026-02-14 11:10:32 +00:00
zxq5 moved this to Debugging in Damn Simple Architecture on 2026-02-14 11:11:40 +00:00
zxq5 added 3 commits 2026-02-14 11:51:01 +00:00
TODO: add comprehensive testing to everything
zxq5 marked the pull request as ready for review 2026-02-14 11:52:54 +00:00
zxq5 merged commit 7b18922cc7 into main 2026-02-14 11:54:15 +00:00
zxq5 deleted branch compiler 2026-02-14 11:54:15 +00:00
Sign in to join this conversation.