View Single Post
Old 21 January 2017, 01:16   #46
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by esc View Post
I've been writing code in C for a long time. However, I'm completely unfamiliar with the assembly it compiles into. Can someone recommend a good online class or reading material to help me learn this? A friend mentioned taking a class at some point whereby they actually wrote a C compiler in assembly, but he did it at his university and as such it isn't available to me. I'd be curious to do something like that. Thanks!
Many of the "free" compiler design texts are rather old but can be fine for learning the basics. The Basics of Compiler Design is fairly modern and in depth.

Basics of Compiler Design
http://www.diku.dk/hjemmesider/ansat...sics_lulu2.pdf

It is always good to look at and play with some code too. The vbcc compiler source is fairly modern, advanced, has few dependencies (it compiles on my Amiga) and is written in C. The vbcc source, documentation and binaries are at the following link.

http://sun.hasenbraten.de/vbcc/

The GCC C source is available but a complex mess and full of dependencies. Clang/LLVM is written in C++ and has no official or finished 68k backend. The Amiga DICE source is in C and available but it is old and rather basic.

It is probably necessary to learn some basic assembly language and study the compiler output to fully understand the process. Various debuggers and disassemblers are available to disassemble compiled programs (ask if needed). The M68000PRM is the basic guide for the 68k ISA (now with spiffy NXP text).

http://www.nxp.com/assets/documents/.../M68000PRM.pdf

Last edited by matthey; 21 January 2017 at 01:26.
matthey is offline  
 
Page generated in 0.04346 seconds with 11 queries