[try Beta version]
Not logged in

 
Compiler: Back-end

Sep 2, 2012 at 8:41am
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 Sep 2, 2012 at 8:41am
Sep 2, 2012 at 9:02am
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.
Sep 2, 2012 at 9:03am
I know I can do that, but I would like to do it myself (for learning purposes)
Sep 2, 2012 at 9:27am
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.
Sep 2, 2012 at 11:42am
which assembler should I use: FASM or NASM
Sep 2, 2012 at 12:09pm
closed account (1yR4jE8b)
You should use GAS.
Sep 2, 2012 at 12:16pm
You may want to investigate writing a frontend on top of llvm

http://llvm.org/docs/tutorial/
Sep 2, 2012 at 5:43pm
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.