### System Functions

This is another unit that is used by the `Expressions`

unit which processes system functions like `Abs`

, `UpCase`

, `Sqr`

, `Succ`

, `Pred`

, etc.

All Turbo Pascal system functions are processed by this procedure. Each system function has a processing procedure and an optional parameter. This parameter is used when two or more functions share the same processing procedure.

This procedure processes system function New. It uses a common procedure for New as function and procedure.

This procedure processes system functions SeekEoln, SeekEof, Eoln for text files and Eof for all files.

This procedure processes system functions FilePos and FileSize. It expects file variable as parameter and generates a call to appropriate compiler function passed as parameter to this procedure.

This procedure processes system function UpCase.

This procedure processes system function Abs. It simply converts negative numbers to positive.

This procedure processes system function Sqr. It generates code to multiply the expression with itself.

This procedure processes system functions Succ and Pred.

This procedure processes system function Odd.

This procedure processes system function Ord. It simply converts expression type to LongInt.

These procedures process system function Ptr, Addr, Seg and Ofs.

This procedure processes system functions CSeg, DSeg, SSeg and SPtr. It generates code to load CPU register to AX and sets expression to LongInt type.

This procedure processes system function SizeOf.

This procedure processes system functions Int, Frac, Sqrt, Sin, Cos, Ln, Exp and ArcTan.

This procedure processes system functions MemAvail and MaxAvail. It generates a call to compiler routine that returns value according to the heap status and sets the expression type to LongInt.

These procedures process system functions Pos, Length, Copy and Concat.

These procedures process system functions IOResult, ParamStr and ParamCount.

This procedure processes system function Random.

These procedures process system functions Lo, Hi, Swap and Pi.

This procedure processes system function TypeOf.