basicio.occ
private declarations
These procedures are used internally.
FUNCTION internal.signOf
BOOL, INT FUNCTION internal.signOf (VAL INT columns)
FUNCTION hexToChar
BYTE FUNCTION hexToChar (VAL INT x)
-
converts a 4-bit number to its hexadecimal representation
in uppercase
FUNCTION hexToCharLC
BYTE FUNCTION hexToCharLC (VAL INT x)
-
converts a 4-bit number to its hexadecimal representation
in lowercase
FUNCTION charToHex
INT FUNCTION charToHex (VAL BYTE char)
-
converts a byte to a 4-bit number, assuming the byte
represents part of a string of bytes representing a
hexadecimal number
FUNCTION charToDec
INT FUNCTION charToDec (VAL BYTE ch)
-
converts a byte to a 4-bit number between 0 and 9, assuming
the byte represents part of a string of bytes representing a
decimal number
streams read procedures
These procedures read numbers or strings from a
CHAN OF BYTE input stream.
ReadLine
PROC ReadLine (CHAN OF BYTE in, []BYTE line)
-
Reads a line from 'in', until a newline or EndStream
is received.
ReadWord
PROC ReadWord (CHAN OF BYTE in, []BYTE word)
-
Reads from 'in'. Leading spaces/newlines/tabs are ignored.
Following bytes are stored in 'word' until another white-space
character is received.
ReadHex
PROC ReadHex (CHAN OF BYTE in, VAL INT width, INT val)
-
Reads a hexadecimal number from 'in'. At most, 'width'
characters are read.
ReadDec
PROC ReadDec (CHAN OF BYTE in, INT number)
-
Reads a decimal number from 'in'.
INT64read
PROC INT64read (CHAN OF BYTE in, INT64 number)
-
Reads an INT64 decimal number from 'in'.
REAL32read
PROC REAL32read (CHAN OF BYTE in, REAL32 r)
-
Reads a REAL32 number from 'in'. Characters are
consumed as per ReadWord. REAL32 format is as per
STRINGTOREAL32.
REAL64read
PROC REAL64read (CHAN OF BYTE in, REAL64 r)
-
Reads a REAL64 number from 'in'. Characters are
consumed as per ReadWord. REAL64 format is as per
STRINGTOREAL64.
streams write procedures
WriteStr
PROC WriteStr (CHAN OF BYTE screen, VAL []BYTE string)
-
Write a nul-terminated string. The following special characters
are treated as defined in the occam reference manual: *n *c
*t *s *' *" ** *#xx.
WriteSpaces
PROC WriteSpaces (CHAN OF BYTE scr, VAL INT W)
WriteStrLJ
PROC WriteStrLJ (CHAN OF BYTE out, VAL []BYTE string, VAL INT n)
-
As per WriteStr but left-justified within a field of 'n'
characters. If 'n' is too small for the string being printed,
the fieldwidth expands to accomodate the extra text.
WriteStrRJ
PROC WriteStrRJ (CHAN OF BYTE out, VAL []BYTE string, VAL INT n)
-
As per WriteStr but right-justified within a field of 'n'
characters. If 'n' is too small for the string being printed,
the fieldwidth expands to accomodate the extra text.
internal.WriteHex32
PROC internal.WriteHex32 (CHAN OF BYTE out, VAL INT32 number, VAL INT columns,
VAL BYTE pad, VAL BOOL toLower)
WriteHex32
PROC WriteHex32 (CHAN OF BYTE out, VAL INT32 number, VAL INT columns,
VAL BYTE pad)
-
Write a number in hexadecimal using uppercase characters.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0'.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
WriteHex32LC
PROC WriteHex32LC (CHAN OF BYTE out, VAL INT32 number, VAL INT columns,
VAL BYTE pad)
-
Write a number in hexadecimal using lowercase characters.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0'.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
internal.WriteHex64
PROC internal.WriteHex64 (CHAN OF BYTE out, VAL INT64 number, VAL INT columns,
VAL BYTE pad, VAL BOOL toLower)
WriteHex64
PROC WriteHex64 (CHAN OF BYTE out, VAL INT64 number, VAL INT columns,
VAL BYTE pad)
-
Write a number in hexadecimal using uppercase characters.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0'.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
WriteHex64LC
PROC WriteHex64LC (CHAN OF BYTE out, VAL INT64 number, VAL INT columns,
VAL BYTE pad)
-
Write a number in hexadecimal using lowercase characters.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0'.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
Writeh
PROC Writeh (CHAN OF BYTE out, VAL INT number)
-
Short form for WriteHex32: free-format with no padding.
WriteDec
internal.WritePadded
PROC internal.WritePadded (CHAN OF BYTE out,
[]BYTE string, INT len,
VAL INT columns,
VAL BYTE pad, sign)
PROC WriteDec (CHAN OF BYTE out, VAL INT number, VAL INT columns,
VAL BYTE pad, sign)
-
Write a number in decimal.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0',
but may be any non-numeric character.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
Writen
PROC Writen (CHAN OF BYTE out, VAL INT number)
-
Short form for WriteDec: free-format with no padding.
WriteINT32
PROC WriteINT32 (CHAN OF BYTE out, VAL INT32 number, VAL INT columns,
VAL BYTE pad, sign)
-
Write a number in decimal.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0',
but may be any non-numeric character.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
WriteINT64
PROC WriteINT64 (CHAN OF BYTE out, VAL INT64 number, VAL INT columns,
VAL BYTE pad, sign)
-
Write a number in decimal.
If fewer digits than columns are to be printed, they will be
padded with the pad character. Typically this will be ' ' or '0',
but may be any non-numeric character.
If columns is negative, the number is left-aligned and spaces
are used to pad out to the right.
WriteREAL32
PROC WriteREAL32 (CHAN OF BYTE out, VAL REAL32 r, VAL INT ip, dp)
-
Writes a REAL32 number, converted using REAL32TOSTRING.
WriteREAL64
PROC WriteREAL64 (CHAN OF BYTE out, VAL REAL64 r, VAL INT ip, dp)
-
Writes a REAL64 number, converted using REAL64TOSTRING.
WriteAscii
PROC WriteAscii (CHAN OF BYTE out, VAL []BYTE string)
-
As per WriteStr but non-printable characters are rendered
textually.
streams basic string handling procedures
upperCase
PROC upperCase (INT ch)
-
Converts a character to uppercase.
asciiRep
PROC asciiRep ([]BYTE chars, INT length, VAL INT c)
-
Converts a character 'c' to a printable representation.
Generated by occam2html.