Chapter 13: Native Code Generation
This chapter shows how to take the intermediate code from Chapter 9, Intermediate Code Generation, and generate native code. The term native refers to whatever instruction set is provided in hardware on a given machine. This chapter presents a simple native code generator for x64, the dominant architecture on laptops and desktops.
This chapter covers the following main topics:
- Deciding whether to generate native code
- Introducing the x64 instruction set
- Using registers
- Converting intermediate code to x64 code
- Generating x64 output
The skills developed here include basic register allocation, instruction selection, writing assembler files, and invoking the assembler and linker to produce a native executable. ...
Get Build Your Own Programming Language now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.