Hey guys, I am making a simple c++ compiler with Visual Studio 2010, but I am stuck on the converting it to assembly bit(with c++ coding).

What I am trying to do is convert the code they type(in a cpp file) to assembly, then translate it to machine code etc.

I really need some help, I know how to get the tokens, but not how to convert it to assembly. Also while your at it, can you tell

me the libraries needed to make the exe.

PS. I have good experience with c++.

Thanks in return.

There are open-source compiler projects on codeplex and sourceforge and sites like that.

How good are you at assembly?
If your intermediate step is going to be ASM, is it good enough for you to then compile the ASM with something like a86 a86?
...or are you building the assembly compiler also?

Hey guys, I am making a simple c++ compiler with Visual Studio 2010, but I am stuck on the converting it to assembly bit(with c++ coding).

The compiler will generate an assembly code listing for you. All you have to do is go to Projects --> Properties (at the bottom of the list) --> Configuration Properties --> c++ --> Output Files then change one of the options to whatever kind of listing you want.

I wanna use code because I an making a compiler from scratch

----Edit----
Anyone who wants to use assembly on Microsoft VC++ look at this

Edited 4 Years Ago by Huston: Error

Oh... I get it now, I am supposed to parse then, look at the functions and actually convert it myself,
anyway, anyone know the library files needed to link?

so... Like I am supposed use user32.lib etc. can you tell me for win32?

This article has been dead for over six months. Start a new discussion instead.