This source PF generates EuroAssembler output object file in program format BIN.
pfbin PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32
INCLUDEHEAD "euroasm.htm" ; Interface (structures, symbols and macros) of other modules.
pfbin HEAD ; Start module interface.
ENDHEAD pfbin ; End of module interface.
- ↑ PfbinCompile OutputStream, Pgm
- PfbinCompile is constructor of output file image in plain binary output format.
Emitted contents of all initialized segments will be aligned and stored to output stream
When more than one segment is used in program, segments are linked to output image file
with alignment specified by the strongest of following three options:
-
PROGRAM FILEALIGN=
(default=0),
PROGRAM SECTIONALIGN=
(default=0),
SEGMENT ALIGN=
(default=16).
Relocations between segments are resolved as if the image were loaded to address
specified with option PROGRAM IMAGEBASE=
.
Binary format provides no metainformation, it has to manage its own base relocations,
stack intialization, program entry if the file is intended to execute.
- Input
- OutputStream is pointer to a
STREAM for the output image contents.
Pgm is pointer to PGM
representing the completely assembled and combined program.
- Output
- OutputStream is filled with output file contents.
- Error
- Errors are reported with macro Msg.
- Invoked from
- PfOutput
- Invokes
- PgmConcatenateImage
PgmCreateImplicitGroups
PgmLinkImage
PgmOrderSegments
RelocSort
- Tested by
- t7418
t7421
t7424
t7427
t7430
PfbinCompile Procedure OutputStream, Pgm
MOV EBX,[%Pgm]
Invoke PgmCreateImplicitGroups::,EBX
Invoke RelocSort::,EBX
Invoke PgmOrderSegments::,EBX
Invoke PgmLinkImage::,EBX,0
Invoke PgmConcatenateImage::,EBX
BufferRetrieve EAX
StreamStore [%OutputStream],ESI,ECX
EndProcedure PfbinCompile
- ↑ PfbinLoadPgm BasePgm, ObjBegin, ObjEnd, FileNamePtr
- Binary format BIN is not linkable, it cannot be loaded.
- Input
- BasePgm is pointer to an existing PGM
to which the object file is being linked/imported.
ObjBegin is pointer to the contents of linked/imported object file mapped in memory by the caller.
ObjSize is number of bytes in the object file.
FileNamePtr is pointer to zero-terminated object file name (used in error reports).
- Output
- -
- Error
- E8534 Format !1S of file "!2$" is not linkable.
- Invoked from
- PfLoad
PfbinLoadPgm Procedure BasePgm, ObjBegin, ObjSize, FileNamePtr
Msg '8534',Dict_FormatBIN::,[%FileNamePtr] ; Format !1S of file "!2$" is not linkable.
EndProcedure PfbinLoadPgm
ENDPROGRAM pfbin
▲Back to the top▲