mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-19 19:31:04 +00:00
Updated documentation for module intlib
This commit is contained in:
parent
88bd0605bb
commit
3958d4b7c8
@ -3,8 +3,9 @@ abs stdlib Absolute Value Return absolute value of byte.
|
|||||||
adddst stddef Add Destination Add value to Destination Pointer.
|
adddst stddef Add Destination Add value to Destination Pointer.
|
||||||
addsrc stddef Add Source Add value to Source Pointer.
|
addsrc stddef Add Source Add value to Source Pointer.
|
||||||
addzpw stddef Add Zero Page Word Add value to word in zero page
|
addzpw stddef Add Zero Page Word Add value to word in zero page
|
||||||
anykey stdiox Any Key Display "Any Key" prompt and wait for keypress.
|
anykey stdiox Any Key Display "ANY KEY" prompt and wait for keypress.
|
||||||
atoc stdlib ASCII to Character Convert numeric string to byte.
|
atoc stdlib ASCII to Character Convert numeric string to byte.
|
||||||
|
atoi intlib ASCII to Integer Convert string to integer.
|
||||||
blkbgn block Block Begin Set beginning of block address.
|
blkbgn block Block Begin Set beginning of block address.
|
||||||
blkend block Block End Set end of block address.
|
blkend block Block End Set end of block address.
|
||||||
blkseg block Block Segment Set block segment size.
|
blkseg block Block Segment Set block segment size.
|
||||||
@ -49,6 +50,9 @@ getdst stddef Get Destination Get address in Destination Pointer.
|
|||||||
getprc stdiox Get Prompt Character Display prompt and wait for key press.
|
getprc stdiox Get Prompt Character Display prompt and wait for key press.
|
||||||
gets stdio Get String Read string from keyboard.
|
gets stdio Get String Read string from keyboard.
|
||||||
getsrc stddef Get Source Get address in Source Pointer.
|
getsrc stddef Get Source Get address in Source Pointer.
|
||||||
|
iabs intlib Integer Absolute Return absolute value of integer.
|
||||||
|
imax intlib Integer Maximum Return greater of two integers.
|
||||||
|
imin intlib Integer Minimum Return lesser of two integers.
|
||||||
isalnm ctype Is Alphanumeric Return TRUE if character is A-Z, a-z, or 0-9.
|
isalnm ctype Is Alphanumeric Return TRUE if character is A-Z, a-z, or 0-9.
|
||||||
isalph ctype Is Alphabetic Return TRUE if character is A-Z or a-z.
|
isalph ctype Is Alphabetic Return TRUE if character is A-Z or a-z.
|
||||||
isbdgt ctype Is Binary Digit Return TRUE if character is 0 or 1.
|
isbdgt ctype Is Binary Digit Return TRUE if character is 0 or 1.
|
||||||
@ -56,11 +60,14 @@ isctrl ctype is Control Return TRUE if ASCII code is 0-31 or 127
|
|||||||
isdigt ctype Is Digit Return TRUE if character is 0-9.
|
isdigt ctype Is Digit Return TRUE if character is 0-9.
|
||||||
isgrph ctype Is Graphical Return TRUE if ASCII code is 33-126.
|
isgrph ctype Is Graphical Return TRUE if ASCII code is 33-126.
|
||||||
ishdgt ctype Is Hex Digit Return TRUE if character is 0-9, A-F, or a-f.
|
ishdgt ctype Is Hex Digit Return TRUE if character is 0-9, A-F, or a-f.
|
||||||
|
ishftl intlib Integer Shift Left Shift integer left specified number of bits.
|
||||||
|
ishftr intlib Integer Shift Right Shift integer right specified number of bits.
|
||||||
islowr ctype Is Lowercase Return TRUE if character is a-z.
|
islowr ctype Is Lowercase Return TRUE if character is a-z.
|
||||||
ispnct ctype Is Punctuation Return TRUE if Graphical and not Alphanumeric.
|
ispnct ctype Is Punctuation Return TRUE if Graphical and not Alphanumeric.
|
||||||
isprnt ctype Is Printable Return TRUE if ASCII code is 32-126.
|
isprnt ctype Is Printable Return TRUE if ASCII code is 32-126.
|
||||||
isspce ctype Is white Space Return TRUE if ASCII code is 9-13 or 32.
|
isspce ctype Is white Space Return TRUE if ASCII code is 9-13 or 32.
|
||||||
isuppr ctype Is Uppercase Return TRUE if character is A-Z.
|
isuppr ctype Is Uppercase Return TRUE if character is A-Z.
|
||||||
|
itoa intlib Integer to ASCII Convert Integer to String.
|
||||||
joystk joystk Joystick Read Atari style joystick controller status.
|
joystk joystk Joystick Read Atari style joystick controller status.
|
||||||
lgtpen lgtpen Light Pen Read light pen status.
|
lgtpen lgtpen Light Pen Read light pen status.
|
||||||
maddr memio Memory Address Return address contained in memory file pointer.
|
maddr memio Memory Address Return address contained in memory file pointer.
|
||||||
|
74
doc/intlib.txt
Normal file
74
doc/intlib.txt
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
Integer Functions for C02 Programs
|
||||||
|
|
||||||
|
This module contains functions for manipulating and converting
|
||||||
|
integer values.
|
||||||
|
|
||||||
|
At the beginning of the program use the directives
|
||||||
|
|
||||||
|
#include <stddef.h02>
|
||||||
|
#include <intlib.h02>
|
||||||
|
|
||||||
|
The following functions are defined:
|
||||||
|
|
||||||
|
j = iabs(i); Returns the absolute value of the two's-complement
|
||||||
|
integer i.
|
||||||
|
|
||||||
|
In two's-complement arithmetic, the unsigned values
|
||||||
|
0 - 32,767 are considered positive, while the unsigned
|
||||||
|
values 32,768 - 65,535 are considered negative.
|
||||||
|
|
||||||
|
j = atoi(s); Returns the integer numeric value of string s.
|
||||||
|
|
||||||
|
Does not skip leading white-space characters and
|
||||||
|
stops when first non-digit character is encountered.
|
||||||
|
|
||||||
|
Overflows are ignored, so numbers greater than 65,535
|
||||||
|
will be returned modulo 65,536.
|
||||||
|
|
||||||
|
itoa(i); Stores the ASCII representation of unsigned integer
|
||||||
|
i into the destination string.
|
||||||
|
|
||||||
|
The destination string must be dimensioned at least
|
||||||
|
six bytes in length, and is specified by calling
|
||||||
|
setdst().
|
||||||
|
|
||||||
|
Note: Calls cvibcd, then calls upbcdi for each digit
|
||||||
|
to be printed.
|
||||||
|
|
||||||
|
|
||||||
|
j = imax(i); Returns the greater of the unsigned integer b and
|
||||||
|
the unsigned integer in the source pointer.
|
||||||
|
|
||||||
|
Requires a prior call to setsrc() with the integer
|
||||||
|
value to be compared against.
|
||||||
|
|
||||||
|
j = imin(i); Returns the lesser of the unsigned integer b and
|
||||||
|
the unsigned integer in the source pointer.
|
||||||
|
|
||||||
|
Requires a prior call to setsrc() with the integer
|
||||||
|
value to be compared against.
|
||||||
|
|
||||||
|
j = ishftl(n,i) Shifts word b by n bits to the left and returns
|
||||||
|
the result in j. If n is 0, the word is not
|
||||||
|
shifted, and if n greater than 16, the returned
|
||||||
|
value will be 0.
|
||||||
|
|
||||||
|
j = ishftr(n,i) Shifts word b by n bits to the right and returns
|
||||||
|
the result in j. If n is 0, the word is not
|
||||||
|
shifted, and if n greater than 16, the returned
|
||||||
|
value will be 0.
|
||||||
|
|
||||||
|
|
||||||
|
Note: This library expects the following functions to be defined:
|
||||||
|
|
||||||
|
along with the zero page variables
|
||||||
|
|
||||||
|
zpage0,zpage1: Zero page variable pair
|
||||||
|
|
||||||
|
the external variables
|
||||||
|
|
||||||
|
exvar0,exvar1: External variable pair
|
||||||
|
|
||||||
|
and the constants
|
||||||
|
|
||||||
|
#CNSTNAME Constant description
|
Loading…
x
Reference in New Issue
Block a user