1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-25 06:31:25 +00:00
C02/include/intlib.h02

117 lines
3.5 KiB
Plaintext

/*********************************************************
* intlib - Standard Library Routines for Integer Values *
*********************************************************/
/* Set Integer Accumlator *
* Args: int w - Integer value *
* Sets: iacc = Argument *
* Returns: int w - Argument */
char iacc();
/* Integer Absolute Value *
* Args: int w - Integer value *
* Sets: iacc = Result *
* Returns: int v - Absolute value of w */
char iabs();
/* Integer Add: g + d *
* Setup: iset(g) - Augend *
* Args: int d - Addend *
* Sets: iacc, iover = Result *
* Returns: char c - Carry *
* int r - Sum */
char iadd();
/* Integer Add Char: c + d *
* Args: char c - Augend *
* int d - Addend *
* Sets: iacc, iover = result *
* Returns: char c - Carry *
* int r - Sum */
char iaddc();
/* ASCII to Integer *
* Convert ASCII string to Unsigned Integer *
* Args: &s - String to Convert *
* Sets: iacc = Result *
* Returns: char n - Number of digits parsed *
* int v - Numeric value of string */
char atoi();
/* Integer to ASCII *
* Convert Unsigned Integer to String *
* Setup: iset(i) - Unsigned Int to Convert *
* Args: &s - Destination String *
* Sets: iacc = Argument *
* Returns: char n - Length of string */
void itoa();
/* Integer unsigned Divide *
* Aetup: iset (n) - Numerator *
* Args: int d - Denominator *
* Sets: iacc = Quotient *
* Returns: int q - Quotient */
char idiv();
/* Integer unsigned Maximum *
* Return Largest of Two Integers *
* Setup: iset(i) - First Integer *
* Args: int j - Second Integer *
* Sets: iacc = Result *
* Returns: int m - Greater of the Two */
char imax();
/* Integer unsigned Minimum *
* Return smallest of Two Integers *
* Setup: setsrc(i) - First Integer *
* Args: int j - Second Integer *
* Sets: iacc = Result *
* Returns: int m - Lesser of the Two */
char imin();
/* Integer unsigned Modulo *
* Aetup: iset(n) - Numerator *
* Args: int d - Denominator *
* Sets: iacc = Result *
* Returns: int q - Modulus */
char idiv();
/* Integer unsigned Multiply: m * r *
* Setup: iset(m) - Muliplicand *
* Args: int r - Multiplier *
* Sets: iacc, iover = 32 bit Product *
* Returns: long p - 24 bit Product */
char imult();
/* Integer Multiply Char: c * r *
* Args: int c - Multplicand
* int r - Multiplier *
* Sets: iacc, iover = 32 bit Product *
* Returns: long p - 24 bit Product */
char imult();
/* Integer Shift Left *
* Args: char n - Number of Bits *
* int w - Value to Shift *
* Sets: iacc = Integer result *
* iover = Integer Overflow *
* Returns: long p - 24 bit Result */
char ishftl();
/* Integer Shift Right *
* Args: char n - Number of Bits *
* int w - Value to Shift *
* Sets: iacc = Integer result *
* iover = Integer Underflow *
* Returns: char u - Underflow Bits *
int r - Shifted Integer */
char ishftr();
/* Integer Subtract: m - s *
* Setup: iaet(m) - Minuend *
* Args: int s - Subtrahend *
* Sets: iacc, iover = result *
* Returns: char c - Carry *
* int d - Difference */
char isub();