Compiler: Back-end

I have often thought of making my own language, but have always come to the road block that is the back-end. I have translated my code into assembly, now how do I translate it into machine code, and also how would I make an executable, please post links to tutorials or books (preferably free ones). Thanks in advance.
Last edited on
if you want to make compiler for your own language and you have already translated it to assembly code then link your compiler with assembler like masm which translate assembly code to executable code. Search google about assembler and how to link with it.
I know I can do that, but I would like to do it myself (for learning purposes)
Oh! then sorry I have no any suggestion about this. But if you want to write assembler your self then you have to study the machine code of your machine and it is a painful really.
which assembler should I use: FASM or NASM
closed account (1yR4jE8b)
You should use GAS.
You may want to investigate writing a frontend on top of llvm

http://llvm.org/docs/tutorial/
closed account (zb0S216C)
You need to take the Assembly instructions, and encode them so that the CPU can understand them. See this for a rough idea: http://www.eecg.toronto.edu/~moshovos/ECE243-2009/l19-instruction-representation-stored-program.html

Wazzak
Topic archived. No new replies allowed.