32 C Compiler

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Tolga

32 C Compiler

Post by Tolga »

Hi!

I saw several C kernel example. But I want to a 32 Bit C compiler. And it must be support Intel Style assembly. :( I found GCC but it don't support Intel Style Assembly. How can i find it?

;) Thanks
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Re:32 C Compiler

Post by nick8325 »

Actually, GCC can support Intel syntax for assembly language, though I've never tried it myself. If you pass the -masm=intel option to GCC, it will emit Intel syntax assembly language and instruct the assembler (using .intel_syntax) to use that.

The form that it expects for Intel syntax is at http://sourceware.org/binutils/docs-2.16/as/i386_002dSyntax.html - it seems to be fairly normal.

GCC and AS don't understand about segmentation at all, though. Watcom does - you can get it from http://www.openwatcom.org. It has good support for ASM, and it's much faster than GCC on old machines while still generating decent code. Its generated code isn't as good as GCC's, though, and its linker isn't so good (when I used Watcom I used ld as the linker).

Also, there hasn't been a new version released in over a year, but it looks like there's a new beta version ready (released last week).
carbonBased

Re:32 C Compiler

Post by carbonBased »

Or you could just separate your asm into a separate file and build it via an intel syntax assembler (of which there are many).

In my opinion, inline assembly is evil. It's not portable, and doesn't appear to belong in a nicely formatted ansi c source file... but... just my opinion.

--Jeff
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:32 C Compiler

Post by kataklinger »

You can use Intel C++ compiler. I think there's a free version which you can down load from Intel websuite.
JAAman

Re:32 C Compiler

Post by JAAman »

or you can use the MS compiler -- its also free -- in the past the free one has been laking the optimizer -- but not now you can get the full thing free (even the IDE) go to the MS website and download Visual Studio Express, its free if you download it before november 7 2006

the only limitation on the free one is that it doesn't include MFC, which hardly matters for OSdev purposes
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:32 C Compiler

Post by kataklinger »

MS compiler is good choice if you are using Windows (I used to compile my os with it, but now I'm using Intel's and they are almost 100% compatible), but what if he using Linux :)
Ytinasni

Re:32 C Compiler

Post by Ytinasni »

JAAman wrote:or you can use the MS compiler
...
the only limitation on the free one is that it doesn't include MFC, which hardly matters for OSdev purposes
MFC is part of the Platform SDK, as well as all the windows libraries and headers. (The only libraries that come with VC Express are the c/c++ standard libraries)

THe Platform SDK can be downloaded from here
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:32 C Compiler

Post by Candy »

JAAman wrote: or you can use the MS compiler -- its also free -- in the past the free one has been laking the optimizer -- but not now you can get the full thing free (even the IDE) go to the MS website and download Visual Studio Express, its free if you download it before november 7 2006

the only limitation on the free one is that it doesn't include MFC, which hardly matters for OSdev purposes
Ooh... free graphical Windows program compiler... with form designer... I can finally make a Windows-based installer for my OS! :)
Post Reply