6 Replies - 3114 Views - Last Post: 13 May 2018 - 03:42 AM

#1 minime91   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-March 18

Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 12 May 2018 - 12:49 PM

Hi all

Does anyone know if it is possible to convert C source code into 16-bit 8086 assembly (for use with EMU8086)?

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14867
  • View blog
  • Posts: 59,319
  • Joined: 12-June 08

Re: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 12 May 2018 - 01:12 PM

*shrug* "c to assembly" search led me to options.

Example:

https://www.geeksfor...embly-language/
Was This Post Helpful? 0
  • +
  • -

#3 minime91   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-March 18

Re: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 12 May 2018 - 06:54 PM

View Postmodi123_1, on 12 May 2018 - 01:12 PM, said:

*shrug* "c to assembly" search led me to options.

Example:

https://www.geeksfor...embly-language/


GCC produces 32-bit assembly, not 16-bit.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14867
  • View blog
  • Posts: 59,319
  • Joined: 12-June 08

Re: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 12 May 2018 - 07:06 PM

I assume your interwebz searches were farther than mine so I guess not.
Was This Post Helpful? 0
  • +
  • -

#5 Programmer2004   User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 96
  • Joined: 25-October 17

Re: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 12 May 2018 - 10:57 PM

You can try Bruce's C Compiler, it translates C into 8086 machine code, but it can also translate C into 8086 assembly code.
The only problem is that its main function is to produce code for DOS, so it can add offset 0x100 to addresses used in C code.

The other way is to analyze what exactly the C code does and then rewrite it to assembly.

This post has been edited by Programmer2004: 12 May 2018 - 10:59 PM

Was This Post Helpful? 0
  • +
  • -

#6 turboscrew   User is offline

  • D.I.C Lover
  • member icon

Reputation: 171
  • View blog
  • Posts: 1,107
  • Joined: 03-April 12

Re: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 13 May 2018 - 01:48 AM

Also Open Watcom and this: http://vetusware.com...202.51/?id=3503
do 16-bit Intel code, but I don't know what they require as environment.
Was This Post Helpful? 1
  • +
  • -

#7 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7403
  • View blog
  • Posts: 15,340
  • Joined: 16-October 07

Re: Convert C source code into 16-bit 8086 assembly (for use with EMU8086)

Posted 13 May 2018 - 03:42 AM

If you wish to live in the past, then you want a machine from the past.

You could grab DOSBox, get yourself some Turbo C from the same era, now freely available, and have at.

Enjoy the nostalgia tour.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1