Pelles C forum

Assembly language => Assembly discussions => Topic started by: Mikl___ on October 20, 2016, 04:20:32 AM

Title: PoAsm and bin-files
Post by: Mikl___ on October 20, 2016, 04:20:32 AM
Hi, All!
Can somebody tell whether the compiler can create binary (*.COM) files?
What are the keys (options) for the compiler and linker are required or recommended to create it?
Thank you in advance
Title: Re: PoAsm and bin-files
Post by: frankie on October 21, 2016, 04:02:00 PM
I don't think PellesC suite can create any .com file.
A .COM executable is a 16 bits executable preloaded at segmented address 0000:0100H. Means that the file itself can be put in memory starting from address 0000:0100H and run directly without any relocation.
PellesC is a 32/64bits compiler system that produce PE (for 32bits) and PE+ (for 64bits) executables suitable for flat linear addressing.
The PE, or PE+, format includes headers, sections and other structures used by the OS loader to  load and, eventually, relocate code and data in memory.
The linker, POLINK, can't produce any segmented preloaded code.
Title: Re: PoAsm and bin-files
Post by: Mikl___ on October 21, 2016, 04:23:21 PM
Hi, frankie!
thanks for the your answer! I really not interested in the 16-bit COM-file, I need 64-bit binary file without  PE-header. PE-header I will write myself. This possibility supports FASM-compiler, I thought that PoAsm-compiler also has such an opportunity
Title: Re: PoAsm and bin-files
Post by: frankie on October 21, 2016, 05:24:38 PM
PoAsm can produce only obj files, in PECOFF format.
A binary file without PE header can be only absolute code, not linkable anymore.
As far as I understand FASM produce also PECOFF object files that can be linked together with other obj modules.
Of course you can use PECOFF obj's from PoAsm with a different linker/loader, able to read PECOFF obj format, to produce absolute position code.
Title: Re: PoAsm and bin-files
Post by: Mikl___ on October 22, 2016, 02:07:19 AM
Hi, frankie!
Thank you very mutch for the your answers