Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use GCC to compile C code to 8088 Assembly?

I've been looking for a piece of information and couldn't seem to find it, maybe you guys could give me a hand. It's a simple question:

  • How to use GCC to compile C code into 8088 assembly?

I'm coding a small program in 8088 assembly and would like to know how some things are done by the compiler, this would be really great.

Thanks!

like image 837
Bernardo Oliveira Avatar asked Jun 04 '11 14:06

Bernardo Oliveira


People also ask

Does GCC compile to assembly?

Programmers can write their own assembly code by hand and compile it with gcc into a binary executable program. For example, to implement a function in assembly, add code to a . s file and use gcc to compile it.

Can I use GCC to compile C code?

Gcc supports various programming languages, including C, is completely free and is the go-to compiler for most Unix-like operating systems. In order to use it, we should make sur we install it on our computer, if it's not already there.

Does C compile to assembly?

c is being compiled without any additional links or files, so the program will be converted into an executable by itself. Alas, for the grand finale, let's run the full shebang (no computing reference intended here), gcc main. c without any options, to preprocess, compile, assemble, and link the program all at once.


1 Answers

There is an 16 bit release of djgpp (which is based on gcc), which is said to be able to produce 8086/88 code here

like image 176
Gunther Piez Avatar answered Oct 18 '22 07:10

Gunther Piez