Tag: Programming
-
Working Through WACC – chapter 17 void, malloc etc
WACC is this excellent book and I am blogging my way through it. This chapter tackles dynamic memory. Once again I was surprised by the complexity. For c dynamic memory just means calling a few functions and working with the returned pointers … well we already have function calls and pointers, so hard can that…
-
How a 2mhz , 1mb RAM system ran a whole company in the 70s.
I started my sw career on mainframes in the 70s. The pictures I have included are snapshots of that era, by pure coincidence they seem to be the same system. Note the excellently fashionable clothing worn by the operators. I can confirm this was the required uniform at the time. The machines I worked on…
-
Working Through WACC – chapter 18 structs
WACC is this excellent book Oh my goodness! I expected this to be a tricky chapter but not this hard. Initializers I knew when I wrote the initializer code for arrays that it wouldn’t work for structs, so a complete rewrite for this chapter. Why, well because an array, even a multi dimensional one is…
-
Working Through WACC – chapter 15, arrays and pointer arithmetic
WACC is this excellent book and I am blogging my way though it This was by far the hardest chapter so far. This was a surprise to me since I thought I understood arrays and pointer arithmetic, and I always start each chapter out with “do I know the part of C that we are…
-
Working Through WACC – Chapter 14 , pointers
WACC is this great book: I am blogging my way through it, chapter by chapter. Major Refactoring Well first off we need to rewrite the parsing of declarations because it just got a lot more complex. I wasnt happy with my previous ‘making it up as you go along’ version – so I am happy…
-
Working Through WACC – Chapter 13 Floats
Lexer I cheated. My lexer does not use regexes, it does a character-by-character analysis. The parsing of floating point literals looked way too complicated so I used fast_float – Rust. This has a nice feature, you can ask it to parse as far as it can converting to floating point, if it finds a valid…
-
Working Through WACC – Chapter 11 , Long Integers
Now working through Part II of the excellent ‘Writing a c Compiler’ chapter 11 is called ‘Long Integers’. I was discussing this with my son-in-law who works in tech, he laughed saying that that was surely not a big change, I though so too. Boy were we wrong. Its interesting to note that at the…
-
Working Through WACC – Pause after part 1
I am blogging my way through this book:- I have reached the end of Part I and this blog post is a summary of thoughts about the progress. Summary This is a great book. Although I have diverged from some of the design details (more later) I have mainly stuck to its plan. The test…
-
Working Through WACC – Chapter 10
WACC is this book and I am blogging my way through it. This is the last chapter in part 1. A quick skim shows its not too hard. Adding The last point means I need to identify the syntax for this in NASM, the book uses gas syntax, and my normal cheat of looking what…
-
Working through ‘WACC’ – Chapter 9 – Functions
WACC means this book And this is my journey through it. Parsing This is a complicated chapter, and I haven’t even got to the code generation part yet Anyway that is now working. On to Code Generation This is where I expected the first major problem of Windows vs Linux / Mac to be. Linux…