File: dxeload.tex

package info (click to toggle)
fpc 1.9.4-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 63,532 kB
  • ctags: 93,677
  • sloc: pascal: 675,850; makefile: 219,089; xml: 9,242; perl: 7,703; yacc: 3,074; ansic: 2,275; lex: 711; sh: 406; asm: 71; csh: 34; sed: 33; cpp: 26; tcl: 7
file content (60 lines) | stat: -rw-r--r-- 2,270 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%
%   $Id: dxeload.tex,v 1.1 2000/07/13 09:10:03 michael Exp $
%   This file is part of the FPC documentation.
%   Copyright (C) 1997, by Michael Van Canneyt
%
%   The FPC documentation is free text; you can redistribute it and/or
%   modify it under the terms of the GNU Library General Public License as
%   published by the Free Software Foundation; either version 2 of the
%   License, or (at your option) any later version.
%
%   The FPC Documentation is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%   Library General Public License for more details.
%
%   You should have received a copy of the GNU Library General Public
%   License along with the FPC documentation; see the file COPYING.LIB.  If not,
%   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
%   Boston, MA 02111-1307, USA.
%
\chapter{The DXELOAD unit}
\section{Introduction}
The \file{dxeload} unit was implemented by Pierre M\"uller for \dos,
it allows to load a DXE file (an object file with 1 entry point)
into memory and return a pointer to the entry point.

It exists only for \dos.

\section{Constants, types and variables}
\subsection{Constants}
The following constant is the magic number, found in the header of a DXE
file.
\begin{verbatim}
DXE_MAGIC  = $31455844;
\end{verbatim}
\subsection{Types}
The following record describes the header of a DXE file. It is used to
determine the magic number of the DXE file and number of relocations that 
must be done when the object file i sloaded in memory.
\begin{verbatim}
dxe_header = record
   magic,
   symbol_offset,
   element_size,
   nrelocs       : longint;
end;
\end{verbatim}

\section{Functions and Procedures}
\begin{functionl}{dxe\_load}{dxeload}
\Declaration
function dxe\_load(filename : string) : pointer;
\Description
\var{dxe\_load} loads the contents of the file \var{filename} into memory.
It performs the necessary relocations in the object code, and returns then
a pointer to the entry point of the code.
\Errors
If an error occurs during the load or relocations, \var{Nil} is returned.
\end{functionl}
For an example, see the \file{emu387} unit in the RTL.