EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

pfbin.htm
Procedures
PfbinCompile
PfbinLoadPgm

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.
INCLUDEHEAD  \  ; Include headers of another modules used in this module.
eaopt.htm,   \
exp.htm,     \
msg.htm,     \
pgm.htm,     \
pgmopt.htm,  \
reloc.htm,    \
syswin.htm,  \
;;
 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: Relocations between segments are resolved as if the image were loaded to address specified with option PROGRAM IMAGEBASE= (default=0).
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
PgmGroupByModel PgmLink PgmOrderSegments PgmRelocResolve PgmStreamImage RelocReportUnresolved SymReportUnresolved
Tested by
t8000 t8001 t8050
PfbinCompile Procedure OutputStream, Pgm
    MOV EBX,[%Pgm]
    Invoke SymReportUnresolved::,EBX
    Invoke PgmGroupByModel::,EBX
    Invoke PgmOrderSegments::,EBX
    Invoke PgmLink::,EBX,0,0
    Invoke PgmRelocResolve::,EBX
    Invoke RelocReportUnresolved::,EBX
    Invoke PgmStreamImage::,EBX,[%OutputStream]
  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▲