C/C++ to ASM

Discussion in 'Programmer's Corner' started by ecjohnny, Jan 20, 2012.

  1. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005

    Is there any software or compiler that can convert simple C/C++ to 8086 assembly code?

    My C/C++ code/program is simple which involve only basic user I/O, loops, condition and display. And not really a long/complicated code.

    I tried google but there are some people which mention it is possible but i dun really get them. Thanks
  2. Papabravo


    Feb 24, 2006
    All C/C++ compilers will do this. I'm surprised that you could not infer this from knowing what the purpose of a compiler is.
  3. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    Is it? to 8086 assembly code? i am using Microsoft visual C++ express. How can i go about doing it? Thanks
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    There should be an option to create .LST and .ASM files when building.

    I'm not sure if the free "Express" versions do that, however, search through the help for a .LST file
  5. stahta01


    Jun 9, 2011
    You might need to get an old Compiler to do 8086 assembly code. But, nearly all compilers have an option to output assembly code.

    Tim S.
  6. bertus


    Apr 5, 2008

    You could take a look at TACK (The Amsterdam Compiler Kit):
    It can be used to compile ANSI C, pascal and modula-2 to z80,8086 and 80386.

  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    Borland's Turbo C++ is an excellent compiler for DOS applications, and some windows apps if you have a reference for the Win API.

    It is freeware now, it produces an .asm and .lst file in the course of assembly.

    It was THE compiler going through college, no .NET framework stuff, just raw code to solve math. MAPLE was around but expensive, MATLAB today would have made college so much simpler. At the same time, I can understand why basic circuit analysis has fallen, due to all the tools at hand.

    Some profs insisted on no graphing calculators, basically, HP15C and later in the 42s (Best HP Calc EVER) were the standard. Even then, profs cautioned us not to get too dependent on calculators. Absolutely no symbolic algebra calcs were allowed in math.

    So, we wrote our programs in C or Fortran on the mainframe for solving long equations and small simulations. I think it was version 3 or 4 at the time, and writing code to display with Windows 3.11 was Real Fun. You should try it. :D

    Though I can see now how that kept us "in the dark" when we got out of college and all this digital filter design showed up.:mad:
  8. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    There is also an open source 8086 cross-compiler for Linux called bcc that can produce assembly output.