Tag: Programming
-
Working through WACC – Chapter 8, Loops
All part of the series about this book: Time to add while, do {} while, for, break and continue. And just because all text is boring here’s a picture: This is where I started to doubt my single phase parse direct to TACKY. Particularly in the extra credit. For Loops A for loop like this:…
-
Working Through WACC – Chapter 7, Compound statements
Because we haven’t had it for a while here’s the front cover. If you are not sure what this post is about check out episode 1 https://jollygoodsw.wordpress.com/2025/03/13/working-through-writing-a-c-compiler/ This is a short chapter, the only real change is that the variable name / scope resolution gets fancier. This is beacuse we can now have Ie we…
-
Working through ‘WACC’ – chapter 4 Logical and relational operators
Because I like the cover here it is again The big step here is that we add jumps, conditional and unconditional, because && and || can cause us to skip executing some code . Ignoring Nora is a bad idea This is where we start generating labels for jumps. The book says generate meaningful label…
-
Working through ‘Writing A C Compiler’ – Introduction
The introduction covers a lot of important stuff about implementing the compiler. Platforms The book is setup to work on Linux and Mac. I am a primarily Windows dev (ex MSFT employee), I do a fair amount of contributions to rust projects and so do stuff on all three platforms, but Windows is where I…
-
Working through ‘Writing A C Compiler’
Some time ago I decided I wanted to create a c compiler for the Hack processor in the nand2tetris book. After several dead end attempts that I might describe later I found this book : Writing a C Compiler | No Starch Press I decided to work my way through it. I plan to do…
-

FPGA journey part 2
In the previous post I talked about my experience with ICE40 based FPGA boards. In the end I abandoned them because they did not have enough block RAM (I need 128kb). After looking at the Alcrity Au Alchitry Au FPGA Development Board (Xilinx Artix 7) – DEV-16527 – SparkFun Electronics and Au+ I decided on…
-
Disappearing down the ‘Nand to Tetris’ rabbit hole
A few months ago I read an article on Medium that recommended a few books, amongst them was ‘The elements of computing systems’, better known by its nickname ‘From Nand to Tetris’. This book describes how computers work from basic logic gates all the way up to compilers and walks you through building these systems.…
-
Interfacing C With Rust To Build a Debugger
Photo by Markus Spiske on Unsplash Introduction I decided to write a debugger for the sim65 6502 emulator that’s part of the cc65 tool suite (cc65 — a freeware C compiler for 6502 based systems). The cc65 toolset is written in c, but I was not going to even attempt to code a debugger in pure c (I…
-
Common Stack Overflow Errors #3 C error handling
Or rather the complete lack of it. New c programmers coming from Python, Java, C#, JavaScript etc. expect to be told when something goes wrong. Exceptions get thrown, runtime engines complain, … For example f = open(“demofile.txt”, “r”)print(f.read()) On my machine (the file doesnt exist) pm100@paul-think:~$ python3 so.pyTraceback (most recent call last): File “so.py”, line 1,…