5.3 Abstract Locations
In the last chapter, we designed our first language, Paren-x64 v1, and wrote our first compiler to implement it. This language introduces the barest, although still very useful, abstraction—freedom from boilerplate. Paren-x64 v1 abstracts away from the boilerplate of x64, and details of exactly how to pass a value to the operating system. While Paren-x64 v1 is an improvement of x64, it has a significant limitation for writing programs that we address in this chapter. The language requires the programmer to manually manage a small number of variables, namely the registers, while programming. Human memory is much less reliable than computer memory, so we should design languages that make the computer remember more and free the human to remember less. This will prevent the human from causing run-time errors when they inevitably make a mistake and overwrite a register that was still in use. To address this, we will introduce abstract locations, of which there are an arbitrary number and th
5.3 Abstract Locations ► CPSC 411 2022w2 - Introduction to Compiler Construction 1 Syllabus 2 COVID Syllabus Addendum 3 Course Calendar 4 Course Project Logistics 5 Book 6 Project Milestones 7 CPSC 411 Infrastructure Package 8 Credits ▼ 5 Book 5.1 A Compiler Begins with a Language 5.2 Abstracting Boilerplate ( v1 ) 5.3 Abstract Locations 5.4 Value Orientation 5.5 Register Allocation 5.6 Structured Control Flow 5.7 Procedural Abstraction: Call 5.8 Procedural Abstraction: Return 5.9 Algebraic Expressions 5.10 Data types: Immediates 5.11 Data types: Structured Data and Heap Allocation
related reading
- how I think when I think about programming - alice mazalicemaz.com
- 5.5 Register Allocationstudents.cs.ubc.ca
- Rambles around computer sciencehumprog.org
- Write your Own Virtual Machinejmeiners.com
- CSAPP_2016.pdfcs.sfu.ca
- Learnable Programmingworrydream.com
- A fundamental introduction to x86 assembly programmingnayuki.io
- Abstraction (computer science) - Wikipediaen.wikipedia.org
- Building a Performant Compiler from Scratch — Bowen Chengbowencheng.dev
- High-level programming language - Wikipediaen.wikipedia.org
- Guide to x86 Assemblyflint.cs.yale.edu
- Writing a C compiler in 500 lines of Pythonvgel.me