From 6f692d0faf226132687c3a1f9abc7cf168c4eab6 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 3 Oct 2001 14:40:06 +0000 Subject: [PATCH] * More camelcasing, set tocdepth=4 and secnumdepth=2 in intfpc.sty --- docs/internal/comparch.tex | 588 +++++++++++++++++++------------------ docs/internal/intfpc.sty | 6 +- 2 files changed, 299 insertions(+), 295 deletions(-) diff --git a/docs/internal/comparch.tex b/docs/internal/comparch.tex index eac35c1e18..935c574ad5 100644 --- a/docs/internal/comparch.tex +++ b/docs/internal/comparch.tex @@ -66,7 +66,7 @@ on the compiler, the i386 version of the compiler ressembles closely the m68k version, but there are subtle differences in the different interfaces. The architecture, and the different passes of the compiler are shown in -figure \ref{fig1}. +figure \seefig{fig1}. \begin{figure} \ifpdf @@ -90,7 +90,7 @@ input stream cause an error. \subsection{Architecture} \label{subsec:architectureand} -The general architecture of the scanner is show in figure \ref{fig2} +The general architecture of the scanner is show in figure \seefig{fig2} \begin{figure} \ifpdf @@ -240,7 +240,7 @@ Assuming that you have the following pascal syntax: %\lstinline!x := x * y + (6 shl x);! \begin{center} -$ x := x * y + (6\xspace shl \xspace x);$ +$ x := x * y + (6\; shl \; x);$ \end{center} The tree structure in picture \ref{fig3} will be built in memory, where each @@ -527,7 +527,7 @@ done to verify if not reading invalid memory ranges. \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -546,7 +546,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -574,7 +574,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -591,7 +591,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -614,7 +614,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -647,7 +647,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -677,7 +677,7 @@ Field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -694,7 +694,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -710,7 +710,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -728,7 +728,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -744,7 +744,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -756,7 +756,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -771,7 +771,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -787,7 +787,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -803,7 +803,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -817,7 +817,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -847,7 +847,7 @@ of the routine which called the inline routine. \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -869,7 +869,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -883,7 +883,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -897,7 +897,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -913,7 +913,7 @@ set to FALSE if the Self{\_}Register was modified in the asm statement. \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -929,7 +929,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -944,7 +944,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -960,7 +960,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -974,7 +974,7 @@ field & Description \\ \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -1058,7 +1058,7 @@ The type of possible symbol tables are shown in the following diagram: \begin{longtable}{|l|p{10cm}|} \hline -field & Description \\ +Field & Description \\ \hline \endhead \hline @@ -1683,7 +1683,7 @@ parsing construct found. The object definition is created each time an object declaration is found in the type declaration section. -\begin{tabular*}{6.5in}{|l@{\extracolsep{\fill}}lp{6cm}|} +\begin{tabular*}{6.5in}{|l@{\extracolsep{\fill}}lp{5.5cm}|} \hline \textsf{TYPE}& & \\ \xspace pObjectDef = & \^{} TObjectDef; & \\ @@ -1886,7 +1886,7 @@ This is the base of all routine type definitions. This object is abstract, and is not directly used in a useful way. The derived object of this object are used for the actual parsing process. -\begin{tabular*}{6.5in}{|l@{\extracolsep{\fill}}lp{5.5cm}|} +\begin{tabular*}{6.5in}{|l@{\extracolsep{\fill}}lp{5.2cm}|} \hline \textsf{TYPE}& & \\ \xspace pAbstractProcDef = & \^{} TAbstractProcDef; & \\ @@ -2032,14 +2032,14 @@ routine are populated as required. \xspace pProcDef = & \^{} TProcDef; & \\ \xspace \textsf{TProcDef} = & \textbf{Object}(TAbstractProcDef) & \\ &\textsf{ForwardDef : Boolean;}& TRUE if this is a forward definition \\ -&\textsf{InterfaceDef: Boolean;}& \\ -&\textsf{ExtNumber : Longint;}& \\ -&\textsf{MessageInf : TMessageInf;}& \\ -&\textsf{NextOverloaded : pProcDef;}& \\ -&\textsf{FileInfo : TFilePosInfo;}& +&\textsf{InterfaceDef: Boolean;} & \\ +&\textsf{ExtNumber : Longint;} & \\ +&\textsf{MessageInf : TMessageInf;} & \\ +&\textsf{NextOverloaded : pProcDef;} & \\ +&\textsf{FileInfo : TFilePosInfo;} & Position in source code for the declaration of this routine. Used for error management. \\ -&\textsf{Localst : pSymTable;}& The local variables symbol table \\ +&\textsf{Localst : pSymTable;} & The local variables symbol table \\ &\textsf{Parast: pSymTable;}& The parameter symbol table \\ &\textsf{ProcSym : pProcSym;}& Points to owner of this definition \\ &\textsf{LastRef : pRef;}& \\ @@ -2067,7 +2067,7 @@ of the default string type definitions are loaded when the compiler starts up. Others are created at compile time as they are declared with a specific length type. -\begin{tabular*}{6.5in}{|l@{\extracolsep{\fill}}lp{9cm}|} +\begin{tabular*}{6.5in}{|l@{\extracolsep{\fill}}lp{8cm}|} \hline \textsf{TYPE}& & \\ \xspace pStringDef = & \^{} TStringDef; & \\ @@ -2118,16 +2118,16 @@ be attached to the enumeration definition. \textsf{TYPE} & & \\ \xspace \textsf{pEnumDef} &= \^{} \textbf{TEnumDef};& \\ \xspace \textsf{TEnumDef} &= \textbf{object}(TDef) & \\ -&\textsf{\textit{has{\_}jumps : boolean;}}& +&\textsf{\textit{Has{\_}Jumps : Boolean;}}& \textit{Currently unused} \\ -&\textsf{minval : longint;}& +&\textsf{MinVal : Longint;}& Value of the first element in the enumeration \\ -&\textsf{maxval : longint;}& +&\textsf{MaxVal : Longint;}& Value of the last element in the enumeration \\ -&\textsf{firstenum : penumsym;}& +&\textsf{FirstEnum : pEnumSym;}& Pointer to a linked list of elements in the enumeration, each with its name and value. \\ -&\textsf{basedef : penumdef;}& +&\textsf{BaseDef : pEnumDef;}& In the case where the enumeration is a subrange of another enumeration, this gives information on the base range of the elements \\ &\textsf{end;}& \\ @@ -2145,9 +2145,9 @@ of declaration}). \textsf{TYPE} & & \\ \xspace \textsf{pSetDef} &= \^{} \textbf{TSetDef};& \\ \xspace \textsf{TSetDef} &= \textbf{object}(TDef) & \\ -&\textsf{settype : tsettype;}& +&\textsf{SetType : TSetType;}& Indicates the storage type of the set (Cf. \ref{tab11}). \\ -&\textsf{elementtype : ttype;}& +&\textsf{ElementType : TType;}& Points the type definition and symbol table to the elements in the set. \\ &\textsf{end;}& \\ \hline @@ -2155,16 +2155,16 @@ of declaration}). \begin{longtable}{|l|p{10cm}|} \hline -set type (tsettype) & Description \\ +set type (TSetType) & Description \\ \hline \endhead \hline \endfoot -\textsf{normset}& +\textsf{NormSet}& Normal set of up to 256 elements (32 byte storage space required) \\ -\textsf{smallset}& +\textsf{SmallSet}& Small set of up to 32 elements (4 byte storage space) \\ -\textsf{\textit{varset}}& +\textsf{\textit{VarSet}}& \textit{Variable number of element set (storage size is dependent on number of elements) (currently unused and unsupported)} \\ \end{longtable} @@ -2174,7 +2174,7 @@ set type (tsettype) & Description \\ \begin{function}{TDef.Size} \Declaration -Function TDef.size : longint; +Function TDef.Size : Longint; \Description This method returns the true size of the memory space required in bytes for this type definition (after alignment considerations). @@ -2182,7 +2182,7 @@ this type definition (after alignment considerations). \begin{function}{TDef.Alignment} \Declaration -Function TDef.Alignment : longint; +Function TDef.Alignment : Longint; \Description This method returns the alignment of the data for complex types such as records and objects, otherwise returns 0 or 1 (no alignment). @@ -2218,52 +2218,52 @@ which modules to recompile. \textsf{TYPE}& & \\ \xspace pModule = & \^{} TModule; & \\ \xspace \textsf{TModule} = & \textbf{Object}(TLinkedList\_Item) & \\ -&\textsf{ppufile : pppufile;}& Pointer to PPU file object (unit file) \\ -&\textsf{crc : longint;}& CRC-32 bit of the whole PPU file \\ -&\textsf{interface{\_}crc : longint;}& CRC-32 bit of the interface part of the PPU file \\ -&\textsf{flags: longint;}& Unit file flags \\ -&\textsf{compiled: boolean;}& TRUE if module is already compiled \\ -&\textsf{do{\_}reload : boolean;} & TRUE if the PPU file must be reloaded \\ -&\textsf{do{\_}assemble : boolean;} & Only assemble, don't recompile unit \\ -&\textsf{sources{\_}avail : boolean;} & TRUE if all sources of module are available \\ -&\textsf{sources{\_}checked : boolean;} & TRUE if the sources has already been checked \\ -&\textsf{is{\_}unit: boolean;} & TRUE if this is a unit (otherwise a library or a main program) \\ -&\textsf{in{\_}compile: boolean;} & module is currently being recompiled \\ -&\textsf{in{\_}second{\_}compile: boolean;}& module is being compiled for second time \\ -&\textsf{in{\_}second{\_}load: boolean;} & module is being reloaded a second time \\ -&\textsf{in{\_}implementation : boolean;}& currently compiling implementation part (units only) \\ -&\textsf{in{\_}global : boolean;} & currently compiling implementation part (units only) \\ -&\textsf{recompile{\_}reason : trecompile{\_}reason;}& Reason why module should be recompiled \\ -&\textsf{islibrary : boolean;}& TRUE if this module is a shared library \\ -&\textsf{map : punitmap;} & Map of all used units for this unit \\ -&\textsf{unitcount : word;} & Internal identifier of unit (for GDB support) \\ -&\textsf{unit{\_}index : word;} & \\ -&\textsf{globalsymtable : pointer;} & Symbol table for this module of externally visible symbols \\ -&\textsf{localsymtable : pointer;} & Symbol table for this module of locally visible symbols \\ -&\textsf{scanner : pointer;} & Scanner object pointer \\ -&\textsf{loaded{\_}from : pmodule;} & Module which referred to this module \\ -&\textsf{uses{\_}imports : boolean;} & TRUE if this module imports symbols from a shared library \\ -&\textsf{imports : plinkedlist} & Linked list of imported symbols \\ -&\textsf{{\_}exports : plinkedlist;} & Linked list of exported symbols (libraries only) \\ -&\textsf{sourcefiles : pfilemanager;} & List of all source files for this module \\ -&\textsf{resourcefiles : tstringcontainer;} & List of all resource files for this module \\ -&\textsf{used{\_}units : tlinkedlist; } & Information on units used by this module (pused{\_}unit) \\ -&\textsf{dependent{\_}units : tlinkedlist;}& \\ -&\textsf{localunitsearchpath : TsearchPathList;}& Search path for obtaining module source code \\ -&\textsf{localobjectsearchpath:TsearchPathList;}& \\ -&\textsf{localincludesearchpath:TsearchPathList;}& Search path for includes for this module \\ -&\textsf{locallibrarysearchpathTSearchPathList;}& \\ -&\textsf{path : pstring;}& Path were module is located or created \\ -&\textsf{outputpath : pstring;}& Path where object files (unit), executable (program) or shared library (library) is created \\ -&\textsf{modulename : pstring;}& Name of the module in uppercase \\ -&\textsf{objfilename : pstring;}& Full name of object file or executable file \\ -&\textsf{asmfilename : pstring;}& Full name of the assembler file \\ -&\textsf{ppufilename : pstring;}& Full name of the PPU file \\ -&\textsf{staticlibfilename : pstring;}& Full name of the static library name (used when smart linking is used) \\ -&\textsf{sharedlibfilename : pstring;}& Filename of the output shared library (in the case of a library) \\ -&\textsf{exefilename : pstring;}& Filename of the output executable (in the case of a program) \\ -&\textsf{asmprefix : pstring;}& Filename prefix of output assembler files when using smartlinking \\ -&\textsf{mainsource : pstring;}& Name of the main source file \\ +&\textsf{PPUFile : pPPUFile;}& Pointer to PPU file object (unit file) \\ +&\textsf{Crc : Longint;}& CRC-32 bit of the whole PPU file \\ +&\textsf{Interface{\_}CRC : Longint;}& CRC-32 bit of the interface part of the PPU file \\ +&\textsf{Flags: Longint;}& Unit file flags \\ +&\textsf{Compiled: Boolean;}& TRUE if module is already compiled \\ +&\textsf{Do{\_}Reload : Boolean;} & TRUE if the PPU file must be reloaded \\ +&\textsf{Do{\_}Assemble : Boolean;} & Only assemble, don't recompile unit \\ +&\textsf{Sources{\_}Avail : Boolean;} & TRUE if all sources of module are available \\ +&\textsf{Sources{\_}Checked : Boolean;} & TRUE if the sources has already been checked \\ +&\textsf{Is{\_}Unit: Boolean;} & TRUE if this is a unit (otherwise a library or a main program) \\ +&\textsf{In{\_}Compile: Boolean;} & module is currently being recompiled \\ +&\textsf{In{\_}Second{\_}Compile: Boolean;}& module is being compiled for second time \\ +&\textsf{In{\_}Second{\_}Load: Boolean;} & module is being reloaded a second time \\ +&\textsf{In{\_}Implementation : Boolean;}& currently compiling implementation part (units only) \\ +&\textsf{In{\_}Global : Boolean;} & currently compiling implementation part (units only) \\ +&\textsf{Recompile{\_}Reason : TRecompile{\_}Reason;}& Reason why module should be recompiled \\ +&\textsf{Islibrary : Boolean;}& TRUE if this module is a shared library \\ +&\textsf{Map : pUnitMap;} & Map of all used units for this unit \\ +&\textsf{Unitcount : Word;} & Internal identifier of unit (for GDB support) \\ +&\textsf{Unit{\_}index : Eord;} & \\ +&\textsf{Globalsymtable : Pointer;} & Symbol table for this module of externally visible symbols \\ +&\textsf{Localsymtable : Pointer;} & Symbol table for this module of locally visible symbols \\ +&\textsf{Scanner : Pointer;} & Scanner object pointer \\ +&\textsf{Loaded{\_}From : pModule;} & Module which referred to this module \\ +&\textsf{Uses{\_}Imports : Boolean;} & TRUE if this module imports symbols from a shared library \\ +&\textsf{Imports : pLinkedList} & Linked list of imported symbols \\ +&\textsf{{\_}Exports : pLinkedList;} & Linked list of exported symbols (libraries only) \\ +&\textsf{SourceFiles : pFileManager;} & List of all source files for this module \\ +&\textsf{ResourceFiles : TStringContainer;} & List of all resource files for this module \\ +&\textsf{Used{\_}Units : TLinkedList; } & Information on units used by this module (pused{\_}unit) \\ +&\textsf{Dependent{\_}Units : TLinkedList;}& \\ +&\textsf{LocalUnitSearchPath,}& Search path for obtaining module source code \\ +&\textsf{LocalObjectSearchPath,}& \\ +&\textsf{LocalIncludeSearchPath,}& Search path for includes for this module \\ +&\textsf{LocalLibrarySearchPath:TSearchPathList;}& \\ +&\textsf{Path : pString;}& Path were module is located or created \\ +&\textsf{OutputPath : pString;}& Path where object files (unit), executable (program) or shared library (library) is created \\ +&\textsf{ModuleName : pString;}& Name of the module in uppercase \\ +&\textsf{ObjFileName : pString;}& Full name of object file or executable file \\ +&\textsf{AsmFileName : pString;}& Full name of the assembler file \\ +&\textsf{PPUFileName : pString;}& Full name of the PPU file \\ +&\textsf{StaticLibFilename : pString;}& Full name of the static library name (used when smart linking is used) \\ +&\textsf{SharedLibFilename : pString;}& Filename of the output shared library (in the case of a library) \\ +&\textsf{ExeFileName : pString;}& Filename of the output executable (in the case of a program) \\ +&\textsf{AsmPrefix : pString;}& Filename prefix of output assembler files when using smartlinking \\ +&\textsf{MainSource : pString;}& Name of the main source file \\ &\textsf{end;}& \\ %\end{tabular*} \end{longtable} @@ -2333,14 +2333,14 @@ which modules to recompile. \begin{variable}{AktProcSym} \Declaration -Var aktprocsym : pProcSym; +Var AktProcSym : pProcSym; \Description Pointer to the symbol information for the routine currently being parsed. \end{variable} \begin{variable}{LexLevel} \Declaration -var lexlevel : longint; +var LexLevel : longint; \Description Level of code currently being parsed and compiled \par 0 = for main program \par 1 = for subroutine \par 2 = for local / nested subroutines. @@ -2348,7 +2348,7 @@ Level of code currently being parsed and compiled \par 0 = for main program \begin{variablel}{Current{\_}Module}{currentmodule} \Declaration -var Current{\_}Module : pModule; +Var Current{\_}Module : pModule; \Description Information on the current module (program, library or unit) being compiled. \end{variablel} @@ -2361,7 +2361,7 @@ should always be valid: \begin{variable}{VoidDef} \Declaration -var VoidDef : pOrdDef; +Var VoidDef : pOrdDef; \Description Pointer to procedure??? \Notes @@ -2370,7 +2370,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{cCharDef} \Declaration -var cCharDef : pOrdDef; +Var cCharDef : pOrdDef; \Description Type definition for a character (\textsf{char}) \Notes @@ -2379,7 +2379,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{cWideCharDef} \Declaration -var cWideCharDef : pOrdDef; +Var cWideCharDef : pOrdDef; \Description Type definition for a unicode character (\textsf{widechar}) \Notes @@ -2388,7 +2388,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{BoolDef} \Declaration -var BoolDef : pOrdDef; +Var BoolDef : pOrdDef; \Description Type definition for a boolean value (\textsf{boolean}) \Notes @@ -2397,7 +2397,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{u8BitDef} \Declaration -var u8BitDef : pOrdDef; +Var u8BitDef : pOrdDef; \Description Type definition for an 8-nit unsigned value (\textsf{byte}) \Notes @@ -2406,7 +2406,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{u16BitDef} \Declaration -var u16BitDef : pOrdDef; +Var u16BitDef : pOrdDef; \Description Type definition for an unsigned 16-bit value (\textsf{word}) \Notes @@ -2415,7 +2415,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{u32BitDef} \Declaration -var u32BitDef : pOrdDef; +Var u32BitDef : pOrdDef; \Description Type definition for an unsigned 32-bit value (\textsf{cardinal}) \Notes @@ -2424,7 +2424,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{s32BitDef} \Declaration -var s32BitDef : pOrdDef; +Var s32BitDef : pOrdDef; \Description Type definition for a signed 32-bit value (\textsf{longint}) \Notes @@ -2433,7 +2433,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{cu64BitDef} \Declaration -var cu64BitDef : pOrdDef; +Var cu64BitDef : pOrdDef; \Description Type definition for an unsigned 64-bit value (\textsf{qword}) \Notes @@ -2442,7 +2442,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{cs64BitDef} \Declaration -var cs64BitDef : pOrdDef; +Var cs64BitDef : pOrdDef; \Description Type definition for a signed 64-bit value (\textsf{int64}) \Notes @@ -2457,7 +2457,7 @@ should always be valid: \begin{variable}{s64FloatDef} \Declaration -var s64FloatDef : pFloatDef; +Var s64FloatDef : pFloatDef; \Description Type definition for a 64-bit IEEE floating point type (\textsf{double}) \Notes @@ -2467,7 +2467,7 @@ actually really point to the double type if the cpu does not support it. \begin{variable}{s32FloatDef} \Declaration -var s32FloatDef : pFloatDef; +Var s32FloatDef : pFloatDef; \Description Type definition for a 32-bit IEEE floating point type (\textsf{single}) \Notes @@ -2477,7 +2477,7 @@ actually really point to the single type if the cpu does not support it. \begin{variable}{s80FloatDef} \Declaration -var s80FloatDef : pFloatDef; +Var s80FloatDef : pFloatDef; \Description Type definition for an extended floating point type (\textsf{extended}) \Notes @@ -2488,7 +2488,7 @@ support it. \begin{variable}{s32FixedDef} \Declaration -var s32FixedDef : pFloatDef; +Var s32FixedDef : pFloatDef; \Description Type definition for a fixed point 32-bit value (\textsf{fixed}) \Notes @@ -2505,7 +2505,7 @@ should always be valid: \begin{variable}{cShortStringDef} \Declaration -var cShortStringDef : pStringDef; +Var cShortStringDef : pStringDef; \Description Type definition for a short string type (\textsf{shortstring}) \Notes @@ -2514,7 +2514,7 @@ This is loaded as a default supported type for the compiler. \begin{variable}{cLongStringDef} \Declaration -var cLongStringDef : pStringDef; +Var cLongStringDef : pStringDef; \Description Type definition for a long string type (\textsf{\textit{longstring}}) \Notes @@ -2523,7 +2523,7 @@ This is loaded as a default supported type for the compiler. \begin{variable}{cAnsiStringDef} \Declaration -var cAnsiStringDef : pStringDef; +Var cAnsiStringDef : pStringDef; \Description Type definition for an ansistring type (\textsf{ansistring}) \Notes @@ -2532,7 +2532,7 @@ This is loaded as a default supported type for the compiler. \begin{variable}{cWideStringDef} \Declaration -var cWideStringDef : pStringDef; +Var cWideStringDef : pStringDef; \Description Type definition for an wide string type (\textsf{\textit{widestring}}) \Notes @@ -2541,7 +2541,7 @@ This is loaded as a default supported type for the compiler. \begin{variable}{OpenShortStringDef} \Declaration -var OpenShortStringDef : pStringDef; +Var OpenShortStringDef : pStringDef; \Description Type definition for an open string type (\textsf{openstring}) \Notes @@ -2550,7 +2550,7 @@ This is loaded as a default supported type for the compiler. \begin{variable}{OpenCharArrayDef} \Declaration -var OpenCharArrayDef : pArrayDef; +Var OpenCharArrayDef : pArrayDef; \Description Type definition for an open char array type(\textsf{openchararray}) \Notes @@ -2567,7 +2567,7 @@ should always be valid: \begin{variable}{VoidPointerDef} \Declaration -var VoidPointerDef : pPointerDef; +Var VoidPointerDef : pPointerDef; \Description Type definition for a pointer which can point to anything (\textsf{pointer}) \Notes @@ -2576,7 +2576,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{CharPointerDef} \Declaration -var CharPointerDef : pPointerDef; +Var CharPointerDef : pPointerDef; \Description Type definition for a pointer which can point to characters (\textsf{pchar}) \Notes @@ -2585,7 +2585,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{VoidFarPointerDef} \Declaration -var VoidFarPointerDef : pPointerDef; +Var VoidFarPointerDef : pPointerDef; \Description Type definition for a pointer which can point to anything (intra-segment) (\textsf{far pointer}) @@ -2595,7 +2595,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{cFormalDef} \Declaration -var cFormalDef : pFormalDef; +Var cFormalDef : pFormalDef; \Notes This is loaded as a default supported type for the compiler \end{variable} @@ -2604,7 +2604,7 @@ This is loaded as a default supported type for the compiler \begin{variable}{cfFileDef} \Declaration -var cfFileDef : pFileDef; +Var cfFileDef : pFileDef; \Description This is the default file type (\textsf{file}) \Notes This is loaded as a default supported type for the compiler \end{variable} @@ -2620,7 +2620,7 @@ var cfFileDef : pFileDef; The code generator is responsible for creating the assembler output in form of a linked list, taking as input the node created in the parser and the -1$^{st}$ pass. The following diagram shows an overview of the code generator +1$^{st}$ pass. Picture \seefig{fig9} shows an overview of the code generator architecture: \begin{figure} @@ -2630,7 +2630,7 @@ architecture: \else \includegraphics[width=5.68in,height=1.76in]{arch9.eps} \fi -\label{fig9} +\label{fig:fig9} \caption{Codegenerator architecture} \end{figure} @@ -2645,7 +2645,7 @@ generation and the parsing process is show in the following diagram: \else \includegraphics[width=6.95in,height=4.90in]{arch10.eps} \fi -\label{fig10} +\label{fig:fig10} \caption{Interaction between codegeneration and the parsing process} \end{figure} @@ -2722,11 +2722,12 @@ Field & Description \\ \endhead \hline \endfoot -\textsf{fpuregister : tregister;}& +\textsf{FpuRegister : TRegister;}& Indicates in what register the operand is located (a general purpose register in emulation mode, and a floating point register when floating point hardware is present) \\ -\textsf{fpuregisterhigh, } \par \textsf{fpuregisterlow : tregister;}& +\textsf{FpuRegisterHigh, } \par +\textsf{FpuRegisterLow : TRegister;}& Indicates in what registers the operand are located (for emulation support - these are general purpose registers) \end{longtable} @@ -2745,11 +2746,11 @@ Field & Description \\ \endhead \hline \endfoot -\textsf{register : tregister}& +\textsf{Register : TRegister}& Indicates in what register the operand is located. \\ -\textsf{registerhigh : tregister;}& +\textsf{RegisterHigh : TRegister;}& High 32-bit of 64-bit virtual register (on 32-bit machines) \\ -\textsf{registerlow : tregister;}& +\textsf{RegisterLow : TRegister;}& Low 32-bit of 64-bit virtual register (on 32-bit machines) \end{longtable} @@ -2766,7 +2767,7 @@ Field & Description \\ \endhead \hline \endfoot -\textsf{reference : treference;}& +\textsf{Reference : TReference;}& Information on the location in memory \end{longtable} @@ -2783,25 +2784,25 @@ The treference consists of the following: \textsf{TYPE} & & \\ \xspace \textsf{pReference} &= \^{} \textbf{TReference};& \\ \xspace \textsf{TReference} &= \textbf{packed Record} & \\ -&\textsf{is{\_}immediate : boolean;}& +&\textsf{Is{\_}Immediate : Boolean;}& Indicates that this location points to a memory location, but to a constant value (TRUE), which is located in the offset field. \\ -&\textsf{segment : tregister;}& (cpu-specific) \\ -&\textsf{base : tregister;}& +&\textsf{Segment : TRegister;}& (cpu-specific) \\ +&\textsf{Base : TRegister;}& Base address register for assembler expression \\ -&\textsf{index : tregister;}& +&\textsf{Index : TRegister;}& Index register for assembler expression \\ -&\textsf{scalefactor : byte;}& +&\textsf{ScaleFactor : Byte;}& Multiplication factor for assembler expression (this field is cpu-specific) \\ -&\textsf{offset : longint;}& +&\textsf{Offset : Longint;}& Either an offset from base assembler address expression to add (if - is{\_}constant = FALSE) otherwise the numeric value of the operand \\ -&\textsf{symbol : pasmsymbol;}& + Is{\_}Constant = FALSE) otherwise the numeric value of the operand \\ +&\textsf{Symbol : pAsmSymbol;}& Pointer to the symbol name string of the reference in case where it is a symbolic reference \\ -&\textsf{offsetfixup : longint;}& \\ -&\textsf{options : trefoptions;}& \\ +&\textsf{OffsetFixup : Longint;}& \\ +&\textsf{Options : TRefOptions;}& \\ &\textsf{END;}& \\ \hline \end{tabular*} @@ -2828,7 +2829,7 @@ Field & Description \\ \endhead \hline \endfoot -\textsf{resflags : tresflags;}& +\textsf{ResFlags : TResFlags;}& This indicates the flag which must be verified for the actual jump operation. \textsf{tresflags }is an enumeration of all possible conditional flags which can be set by the processor. \\ @@ -2849,11 +2850,11 @@ Field & Description \\ \endhead \hline \endfoot -\textsf{register : tregister}& +\textsf{Register : TRegister}& Indicates in what register the operand is located. \\ -\textsf{registerhigh : tregister;}& +\textsf{RegisterHigh : TRegister;}& High 32-bit of 64-bit virtual register (on 32-bit machines) \\ -\textsf{registerlow : tregister;}& +\textsf{RegisterLow : TRegister;}& Low 32-bit of 64-bit virtual register (on 32-bit machines) \\ \end{longtable} @@ -2951,7 +2952,7 @@ expressions. \subsubsection{fpu registers} \label{subsubsec:mylabel25} -\textsf{fpuregs: array[1..maxfpuregs] of tregister;} +\textsf{FpuRegs: array[1..MaxFpuRegs] of TRegister;} Hardware floating point registers. These registers must at least be able to load and store IEEE DOUBLE floating point values, otherwise they cannot be @@ -2961,7 +2962,7 @@ coprocessor. \subsubsection{scratch registers} \label{subsubsec:scratch} -\textsf{scratch{\_}regs: array[1..maxscratchregs] of tregister;} +\textsf{Scratch{\_}Regs: array[1..MaxScratchRegs] of TRegister;} These registers are used as scratch, and can be used in assembler statement in the pascal code, without being saved. They will always be valid across @@ -2977,26 +2978,26 @@ special registers are of course CPU dependant, but as an indication, the following sections explains the uses of these special registers and their defines. -\subsubsection{stack{\_}pointer} +\subsubsection{Stack{\_}Pointer} \label{subsubsec:stack} -\textsf{const stack{\_}pointer = R{\_}A7} +\textsf{Const Stack{\_}Pointer = R{\_}A7} This represents the stack pointer, an address register pointing to the allocated stack area. -\subsubsection{frame{\_}pointer} +\subsubsection{Frame{\_}Pointer} \label{subsubsec:frame} -\textsf{const frame{\_}pointer = R{\_}A6} +\textsf{Const Frame{\_}Pointer = R{\_}A6} This represents the frame register which is used to access values in the stack. This is usually also an address register. -\subsubsection{self{\_}pointer} +\subsubsection{Self{\_}Pointer} \label{subsubsec:mylabel26} -\textsf{const self{\_}pointer = R{\_}A5} +\textsf{Const Self{\_}Pointer = R{\_}A5} This represents the self register, which represents a pointer to the current instance of a class or object. @@ -3004,7 +3005,7 @@ instance of a class or object. \subsubsection{accumulator} \label{subsubsec:accumulatorents} -\textsf{const accumulator = R{\_}D0} +\textsf{Const Accumulator = R{\_}D0} The accumulator is used (except in the i386) as a scratch register, and also for return value in functions (in the case where they are 32-bit or less). @@ -3053,7 +3054,7 @@ Does not verify if \textsf{R} is assigned first. \begin{function}{NewReference} \Declaration -function NewReference(Const R : TReference) : pReference; +Function NewReference(Const R : TReference) : pReference; \Description Allocates in the heap a copy of the reference \textsf{r} and returns that allocated pointer. @@ -3061,7 +3062,7 @@ allocated pointer. \begin{functionl}{Del{\_}Reference}{delreference} \Declaration -procedure Del{\_}Reference(Const Ref : tReference); +Procedure Del{\_}Reference(Const Ref : tReference); \Description Free up all address registers allocated in this reference for the index and base (if required). @@ -3080,7 +3081,7 @@ allocated reference. Returns this newly allocated reference. \begin{procedurel}{Reset{\_}Reference}{resetreference} \Declaration -procedure Reset{\_}Reference(var ref : treference); +Procedure Reset{\_}Reference(Var Ref : TReference); \Description Clears all fields of the reference. \end{procedurel} @@ -3111,7 +3112,7 @@ generator. \begin{function}{GetRegister32} \Declaration -function GetRegister32 : tregister; +Function GetRegister32 : TRegister; \Description Allocates and returns a general purpose (integer) register which can be used in the code generator. The register, when no longer used should be @@ -3124,7 +3125,7 @@ register). \begin{procedure}{GetRegisterPair} \Declaration -procedure GetRegisterPair(var low, high : TRegister); +Procedure GetRegisterPair(Var Low, High : TRegister); \Description Returns a register pair to be used by the code generator when accessing 64-bit values on 32-bit wide register machines. @@ -3148,7 +3149,7 @@ Deallocates a general purpose register which was previously allocated with \begin{function}{GetFloatRegister} \Declaration -Function GetFloatRegister : tregister; +Function GetFloatRegister : TRegister; \Description Allocates and returns a floating point register which can be used in the code generator. The register, when no longer used should be deallocated with @@ -3173,7 +3174,7 @@ machines which do not support true floating point registers. \begin{function}{GetAdressReg} \Declaration -Function GetAddressReg : tregister; +Function GetAddressReg : TRegister; \Description Allocates and returns an address register which can be used for address related opcodes in the code generator. The register, when no longer used @@ -3200,7 +3201,7 @@ general purpose register and return TRUE in that case. \begin{procedure}{UngetRegister} \Declaration -procedure UngetRegister(r : TRegister); +Procedure UngetRegister(r : TRegister); \Description Deallocates any register which was previously allocated with any of the allocation register routines. @@ -3208,7 +3209,7 @@ allocation register routines. \begin{function}{SaveUsedRegisters} \Declaration -procedure SaveUsedRegisters(var Saved : TSaved; ToSave: TRegisterset); +Procedure SaveUsedRegisters(Var Saved : TSaved; ToSave: TRegisterset); \Description Saves in a temporary location all specified registers. On stack based machines the registers are saved on the stack, otherwise they are saved in a @@ -3229,14 +3230,14 @@ location). Free any temporary memory space allocated, if necessary. \begin{function}{GetExplicitRegister32} \Declaration -Function GetExplicitRegister32(r : tregister): tregister; +Function GetExplicitRegister32(R : TRegister): TRegister; \Description -This routine allocates specifically the specified register \textsf{r }and +This routine allocates specifically the specified register \textsf{r} and returns that register. The register to allocate can only be one of the scratch registers. \Notes This routine is used for debugging purposes only. It should be used in -conjunctions with ungetregister32() to explicitly allocate and deallocate a +conjunctions with UnGetRegister32() to explicitly allocate and deallocate a scratch register. \end{function} @@ -3259,13 +3260,13 @@ necessary. The temporary memory allocation is a linked list of entries containing information where to access the data via a negative offset from the -frame{\_}pointer register. The linked list is only valid when compiling and +Frame{\_}Pointer register. The linked list is only valid when compiling and generating the code for the procedure bodies; it is reset and cleared each time a new routine is compiled. There are currently three different types of -memory spaces in use : volatile (\textsf{tt{\_}normal}) which can be +memory spaces in use : volatile (\textsf{tt{\_}Normal}) which can be allocated and freed any time in the procedure body, ansistring, which is currently the same as volatile, except it only stored references to -ansistring's, and persistent (\textsf{tt{\_}persistent}) which are memory +ansistring's, and persistent (\textsf{tt{\_}Persistent}) which are memory blocks which are reserved throughout the routine duration; persistent allocated space can never be reused in a procedure body, unless explicitly released. @@ -3281,26 +3282,26 @@ on the operating system required alignment. \begin{function}{GetTempOfSize} \Declaration -function GetTempOfSize(Size : Longint) : Longint; +Function GetTempOfSize(Size : Longint) : Longint; \Description Allocates at least \textsf{size} bytes of temporary volatile memory on the stack. The return value is the negative offset from the frame pointer where this memory was allocated. \Notes The return offset always has the required alignment for the target system, -and can be used as an offset from the frame{\_}pointer to access the +and can be used as an offset from the Frame{\_}Pointer to access the temporary space. \end{function} \begin{procedure}{GetTempOfSizeReference} \Declaration -procedure GetTempOfSizeReference(l : Longint;Var Ref : TReference); +Procedure GetTempOfSizeReference(L : Longint;Var Ref : TReference); \Description This routine is used to assign and allocate extra temporary volatile memory space on the stack from a reference. \textsf{l} is the size of the -persistent memory space to allocate, while \textsf{ref} is a reference entry -which will be set to the correct offset from the frame{\_}pointer register -base. The \textsf{offset} and \textsf{base} fields of \textsf{ref} will be +persistent memory space to allocate, while \textsf{Ref} is a reference entry +which will be set to the correct offset from the Frame{\_}Pointer register +base. The \textsf{Offset} and \textsf{Base} fields of \textsf{Ref} will be set appropriately in this routine, and can be considered valid on exit of this routine. \Notes @@ -3309,9 +3310,9 @@ The return offset always has the required alignment for the target system. \begin{procedure}{UnGetIfTemp} \Declaration -procedure UnGetIfTemp(const ref : treference); +Procedure UnGetIfTemp(Const Ref : TReference); \Description -Frees a reference \textsf{ref} which was allocated in the volatile temporary +Frees a reference \textsf{Ref} which was allocated in the volatile temporary memory space. \Notes The freed space can later be reallocated and reused. @@ -3319,10 +3320,10 @@ The freed space can later be reallocated and reused. \begin{procedure}{GetTempAnsiStringReference} \Declaration -procedure GetTempAnsiStringReference(Var Ref : TReference); +Procedure GetTempAnsiStringReference(Var Ref : TReference); \Description -Allocates \textsf{ref }on the volatile memory space and sets the -\textsf{base} to the frame{\_}pointer register and \textsf{offset} to the +Allocates \textsf{Ref} on the volatile memory space and sets the +\textsf{Base} to the Frame{\_}Pointer register and \textsf{Offset} to the correct offset to access this allocated memory space. \Notes The return offset always has the required alignment for the target system. @@ -3332,7 +3333,7 @@ The return offset always has the required alignment for the target system. \begin{function}{GetTempOfSizePersistant} \Declaration -function GetTempOfSizePersistant(Size : Longint) :Longint; +Function GetTempOfSizePersistant(Size : Longint) :Longint; \Description Allocates persistent storage space on the stack. return value is the negative offset from the frame pointer where this memory was allocated. @@ -3342,18 +3343,18 @@ The return offset always has the required alignment for the target system. \begin{function}{UngetPersistantTemp} \Declaration -procedure UngetPersistantTemp(Pos : Longint); +Procedure UnGetPersistantTemp(Pos : Longint); \Description Frees space allocated as being persistent. This persistent space can then -later be used and reallocated. \textsf{pos} is the offset relative to the -frame{\_}pointer of the persistent memory block to free. +later be used and reallocated. \textsf{Pos} is the offset relative to the +Frame{\_}Pointer of the persistent memory block to free. \end{function} \paragraph{utility routines} \begin{procedure}{ResetTempGen} \Declaration -procedure ResetTempGen; +Procedure ResetTempGen; \Description Clear and free the complete linked list of temporary memory locations. The list is set to nil. @@ -3363,10 +3364,10 @@ This routine is called each time a routine has been fully compiled. \begin{procedure}{SetFirstTemp} \Declaration -procedure SetFirstTemp(l : Longint); +Procedure SetFirstTemp(L : Longint); \Description This routine sets the start of the temporary local area (this value is a -negative offset from the frame{\_}pointer, which is located after the local +negative offset from the Frame{\_}Pointer, which is located after the local variables). Usually the start offset is the size of the local variables, modified by any alignment requirements. \Notes @@ -3376,7 +3377,7 @@ start address where to allocate temporary memory space. \begin{function}{GetFirstTempSize} \Declaration -function GetFirstTempSize : longint; +Function GetFirstTempSize : Longint; \Description Returns the total number of bytes allocated for local and temporary allocated stack space. This value is aligned according to the target system @@ -3392,7 +3393,7 @@ the routine being compiled. Procedure NormalTempToPersistant(Pos : Longint); \Description Searches the list of currently temporary memory allocated for the one with -the offset \textsf{pos, }and if found converts this temporary memory space +the offset \textsf{Pos}, and if found converts this temporary memory space as persistent (can never be freed and reallocated). \end{function} @@ -3401,13 +3402,13 @@ as persistent (can never be freed and reallocated). Procedure PersistantTempToNormal(Pos : Longint); \Description Searches the list of currently allocated persistent memory space as the -specified address \textsf{pos }, and if found converts this memory space to +specified address \textsf{Pos}, and if found converts this memory space to normal volatile memory space which can be freed and reused. \end{function} \begin{function}{IsTemp} \Declaration -function IsTemp(const Ref : TReference): boolean; +Function IsTemp(const Ref : TReference): Boolean; \Description Returns TRUE if the reference \textsf{ref }is allocated in temporary volatile memory space, otherwise returns FALSE. @@ -3473,15 +3474,15 @@ might be added as required by the target architecture): \begin{longtable}{|l|p{10cm}|} \hline -Operand type (\textsf{toptype}) & Description \\ +Operand type (\textsf{TOpType}) & Description \\ \hline \endhead \hline \endfoot -\textsf{top{\_}none}& No operand \\ -\textsf{top{\_}reg}& Operand is a register \\ -\textsf{top{\_}ref}& Operand is a reference (\textsf{treference} type) \\ -\textsf{top{\_}symbol}& Operand is a symbol (reference or label) \\ +\textsf{top{\_}None}& No operand \\ +\textsf{top{\_}Reg}& Operand is a register \\ +\textsf{top{\_}Ref}& Operand is a reference (\textsf{treference} type) \\ +\textsf{top{\_}Symbol}& Operand is a symbol (reference or label) \\ \end{longtable} The architecture specific opcodes are done in an enumeration of type @@ -3489,9 +3490,9 @@ The architecture specific opcodes are done in an enumeration of type PowerPC 32-bit architecture is as follows: \begin{lstlisting}{} -type tasmop = (a_add, a_add_, a_addo, a_addo_, a_addc, a_addc_, a_addco, - a_addco_,a_adde, a_adde_, a_addeo, a_addeo_, a_addi, - a_addic, a_addic_, a_addis \ldots +Type TAsmOp = (a_Add, a_Add_, a_Addo, a_Addo_, a_Addc, a_Addc_, a_Addco, + a_Addco_,a_Adde, a_Adde_, a_Addeo, a_Addeo_, a_Addi, + a_Addic, a_Addic_, a_Addis \ldots \end{lstlisting} \subsubsection{Generic instruction generation interface} @@ -3505,10 +3506,10 @@ totally independent of the target system. \begin{procedurel}{Emit\_Load\_Loc\_Reg}{EmitLoadLocReg} \Declaration -Procedure Emit{\_}Load{\_}Loc{\_}Reg(src:tlocation;srcdef:pdef; dstdef : pdef; dst : tregister); +Procedure Emit{\_}Load{\_}Loc{\_}Reg(Src:TLocation;Srcdef:pDef; DstDef : pDef; Dst : TRegister); \Description -Loads an operand from the source location in \textsf{src }into the -destination register \textsf{dst }taking into account the source definition +Loads an operand from the source location in \textsf{Src} into the +destination register \textsf{Dst} taking into account the source definition and destination definition (sign-extension, zero extension depending on the sign and size of the operands). \Notes @@ -3519,7 +3520,7 @@ generic opcode does not work on floating point values, only integer values. \begin{procedure}{FloatLoad} \Declaration -procedure FloatLoad(t : tFloatType;Ref : TReference; Var Location:TLocation); +Procedure FloatLoad(t : tFloatType;Ref : TReference; Var Location:TLocation); \Description This routine is to be called each time a location must be set to LOC{\_}FPU and a value loaded into a FPU register @@ -3531,7 +3532,7 @@ location is set to LOC{\_}FPU. \begin{function}{FloatStore} \Declaration -procedure FloatStore(t : TFloatType;var Location:TLocation; ref:TReference); +Procedure FloatStore(t : TFloatType;Var Location:TLocation; Ref:TReference); \Description This routine is to be called when a value located in LOC{\_}FPU must be stored into memory. @@ -3553,10 +3554,10 @@ register \textsf{rh}. \begin{functionl}{Emit{\_}Lea{\_}Loc{\_}Ref}{emitlealocref} \Declaration -procedure Emit{\_}Lea{\_}Loc{\_}Ref(const t:TLocation;Const Ref:TReference; FreeTemp:Boolean); +Procedure Emit{\_}Lea{\_}Loc{\_}Ref(Const t:TLocation;Const Ref:TReference; FreeTemp:Boolean); \Description Loads the address of the location \textsf{loc }and stores the result into -\textsf{ref} +\textsf{Ref} \Notes The store address \textsf{ref }should point to an allocated area at least \textsf{sizeof(pointer)} bytes, otherwise unexpected code might be @@ -3575,71 +3576,71 @@ ther target register \textsf{reg} \begin{procedure}{GetLabel} \Declaration -procedure GetLabel(var l : pAsmLabel); +Procedure GetLabel(Var l : pAsmLabel); \Description Returns a label associated with code. This label can then be used with the instructions output by the code generator using the instruction generation templates which require labels as parameters. The label itself can be -emitted to the assembler source by calling the \textsf{emitlab} routine. +emitted to the assembler source by calling the \seep{EmitLab} routine. \end{procedure} \begin{procedure}{EmitLab} \Declaration -procedure EmitLab(var l : pasmlabel); +Procedure EmitLab(Var l : pAsmLabel); \Description -Output the label \textsf{l }to the assembler instruction stream. +Output the label \textsf{l} to the assembler instruction stream. \Notes -The label should have been previously allocated with \textsf{getlabel.} The +The label should have been previously allocated with \textsf{GetLabel}, The output label will be of the form label: in the instruction stream. This label is usually a jump target. \end{procedure} \begin{procedure}{EmitLabeled} \Declaration -procedure EmitLabeled(op : tasmop; var l : pasmlabel); +Procedure EmitLabeled(op : TAsmOp; Var l : pAsmLabel); \Description -Output the opcode \textsf{op }with the operand \textsf{l} +Output the opcode \textsf{op} with the operand \textsf{l} which is a previously allocated label. \Notes This routine is used to output jump instructions such as : jmp label, jne label. The label should have been previously allocated with a call to -\textsf{getlabel} - +\textsf{GetLabel} \end{procedure} \paragraph{Other instructions} \begin{function}{EmitCall} \Declaration -procedure EmitCall(const routine:string); +Procedure EmitCall(Const Routine:String); \Description Emit a call instruction to an internal routine \Parameters -routine = The name of the routine to call. +Routine = The name of the routine to call. \end{function} \begin{procedure}{ConcatCopy} \Declaration procedure ConcatCopy(Source,Dest : TReference;Size : Longint;DelSource : Boolean; loadref:boolean); \Description -This routine copies \textsf{size} data from the \textsf{source} reference to the destination \textsf{dest} reference. \\ +This routine copies \textsf{Size} data from the \textsf{Source} reference to +the destination \textsf{Dest} reference. \\ \Parameters -source = Source reference to copy from \par -dest = Depending on the value of loadref, either indicates a location where a -pointer to the data to copy is stored, or this reference directly the address -to copy to. \par -size = Number of bytes to copy \par delsource = TRUE if the source reference -should be freed in this routine \par loadref = TRUE if the source reference -contains a pointer to the address we wish to copy to, otherwise the reference -itself is the destination location to copy to. +Source = Source reference to copy from \par +Dest = Depending on the value of loadref, either indicates a location where a pointer to the data to copy is +Stored, or this reference directly the address to copy to. \par +Size = Number of bytes to copy \par +DelSource = TRUE if the source reference should be freed in this routine \par +LoadRef = TRUE if the source reference contains a pointer to the address we + wish to copy to, otherwise the reference itself is the destination + location to copy to. \end{procedure} \begin{procedurel}{Emit{\_}Flag2Reg}{emitflag2reg} \Declaration -procedure Emit{\_}Flag2Reg(Flag:TResflags;HRegister:TRegister); +Procedure Emit{\_}Flag2Reg(Flag:TResflags;HRegister:TRegister); \Description -Sets the value of the register to 1 if the condition code flag in \textsf{flag} -is TRUE, otherwise sets the register to zero. +Sets the value of the register to 1 if the condition code flag in +\textsf{Flag} is TRUE, otherwise sets the register to zero. \Notes The operand should be zero extended to the natural register size for the target architecture. @@ -3666,12 +3667,13 @@ an instruction, or one of the abstract directives for the assembler. \else \includegraphics[width=5.67in,height=2.17in]{arch11.eps} \fi -\label{fig11} +\label{fig:fig11} \caption{Assembler generation organisation} \end{figure} % FIXME % If I don't do this, the assembler node table has a problem. +% untested for more recent versions (with less floats due to longtable) \clearpage The different possible sections which are output are as follows: @@ -3687,17 +3689,17 @@ Internal section name & Description \\ \endhead \hline \endfoot -exparasmlist & temporary list \\ -datasegment & initialized variables \\ -codesegment & instructions and general code directives \\ -debuglist & debugging information \\ -withdebuglist & ??????????????? \\ -consts & read only constants \\ -importsection & imported symbols \\ -exportsection & exported symbols \\ -resourcesection & Resource data \\ -rttilist & runtime type information data \\ -resourcestringlist& resource string data +ExparAsmList & temporary list \\ +DataSegment & initialized variables \\ +CodeSegment & instructions and general code directives \\ +DebugList & debugging information \\ +WithDebugList & ??????????????? \\ +Consts & read only constants \\ +ImportSection & imported symbols \\ +ExportSection & exported symbols \\ +ResourceSection & Resource data \\ +RttiList & runtime type information data \\ +ResourceStringList& resource string data \end{longtable} The following directives for the abstract assembler currently exist: @@ -3711,65 +3713,65 @@ Node entry Type & Description \\ \endhead \hline \endfoot -ait{\_}none& +Ait{\_}None& This entry in the linked list is invalid (this should normally never occur) \\ -ait{\_}direct& +Ait{\_}Direct& Direct output to the resulting assembler file (as string) \\ -ait{\_}string& +Ait{\_}String& Shortstring with a predefined length \\ -ait{\_}label& +Ait{\_}Label& Numbered assembler label used for jumps \\ -ait{\_}comment& +Ait{\_}Comment& Assembler output comment \\ -ait{\_}instruction& +Ait{\_}Instruction& Processor specific instruction \\ -ait{\_}datablock& +Ait{\_}DataBlock& Unitialized data block (BSS) \\ -ait{\_}symbol& +Ait{\_}Symbol& Entry represents a symbol (exported, imported, or other public symbol type) \newline Possible symbol types : NONE, EXTERNAL, LOCAL and GLOBAL \newline - eg : A symbol followed by an ait{\_}const{\_}32bit \\ -ait{\_}symbol{\_}end & + eg : A symbol followed by an Ait{\_}const{\_}32bit \\ +Ait{\_}Symbol{\_}End & Symbol end (for example the end of a routine) \\ -ait{\_}const{\_}32bit& +Ait{\_}Const{\_}32bit& Initialized 32-bit constant (without a symbol) \\ -ait{\_}const{\_}16bit& +Ait{\_}Const{\_}16bit& Initialized 16-bit constant (without a symbol) \\ -ait{\_}const{\_}8bit& +Ait{\_}Const{\_}8bit& Initialized 8-bit constant (without a symbol) \\ -ait{\_}const{\_}symbol & ???????????? \\ -ait{\_}real{\_}80bit (x86)& +Ait{\_}Const{\_}symbol & ???????????? \\ +Ait{\_}Real{\_}80bit (x86)& Initialized 80-bit floating point constant (without symbol) \\ -ait{\_}real{\_}64bit& +Ait{\_}Real{\_}64bit& Initialized Double IEEE floating point constant (without symbol) \\ -ait{\_}real{\_}32bit& +Ait{\_}Real{\_}32bit& Initialized Single IEEE floating point constant (without symbol) \\ -ait{\_}comp{\_}64bit (x86)& +Ait{\_}Comp{\_}64bit (x86)& Initialized 64-bit floating point integer (without symbol) \\ -ait{\_}align& +Ait{\_}Align& Alignment directive \\ -ait{\_}section& +Ait{\_}Section& Section directive \\ -ait{\_}const{\_}rva (Win32)& \\ -ait{\_}stabn & +Ait{\_}const{\_}rva (Win32)& \\ +Ait{\_}Stabn & stabs debugging information (numerical value) \\ -ait{\_}stabs & +Ait{\_}Stabs & stabs debugging information (string) \\ -ait{\_}force{\_}line& +Ait{\_}Force{\_}Line& stabs debugging line information \\ -ait{\_}stab{\_}function{\_}name& +Ait{\_}Stab{\_}Function{\_}Name& stabs debug information routine name \\ -ait{\_}cut& +Ait{\_}Cut& Cut in the assembler files (used for smartlinking) \\ -ait{\_}regalloc& +Ait{\_}RegAlloc& Debugging information for the register allocator \\ -ait{\_}marker & ???????????? \\ -ait{\_}frame (Alpha)& \\ -ait{\_}ent (Alpha)& \\ -ait{\_}labeled{\_}instruction (m68k)& \\ -ait{\_}dummy & Unused - should never appear +Ait{\_}Marker & ???????????? \\ +Ait{\_}Frame (Alpha)& \\ +Ait{\_}Ent (Alpha)& \\ +Ait{\_}Labeled{\_}Instruction (m68k)& \\ +Ait{\_}Dummy & Unused - should never appear \end{longtable} \section{The Runtime library} @@ -3880,7 +3882,7 @@ operating system: \begin{functionl}{System{\_}Exit}{systemexit} \Declaration -procedure System{\_}Exit; +Procedure System{\_}Exit; \Description This routine is internally called by the system unit when the application exits. @@ -3928,7 +3930,7 @@ GetHeapSize := total size of the initial heap area. \begin{function}{sbrk} \Declaration -Function sbrk(Size : Longint): Longint; +Function SBrk(Size : Longint): Longint; \Description \end{function} @@ -3945,7 +3947,7 @@ This routine should close the specified file. \begin{functionl}{Do{\_}Erase}{doerase} \Declaration -procedure Do{\_}Erase(p: pchar); +Procedure Do{\_}Erase(p: pChar); \Description This erases the file specifed by p. \Parameters @@ -3957,10 +3959,10 @@ The following variables should also be defined for each new operating system, they are used by external units: \noindent -argc : The number of command line arguments of the program +ArgC : The number of command line arguments of the program \noindent -argv : A pointer to each of the command line arguments (an array of pchar +ArgV : A pointer to each of the command line arguments (an array of pchar pointers) \subsection{CPU specific hooks} @@ -3974,7 +3976,7 @@ they are dependent on the processor: \begin{function}{SetJmp} \Declaration -function SetJmp (Var S : Jmp{\_}Buf) : Longint; +Function SetJmp (Var S : Jmp{\_}Buf) : Longint; \Description A call to SetJmp(), saves the calling environment in its \textsf{s} argument for later use by \textsf{longjmp()}. Called by the code generator in @@ -4010,16 +4012,16 @@ accumulator which should be cleared). \begin{procedurel}{Int{\_}StrCopy}{intstrcopy} \Declaration -Procedure Int{\_}StrCopy(len:longint;sstr,dstr:pointer); +Procedure Int{\_}StrCopy(Len:Longint;SStr,DStr:pointer); \Description This routine copies the string pointed to by the address in sstr, to the string pointed in the destination. The old string is overwritten, and the source string will be truncated to make it fit in destination if the length of the source is greater then destination string len (the len parameter). \Parameters -len = maximum length to copy (the destination string length) \par -sstr = pointer to source shortstring \par -dstr = point to destination shortstring +Len = maximum length to copy (the destination string length) \par +SStr = pointer to source shortstring \par +DStr = point to destination shortstring \Notes Called by code generator when a string is assigned to another string. \end{procedurel} @@ -4029,10 +4031,10 @@ Called by code generator when a string is assigned to another string. \begin{functionl}{Int{\_}StrCmp}{intstrcmp} \Declaration -Function Int{\_}StrCmp(dstr,sstr:pointer) : longint; +Function Int{\_}StrCmp(DStr,SStr:Pointer) : Longint; \Description The routine compares two shortstrings, and returns 0 if both are equal, 1 if -\textsf{dest} is greater then \textsf{src}, otherwise it returns --1. +\textsf{DStr} is greater then \textsf{SSrc}, otherwise it returns --1. \Notes Both pointers must point to shortstrings. Length checking must be performed in the routine. @@ -4043,13 +4045,13 @@ in the routine. \begin{procedurel}{Int{\_}StrConcat}{intstrconcat} \Declaration -Procedure Int{\_}StrConcat(src,dest:pointer); +Procedure Int{\_}StrConcat(Src,Dest:Pointer); \Description -This routine appends the string pointed to by \textsf{src} to the end of the -string pointed to by \textsf{dest}. +This routine appends the string pointed to by \textsf{Src} to the end of the +string pointed to by \textsf{Dest}. \Parameters -src = pointer to shortstring to append to dest \par -dest = pointer to shortstring to receive appended string +Src = pointer to shortstring to append to dest \par +Dest = pointer to shortstring to receive appended string \Notes Both pointers must point to shortstrings. In the case where the src string length does not fit in dest, it is truncated. diff --git a/docs/internal/intfpc.sty b/docs/internal/intfpc.sty index 05b65eead9..b956d26f26 100644 --- a/docs/internal/intfpc.sty +++ b/docs/internal/intfpc.sty @@ -64,7 +64,8 @@ \gdef\@thanks{}\gdef\@author{}\gdef\@title{}} % end of \maketitle % For the \procedure and \function commands, we don't want heading numbers. -\setcounter{secnumdepth}{4} +\setcounter{secnumdepth}{2} +\setcounter{tocdepth}{4} % redefine the subsection command to leave less space, %and to use sans serif \renewcommand\subsection{\@startsection% @@ -233,7 +234,8 @@ \usepackage[pdftex,bookmarks=true,colorlinks=true,linkcolor=blue]{hyperref} \usepackage{times} \usepackage[T1]{fontenc} - \setcounter{secnumdepth}{4} + \setcounter{secnumdepth}{2} + \setcounter{tocdepth}{4} \pdfcompresslevel=9 \pdfpagewidth=210mm \pdfpageheight=297mm