1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-28 10:51:14 +00:00
C02/include/intlib.h02
2020-10-06 12:30:20 -04:00

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();