mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-26 13:49:21 +00:00
79 lines
2.4 KiB
Plaintext
79 lines
2.4 KiB
Plaintext
/*********************************************************
|
|
* intlib - Standard Library Routines for Integer Values *
|
|
*********************************************************/
|
|
|
|
/* Integer Absolute Value *
|
|
* Args: int w - Integer to test *
|
|
* Returns: int v -Absolute value of w */
|
|
char iabs();
|
|
|
|
/* Integer Add *
|
|
* Setup: setsrc(g) - Augend *
|
|
* Args: int d - Addend *
|
|
* Returns: char c - Carry *
|
|
* int r - Sum */
|
|
char iadd();
|
|
|
|
/* ASCII to Integer *
|
|
* Convert ASCII string to Unsigned Integer *
|
|
* Args: &s - String to Convert *
|
|
* Returns: char n - Number of digits parsed *
|
|
* int v - Numeric value of string */
|
|
char atoi();
|
|
|
|
/* Integer to ASCII *
|
|
* Convert Unsigned Integer to String *
|
|
* Setup: setdst(s) - Destination String *
|
|
* Args: int w - Unsigned Int to Convert *
|
|
* Returns: char n - Length of string */
|
|
void itoa();
|
|
|
|
/* Integer Divide *
|
|
* Divide Unsigned Integers *
|
|
* Aetup: setdst(n) - Numerator *
|
|
* Args: int d - Denominator *
|
|
* Returns: int q - Quotient */
|
|
char idiv();
|
|
|
|
/* Integer Maximum *
|
|
* Return Largest of Two Integers *
|
|
* Requires: setsrc(i) - First Integer *
|
|
* Args: int j - Second Integer *
|
|
* Returns: int m - Greater of the Two */
|
|
char imax();
|
|
|
|
/* Integer Minimum *
|
|
* Return smallest of Two Integers *
|
|
* Requires: setsrc(i) - First Integer *
|
|
* Args: int j - Second Integer *
|
|
* Returns: int m - Lesser of the Two */
|
|
char imin();
|
|
|
|
/* Integer Multiply *
|
|
* Multiply Unsigned Integers *
|
|
* Requires: setdst(m) - Muliplicand *
|
|
* Args: int r - Multiplier *
|
|
* Returns: long p - Product */
|
|
char imult();
|
|
|
|
/* Integer Left Shift *
|
|
* Args: char n - Number of Bits *
|
|
* int w - Value to Shift *
|
|
* Returns: char v - Overflow Bits *
|
|
int r - Shifted Integer */
|
|
char ishftl();
|
|
|
|
/* Integer Shift Right *
|
|
* Args: char n - Number of Bits *
|
|
* int w - Value to Shift *
|
|
* Returns: char v - Overflow Bits *
|
|
int r - Shifted Integer */
|
|
char ishftr();
|
|
|
|
/* Integer Subtract *
|
|
* Requires: setsrc(m) - Minuend *
|
|
* Args: int s - Subtrahend *
|
|
* Returns: char c - Carry *
|
|
* int d - Difference */
|
|
char isub();
|