1 <!doctype linuxdoc system>
4 <title>cc65 function reference
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
9 cc65 is a C compiler for 6502 based systems. This function reference describes
10 the available C functions supplied by the library.
13 <!-- Table of contents -->
16 <!-- Begin the document -->
20 cc65 is a C compiler for 6502 based systems. It implements a subset of the ISO
21 C standard plus additional functions specially crafted for 6502 systems or
22 just some of the supported machines. This function refrence describes the
23 available functions together with any limitations.
25 For an overview about the available libraries, their purpose, and any
26 differences to the ISO standard, please have a look at the <htmlurl
27 url="library.html" name="cc65 Library Overview">.
29 <bf/Note:/ Standard C functions are listed here, but not described in detail.
30 Since these functions behave identical on all standard compliant systems, they
31 are described in any book covering standard C.
33 Each entry for a function contains a detailed description
37 <tag/Function/Summary of what <bf/function/ does.
38 <tag/Header/The header file that contains the declaration.
39 <tag/Declaration/Describes the needed header files and declaration of the
41 <tag/Description/Description of the function.
43 <tag/Availability/The availability of the function.
44 <tag/See also/Other related functions.
45 <tag/Example/A piece of actual code using the function.
50 <sect>Functions by header file<p>
52 <sect1><tt/6502.h/<label id="6502.h"><p>
55 <item><ref id="BRK" name="BRK">
56 <item><ref id="CLI" name="CLI">
57 <item><ref id="SEI" name="SEI">
58 <item><ref id="_sys" name="_sys">
59 <item><ref id="getcpu" name="getcpu">
60 <!-- <item><ref id="reset_brk" name="reset_brk"> -->
61 <!-- <item><ref id="set_brk" name="set_brk"> -->
65 <sect1><tt/assert.h/<label id="assert.h"><p>
68 <item><ref id="assert" name="assert">
72 <sect1><tt/c128.h/<label id="c128.h"><p>
75 <item><ref id="c64mode" name="c64mode">
76 <item><ref id="fast" name="fast">
77 <item><ref id="toggle_videomode" name="toggle_videomode">
78 <item><ref id="slow" name="slow">
82 <sect1><tt/conio.h/<label id="conio.h"><p>
85 <item><ref id="bgcolor" name="bgcolor">
86 <item><ref id="bordercolor" name="bordercolor">
87 <item><ref id="cclear" name="cclear">
88 <item><ref id="cclearxy" name="cclearxy">
89 <item><ref id="cgetc" name="cgetc">
90 <item><ref id="chline" name="chline">
91 <item><ref id="chlinexy" name="chlinexy">
92 <item><ref id="clrscr" name="clrscr">
93 <!-- <item><ref id="cprintf" name="cprintf"> -->
94 <!-- <item><ref id="cputc" name="cputc"> -->
95 <!-- <item><ref id="cputcxy" name="cputcxy"> -->
96 <!-- <item><ref id="cputs" name="cputs"> -->
97 <!-- <item><ref id="cputsxy" name="cputsxy"> -->
98 <item><ref id="cursor" name="cursor">
99 <item><ref id="cvline" name="cvline">
100 <item><ref id="cvlinexy" name="cvlinexy">
101 <item><ref id="gotox" name="gotox">
102 <item><ref id="gotoxy" name="gotoxy">
103 <item><ref id="gotoy" name="gotoy">
104 <item><ref id="kbhit" name="kbhit">
105 <item><ref id="revers" name="revers">
106 <item><ref id="screensize" name="screensize">
107 <item><ref id="textcolor" name="textcolor">
108 <!-- <item><ref id="vcprintf" name="vcprintf"> -->
109 <item><ref id="wherex" name="wherex">
110 <item><ref id="wherey" name="wherey">
114 <sect1><tt/ctype.h/<label id="ctype.h"><p>
117 <item><ref id="isalnum" name="isalnum">
118 <item><ref id="isalpha" name="isalpha">
119 <item><ref id="isascii" name="isascii">
120 <item><ref id="isblank" name="isblank">
121 <item><ref id="iscntrl" name="iscntrl">
122 <item><ref id="isdigit" name="isdigit">
123 <item><ref id="isgraph" name="isgraph">
124 <item><ref id="islower" name="islower">
125 <item><ref id="isprint" name="isprint">
126 <item><ref id="ispunct" name="ispunct">
127 <item><ref id="isspace" name="isspace">
128 <item><ref id="isupper" name="isupper">
129 <item><ref id="isxdigit" name="isxdigit">
130 <item><ref id="tolower" name="tolower">
131 <item><ref id="toupper" name="toupper">
135 <sect1><tt/em.h/<label id="em.h"><p>
138 <item><ref id="em_commit" name="em_commit">
139 <item><ref id="em_copyfrom" name="em_copyfrom">
140 <item><ref id="em_copyto" name="em_copyto">
141 <item><ref id="em_load_driver" name="em_load_driver">
142 <item><ref id="em_map" name="em_map">
143 <item><ref id="em_pagecount" name="em_pagecount">
144 <item><ref id="em_unload" name="em_unload">
145 <item><ref id="em_use" name="em_use">
149 <sect1><tt/signal.h/<label id="signal.h"><p>
152 <item><ref id="raise" name="raise">
153 <item><ref id="signal" name="signal">
157 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
160 <item><ref id="_heapadd" name="_heapadd">
161 <item><ref id="_heapmaxavail" name="_heapmaxavail">
162 <item><ref id="_heapmemavail" name="_heapmemavail">
163 <item><ref id="_randomize" name="_randomize">
164 <!-- <item><ref id="_swap" name="_swap"> -->
165 <item><ref id="abort" name="abort">
166 <item><ref id="abs" name="abs">
167 <item><ref id="atexit" name="atexit">
168 <!-- <item><ref id="atoi" name="atoi"> -->
169 <!-- <item><ref id="atol" name="atol"> -->
170 <!-- <item><ref id="bsearch" name="bsearch"> -->
171 <item><ref id="calloc" name="calloc">
172 <!-- <item><ref id="div" name="div"> -->
173 <item><ref id="exit" name="exit">
174 <item><ref id="free" name="free">
175 <!-- <item><ref id="getenv" name="getenv"> -->
176 <!-- <item><ref id="itoa" name="itoa"> -->
177 <item><ref id="labs" name="labs">
178 <!-- <item><ref id="ltoa" name="ltoa"> -->
179 <item><ref id="malloc" name="malloc">
180 <!-- <item><ref id="qsort" name="qsort"> -->
181 <item><ref id="rand" name="rand">
182 <item><ref id="realloc" name="realloc">
183 <item><ref id="srand" name="srand">
184 <!-- <item><ref id="ultoa" name="ultoa"> -->
185 <!-- <item><ref id="utoa" name="utoa"> -->
189 <sect1><tt/string.h/<label id="string.h"><p>
192 <!-- <item><ref id="_stroserror" name="_stroserror"> -->
193 <!-- <item><ref id="bzero" name="bzero"> -->
194 <!-- <item><ref id="memchr" name="memchr"> -->
195 <!-- <item><ref id="memcpy" name="memcpy"> -->
196 <!-- <item><ref id="memmove" name="memmove"> -->
197 <!-- <item><ref id="memset" name="memset"> -->
198 <!-- <item><ref id="strcasecmp" name="strcasecmp"> -->
199 <item><ref id="strcat" name="strcat">
200 <item><ref id="strchr" name="strchr">
201 <!-- <item><ref id="strcmp" name="strcmp"> -->
202 <!-- <item><ref id="strcoll" name="strcoll"> -->
203 <item><ref id="strcpy" name="strcpy">
204 <!-- <item><ref id="strcspn" name="strcspn"> -->
205 <!-- <item><ref id="strdup" name="strdup"> -->
206 <!-- <item><ref id="strerror" name="strerror"> -->
207 <!-- <item><ref id="stricmp" name="stricmp"> -->
208 <item><ref id="strlen" name="strlen">
209 <item><ref id="strlower" name="strlower">
210 <item><ref id="strlwr" name="strlwr">
211 <!-- <item><ref id="strncat" name="strncat"> -->
212 <!-- <item><ref id="strncmp" name="strncmp"> -->
213 <item><ref id="strncpy" name="strncpy">
214 <item><ref id="strrchr" name="strrchr">
215 <!-- <item><ref id="strspn" name="strspn"> -->
216 <!-- <item><ref id="strstr" name="strstr"> -->
217 <!-- <item><ref id="strtok" name="strtok"> -->
218 <!-- <item><ref id="strxfrm" name="strxfrm"> -->
219 <item><ref id="strupper" name="strupper">
220 <item><ref id="strupr" name="strupr">
226 <sect>Alphabetical function reference<p>
228 <sect1>_heapadd<label id="_heapadd"><p>
232 <tag/Function/Add a block to the heap.
233 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
234 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
235 <tag/Description/The function adds a block of raw memory to the heap.
238 <item>The minimum blocksize that can be added is 6 bytes; the function will
239 ignore blocks with smaller sizes.
241 <tag/Availability/cc65
243 <ref id="_heapmaxavail" name="_heapmaxavail">,
244 <ref id="_heapmemavail" name="_heapmemavail">,
245 <ref id="calloc" name="calloc">,
246 <ref id="free" name="free">,
247 <ref id="malloc" name="malloc">,
248 <ref id="realloc" name="realloc">
254 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
258 <tag/Function/Return the largest block that is available on the heap.
259 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
260 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
261 <tag/Description/The function returns the size of the largest block that may
262 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
263 <tag/Availability/cc65
265 <ref id="_heapadd" name="_heapadd">,
266 <ref id="_heapmemavail" name="_heapmemavail">,
267 <ref id="calloc" name="calloc">,
268 <ref id="free" name="free">,
269 <ref id="malloc" name="malloc">,
270 <ref id="realloc" name="realloc">
276 <sect1>_heapmemavail<label id="_heapmemavail"><p>
280 <tag/Function/Return the total available space on the heap.
281 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
282 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
283 <tag/Description/The function returns the total number of bytes available on
287 <item>This function is of less use than usually assumed, since the returned
288 heap space may be available but not in one block. So even if this function
289 says that several times more heap space is available than needed, <ref
290 id="malloc" name="malloc"> may still return <tt/NULL/.
292 <tag/Availability/cc65
294 <ref id="_heapadd" name="_heapadd">,
295 <ref id="_heapmaxavail" name="_heapmaxavail">,
296 <ref id="calloc" name="calloc">,
297 <ref id="free" name="free">,
298 <ref id="malloc" name="malloc">,
299 <ref id="realloc" name="realloc">
305 <sect1>_randomize<label id="_randomize"><p>
309 <tag/Function/Initialize the pseudo random number generator.
310 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
311 <tag/Declaration/<tt/void _randomize (void);/
312 <tag/Description/The function initializes the random number generator with
313 a seed derived from fast changing hardware events, so the seed itself can be
314 considered random to a certain degree.
315 <tag/Limits/<itemize>
316 <item>The randomness of the seed depends on the machine hardware.
318 <tag/Availability/cc65
320 <ref id="rand" name="rand">,
321 <ref id="srand" name="srand">
327 <sect1>_sys<label id="_sys"><p>
331 <tag/Function/Call a subroutine passing register values.
332 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
333 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
334 <tag/Description/The function will call the subroutine at the address
335 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
336 registers and the CPU flags are set to the values given in the <tt/regs/
337 structure. On return from the subroutine, the new values of the registers and
338 flags are stored back overwriting the old values.
339 <tag/Limits/<itemize>
340 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
341 when calling the subroutine (they are unchanged from their current values).
342 <item>The function is only available as fastcall function, so it may only be
343 used in presence of a prototype.
345 <tag/Availability/cc65
351 <sect1>BRK<label id="BRK"><p>
355 <tag/Function/Insert a 6502 BRK instrunction into the code.
356 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
357 <tag/Declaration/<tt/void BRK (void);/
358 <tag/Description/The function will insert a 6502 BRK instruction into the code
359 which may be used to trigger a debugger.
360 <tag/Limits/<itemize>
361 <item>The function is actually a macro.
362 <item>The inserted instruction may lead to unexpected results if no debugger
365 <tag/Availability/cc65
367 <ref id="CLI" name="CLI">,
368 <ref id="SEI" name="SEI">
374 <sect1>CLI<label id="CLI"><p>
378 <tag/Function/Insert a 6502 CLI instrunction into the code.
379 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
380 <tag/Declaration/<tt/void CLI (void);/
381 <tag/Description/The function will insert a 6502 CLI instruction into the code,
382 so interrupts are disabled. Note that non maskable interrupts cannot be
384 <tag/Limits/<itemize>
385 <item>The function is actually a macro.
386 <item>Disabling interrupts may lead to unexpected results.
388 <tag/Availability/cc65
390 <ref id="BRK" name="BRK">,
391 <ref id="SEI" name="SEI">
397 <sect1>SEI<label id="SEI"><p>
401 <tag/Function/Insert a 6502 SEI instrunction into the code.
402 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
403 <tag/Declaration/<tt/void SEI (void);/
404 <tag/Description/The function will insert a 6502 SEI instruction into the code,
405 so interrupts are enabled. Enabling interrupts has no effects if they are
406 already enabled (the default).
407 <tag/Limits/<itemize>
408 <item>The function is actually a macro.
410 <tag/Availability/cc65
412 <ref id="BRK" name="BRK">,
413 <ref id="CLI" name="CLI">
419 <sect1>abort<label id="abort"><p>
423 <tag/Function/Terminates a program abnormally.
424 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
425 <tag/Declaration/<tt/void abort (void);/
426 <tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message
427 on stderr, then terminates the program with an exit code of 3.
428 <tag/Availability/ISO 9899
430 <ref id="assert" name="assert">,
431 <ref id="exit" name="exit">,
432 <ref id="raise" name="raise">
438 <sect1>abs<label id="abs"><p>
442 <tag/Function/Returns the absolute value of an integer.
443 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
444 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
445 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
447 <tag/Limits/<itemize>
448 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
449 <item>The function is only available as fastcall function, so it may only be
450 used in presence of a prototype.
452 <tag/Availability/ISO 9899
454 <ref id="labs" name="labs">
460 <sect1>assert<label id="assert"><p>
464 <tag/Function/Test a condition and possibly abort.
465 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
466 <tag/Declaration/<tt/void assert (int cond);/
467 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
468 statement. If the condition evaluates t zero (false), assert prints a message
469 on stderr and aborts the program.
470 <tag/Limits/<itemize>
471 <item>The function is actually a macro.
473 <tag/Availability/ISO 9899
475 <ref id="abort" name="abort">,
476 <ref id="exit" name="exit">
482 <sect1>atexit<label id="atexit"><p>
486 <tag/Function/Register an exit function.
487 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
488 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
489 <tag/Description/<tt/atexit/ registers the function pointed to by
490 <tt/exitfunc/ as an exit function. Exit functions are called when the program
491 terminates, they are called in LIFO order (the last function registered is
492 called first). <tt/atexit/ returns zero on success and a nonzero value on
494 <tag/Limits/<itemize>
495 <item>A maximum of 5 exit functions can be registered.
496 <item>There is no way to unregister an exit function.
497 <item>The function is only available as fastcall function, so it may only be
498 used in presence of a prototype.
500 <tag/Availability/ISO 9899
502 <ref id="abort" name="abort">,
503 <ref id="exit" name="exit">
509 <sect1>bgcolor<label id="bgcolor"><p>
513 <tag/Function/Set the background text color.
514 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
515 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
516 <tag/Description/The function will set a new background text color. It returns
517 the old (current) background color.
518 <tag/Limits/<itemize>
519 <item>Background colors are system dependent. The function may have no effect
520 on systems where the background color cannot be changed.
521 <item>The function is only available as fastcall function, so it may only be
522 used in presence of a prototype.
524 <tag/Availability/cc65
526 <ref id="bordercolor" name="bordercolor">,
527 <ref id="textcolor" name="textcolor">
533 <sect1>bordercolor<label id="bordercolor"><p>
537 <tag/Function/Set the border (frame) color.
538 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
539 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
540 <tag/Description/The function will set a new border color. It returns the old
541 (current) border color.
542 <tag/Limits/<itemize>
543 <item>Border colors are system dependent. The function may have no effect
544 on systems where the border color cannot be changed.
545 <item>The function is only available as fastcall function, so it may only
546 be used in presence of a prototype.
548 <tag/Availability/cc65
550 <ref id="bgcolor" name="bgcolor">,
551 <ref id="textcolor" name="textcolor">
557 <sect1>c64mode<label id="c64mode"><p>
561 <tag/Function/Switch the C128 into C64 compatible mode.
562 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
563 <tag/Declaration/<tt/void c64mode (void);/
564 <tag/Description/The function will cause the machine to reboot into C64 mode.
565 <tag/Limits/<itemize>
566 <item>The function is specific to the C128.
567 <item>The function will not return to the caller.
569 <tag/Availability/C128
575 <sect1>calloc<label id="calloc"><p>
579 <tag/Function/Allocate and clear memory.
580 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
581 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
582 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
583 of size <tt/size/, clears the whole block with binary zeroes and returns a
584 pointer to it. On error (not enough memory available), <tt/calloc/ returns
588 <item>Clearing the memory may not have the expected effect on all platforms:
589 pointers in the block may not be <tt/NULL/ and floating point variables may
590 not be zero (0.0). In other words: The "clearing" effect of this function
591 should be used with care for portable programs.
592 <item>The function is only available as fastcall function, so it may only
593 be used in presence of a prototype.
595 <tag/Availability/ISO 9899
597 <ref id="_heapadd" name="_heapadd">,
598 <ref id="_heapmaxavail" name="_heapmaxavail">,
599 <ref id="_heapmemavail" name="_heapmemavail">,
600 <ref id="free" name="free">,
601 <ref id="malloc" name="malloc">,
602 <ref id="realloc" name="realloc">
608 <sect1>cclear<label id="cclear"><p>
612 <tag/Function/Clear part of a line (write a given amount of spaces).
613 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
614 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
615 <tag/Description/The function clears part of a line by writing <tt/length/
616 spaces in the current text color.
617 <tag/Limits/<itemize>
618 <item>The function is only available as fastcall function, so it may
619 only be used in presence of a prototype.
621 <tag/Availability/cc65
623 <ref id="cclearxy" name="cclearxy">,
624 <ref id="clrscr" name="clrscr">
630 <sect1>cclearxy<label id="cclearxy"><p>
634 <tag/Function/Clear part of a line (write a given amount of spaces) starting
635 at a specific screen position.
636 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
637 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
638 <tag/Description/The function moves the cursor to a specific position, and
639 will then clear part of the line by writing <tt/length/ spaces in the current
641 <tag/Limits/<itemize>
642 <item>The function is only available as fastcall function, so it may
643 only be used in presence of a prototype.
645 <tag/Availability/cc65
647 <ref id="cclear" name="cclear">,
648 <ref id="clrscr" name="clrscr">
654 <sect1>cgetc<label id="cgetc"><p>
658 <tag/Function/Read a character from the keyboard.
659 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
660 <tag/Declaration/<tt/char cgetc (void);/
661 <tag/Description/The function reads a character from the keyboard. If there is
662 no character available, <tt/cgetc/ waits until the user presses a key. If the
663 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
664 displayed while waiting.
665 <tag/Limits/<itemize>
666 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
667 from this buffer and wait only if the buffer is empty.
669 <tag/Availability/cc65
671 <ref id="cursor" name="cursor">,
672 <ref id="kbhit" name="kbhit">
678 <sect1>chline<label id="chline"><p>
682 <tag/Function/Output a horizontal line in text mode.
683 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
684 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
685 <tag/Description/The function outputs a horizontal line with the given length
686 starting at the current cursor position.
687 <tag/Limits/<itemize>
688 <item>The character used to draw the horizontal line is system dependent.
689 If available, a line drawing character is used. Drawing a line that is partially
690 off screen leads to undefined behaviour.
691 <item>The function is only available as fastcall function, so it may only be
692 used in presence of a prototype.
694 <tag/Availability/cc65
696 <ref id="chlinexy" name="chlinexy">,
697 <ref id="cvline" name="cvline">,
698 <ref id="cvlinexy" name="cvlinexy">
704 <sect1>chlinexy<label id="chlinexy"><p>
708 <tag/Function/Output a horizontal line at a given position in text mode.
709 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
710 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
711 <tag/Description/The function outputs a horizontal line with the given length
712 starting at a given position.
713 <tag/Limits/<itemize>
714 <item>The character used to draw the horizontal line is system dependent.
715 If available, a line drawing character is used. Drawing a line that is partially
716 off screen leads to undefined behaviour.
717 <item>The function is only available as fastcall function, so it may only be
718 used in presence of a prototype.
720 <tag/Availability/cc65
722 <ref id="chline" name="chline">,
723 <ref id="cvline" name="cvline">,
724 <ref id="cvlinexy" name="cvlinexy">
730 <sect1>clrscr<label id="clrscr"><p>
734 <tag/Function/Clear the text screen.
735 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
736 <tag/Declaration/<tt/void clrscr (void);/
737 <tag/Description/The function clears the text screen and moves the cursor to
738 the upper left corner.
739 <tag/Availability/cc65
741 <ref id="cclear" name="cclear">,
742 <ref id="cclearxy" name="cclearxy">
748 <sect1>cursor<label id="cursor"><p>
752 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
753 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
754 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
755 <tag/Description/If the argument to the function is non zero, a blinking cursor
756 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
757 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
758 <tag/Limits/<itemize>
759 <item>The function is only available as fastcall function, so it may only
760 be used in presence of a prototype.
762 <tag/Availability/cc65
764 <ref id="cgetc" name="cgetc">,
765 <ref id="kbhit" name="kbhit">
771 <sect1>cvline<label id="cvline"><p>
775 <tag/Function/Output a vertical line in text mode.
776 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
777 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
778 <tag/Description/The function outputs a vertical line with the given length
779 starting at the current cursor position.
780 <tag/Limits/<itemize>
781 <item>The character used to draw the vertical line is system dependent.
782 If available, a line drawing character is used. Drawing a line that is partially
783 off screen leads to undefined behaviour.
784 <item>The function is only available as fastcall function, so it may only be
785 used in presence of a prototype.
787 <tag/Availability/cc65
789 <ref id="chline" name="chline">,
790 <ref id="chlinexy" name="chlinexy">,
791 <ref id="cvlinexy" name="cvlinexy">
797 <sect1>cvlinexy<label id="cvlinexy"><p>
801 <tag/Function/Output a vertical line at a given position in text mode.
802 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
803 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
804 <tag/Description/The function outputs a vertical line with the given length
805 starting at a given position.
806 <tag/Limits/<itemize>
807 <item>The character used to draw the vertical line is system dependent.
808 If available, a line drawing character is used. Drawing a line that is partially
809 off screen leads to undefined behaviour.
810 <item>The function is only available as fastcall function, so it may only be
811 used in presence of a prototype.
813 <tag/Availability/cc65
815 <ref id="chline" name="chline">,
816 <ref id="chlinexy" name="chlinexy">,
817 <ref id="cvline" name="cvline">
823 <sect1>em_commit<label id="em_commit"><p>
827 <tag/Function/Commit changes into extended memory.
828 <tag/Header/<tt/<ref id="em.h" name="em.h">/
829 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
830 <tag/Description/Commit changes in the memory window to extended storage. If
831 the contents of the memory window have been changed, these changes may be lost
832 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
833 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
834 name="em_copyto">/ are called without calling <tt/em_commit/ first.
835 <tag/Limits/<itemize>
836 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
837 memory window are discarded, it does just mean that the drivers is allowed
839 <item>The function is only available as fastcall function, so it may only be
840 used in presence of a prototype.
841 <item>The function produces undefined results if no extended memory driver is
844 <tag/Availability/cc65
846 <ref id="em_load_driver" name="em_load_driver">,
847 <ref id="em_map" name="em_map">,
848 <ref id="em_use" name="em_use">
854 <sect1>em_copyfrom<label id="em_copyfrom"><p>
858 <tag/Function/Copy from extended into normal memory.
859 <tag/Header/<tt/<ref id="em.h" name="em.h">/
860 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
861 <tag/Description/Copy data from extended memory into linear memory. Source and
862 target addresses as well as the number of bytes to transfer are specified in
863 the <tt/em_copy/ structure that is passed as a parameter.
864 <tag/Limits/<itemize>
865 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
866 made any changes to the data in the window, call <tt/<ref id="em_commit"
867 name="em_commit">/ first, or the changes are lost.
868 <item>The function is only available as fastcall function, so it may only be
869 used in presence of a prototype.
870 <item>The function produces undefined results if no extended memory driver is
873 <tag/Availability/cc65
875 <ref id="em_commit" name="em_commit">,
876 <ref id="em_copyto" name="em_copyto">,
877 <ref id="em_load_driver" name="em_load_driver">
883 <sect1>em_copyto<label id="em_copyto"><p>
887 <tag/Function/Copy from normal into extended memory.
888 <tag/Header/<tt/<ref id="em.h" name="em.h">/
889 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
890 <tag/Description/Copy data from linear into extended memory. Source and
891 target addresses as well as the number of bytes to transfer are specified in
892 the <tt/em_copy/ structure that is passed as a parameter.
893 <tag/Limits/<itemize>
894 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
895 made any changes to the data in the window, call <tt/<ref id="em_commit"
896 name="em_commit">/ first, or the changes are lost.
897 <item>The function is only available as fastcall function, so it may only be
898 used in presence of a prototype.
899 <item>The function produces undefined results if no extended memory driver is
902 <tag/Availability/cc65
904 <ref id="em_commit" name="em_commit">,
905 <ref id="em_copyfrom" name="em_copyfrom">,
906 <ref id="em_load_driver" name="em_load_driver">
912 <sect1>em_load_driver<label id="em_load_driver"><p>
916 <tag/Function/Load and initialize an extended memory driver.
917 <tag/Header/<tt/<ref id="em.h" name="em.h">/
918 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
919 <tag/Description/Load an extended memory driver into memory and initialize
920 it. The function returns an error code that tells if all this has been
922 <tag/Limits/<itemize>
923 <item>Not all drivers are able to detect if the supported hardware is really
925 <item>The function is only available as fastcall function, so it may only be
926 used in presence of a prototype.
927 <item>The driver is loaded by name, so currently you must know the type of
928 extended memory that should be supported. There is no autodetect capability.
930 <tag/Availability/cc65
932 <ref id="em_unload" name="em_unload">
938 <sect1>em_map<label id="em_map"><p>
942 <tag/Function/Make a page of extended memory accessible.
943 <tag/Header/<tt/<ref id="em.h" name="em.h">/
944 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
945 <tag/Description/The function maps one page of extended memory into linear
946 memory and returns a pointer to the page frame. Depending on the hardware
947 and driver, the data is either mapped into the address space or transfered
948 into a buffer. If you don't need the actual contents of the page (for example
949 because you're going to overwrite it completely, it is better to call
950 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
951 data if it is possible to avoid that.
952 <tag/Limits/<itemize>
953 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
954 made any changes to the data in the window, call <tt/<ref id="em_commit"
955 name="em_commit">/ first, or the changes are lost.
956 <item>The function is only available as fastcall function, so it may only be
957 used in presence of a prototype.
958 <item>The function produces undefined results if no extended memory driver is
961 <tag/Availability/cc65
963 <ref id="em_commit" name="em_commit">,
964 <ref id="em_load_driver" name="em_load_driver">,
965 <ref id="em_use" name="em_use">
971 <sect1>em_pagecount<label id="em_pagecount"><p>
975 <tag/Function/Return the number of available extended memory pages.
976 <tag/Header/<tt/<ref id="em.h" name="em.h">/
977 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
978 <tag/Description/The function returns the size of the extended memory supported
979 by the driver in 256 byte pages.
980 <tag/Limits/<itemize>
981 <item>The function returns zero if no extended memory driver is loaded.
982 <item>The function may return zero if the supported hardware was not detected.
984 <tag/Availability/cc65
986 <ref id="em_load_driver" name="em_load_driver">
992 <sect1>em_unload<label id="em_unload"><p>
996 <tag/Function/Unload an extended memory driver.
997 <tag/Header/<tt/<ref id="em.h" name="em.h">/
998 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
999 <tag/Description/The function unloads a loaded extended memory driver and
1000 frees all memory allocated for the driver.
1001 <tag/Limits/<itemize>
1002 <item>The function does nothing if no driver is loaded.
1004 <tag/Availability/cc65
1006 <ref id="em_load_driver" name="em_load_driver">
1012 <sect1>em_use<label id="em_use"><p>
1016 <tag/Function/Prepare an extended memory page for use.
1017 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1018 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1019 <tag/Description/The function maps one page of extended memory into linear
1020 memory and returns a pointer to the page frame. This function is similar to
1021 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1022 actual memory window in the assumption that the existing data is wrong or
1023 will get overwritten.
1024 <tag/Limits/<itemize>
1025 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1026 made any changes to the data in the window, call <tt/<ref id="em_commit"
1027 name="em_commit">/ first, or the changes are lost.
1028 <item>The function is only available as fastcall function, so it may only be
1029 used in presence of a prototype.
1030 <item>The function produces undefined results if no extended memory driver is
1033 <tag/Availability/cc65
1035 <ref id="em_commit" name="em_commit">,
1036 <ref id="em_load_driver" name="em_load_driver">,
1037 <ref id="em_map" name="em_map">
1043 <sect1>exit<label id="exit"><p>
1047 <tag/Function/Terminate the program.
1048 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1049 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1050 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1051 return code of the program. Before termination, all files are closed, buffered
1052 output is written and any functions registered with <tt/<ref id="atexit"
1053 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1054 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1056 <tag/Limits/<itemize>
1057 <item>The function is only available as fastcall function, so it may only
1058 be used in presence of a prototype.
1059 <item>It depends on the host machine if the program return code can be
1060 evaluated or is ignored.
1062 <tag/Availability/ISO 9899
1064 <ref id="abort" name="abort">,
1065 <ref id="exit" name="exit">
1071 <sect1>fast<label id="fast"><p>
1075 <tag/Function/Switch the C128 into 2MHz mode.
1076 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1077 <tag/Declaration/<tt/void fast (void);/
1078 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1079 will nearly double the speed compared to slow mode.
1080 <tag/Limits/<itemize>
1081 <item>The function is specific to the C128.
1082 <item>2MHz clock will not work in 40 column mode.
1084 <tag/Availability/C128
1086 <ref id="slow" name="slow">,
1087 <ref id="toggle_videomode" name="toggle_videomode">
1093 <sect1>free<label id="free"><p>
1097 <tag/Function/Free a block of dynamic memory.
1098 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1099 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
1100 <tag/Description/Free a block of dynamic memory previously allocated with
1101 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
1102 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
1103 pointer is <tt/NULL/, no action is performed.
1106 <item>Passing an already free'd block to <tt/free/ again will cause undefined
1107 behaviour and may crash your program.
1108 <item>The function is only available as fastcall function, so it may only
1109 be used in presence of a prototype.
1111 <tag/Availability/ISO 9899
1113 <ref id="_heapadd" name="_heapadd">,
1114 <ref id="_heapmaxavail" name="_heapmaxavail">,
1115 <ref id="_heapmemavail" name="_heapmemavail">,
1116 <ref id="calloc" name="calloc">,
1117 <ref id="malloc" name="malloc">,
1118 <ref id="realloc" name="realloc">
1124 <sect1>getcpu<label id="getcpu"><p>
1128 <tag/Function/Determine on which CPU the program is running.
1129 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
1130 <tag/Declaration/<tt/unsigned char getcpu (void);/
1131 <tag/Description/The function checks on which CPU the code is running. It
1132 returns one of the constants<itemize>
1134 <item><tt/CPU_65C02/
1135 <item><tt/CPU_65816/
1137 <tag/Limits/<itemize>
1138 <item>Other, more exotic CPU types are not disinguished.
1140 <tag/Availability/cc65
1146 <sect1>gotox<label id="gotox"><p>
1150 <tag/Function/Move the text mode cursor to a new X position.
1151 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1152 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
1153 <tag/Description/The function moves the text mode cursor to the specified X
1154 position while leaving the Y position untouched. The leftmost position on the
1155 screen has the coordinate 0.
1156 <tag/Limits/<itemize>
1157 <item>The function is only available as fastcall function, so it may
1158 only be used in presence of a prototype.
1159 <item>Invalid values for the X position (out of screen coordinates) may
1160 lead to undefined behaviour.
1162 <tag/Availability/cc65
1164 <ref id="gotoy" name="gotoy">,
1165 <ref id="gotoxy" name="gotoxy">,
1166 <ref id="wherex" name="wherex">,
1167 <ref id="wherey" name="wherey">
1173 <sect1>gotoxy<label id="gotoxy"><p>
1177 <tag/Function/Move the text mode cursor to a new position.
1178 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1179 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
1180 <tag/Description/The function moves the text mode cursor to the specified
1181 position. The leftmost position on the screen has the X coordinate 0, the
1182 topmost line has the Y coordinate 0.
1183 <tag/Limits/<itemize>
1184 <item>The function is only available as fastcall function, so it may only be
1185 used in presence of a prototype.
1186 <item>Invalid values for any of both coordinates (out of screen positions) may
1187 lead to undefined behaviour.
1189 <tag/Availability/cc65
1191 <ref id="gotox" name="gotox">,
1192 <ref id="gotoy" name="gotoy">,
1193 <ref id="wherex" name="wherex">,
1194 <ref id="wherey" name="wherey">
1200 <sect1>gotoy<label id="gotoy"><p>
1204 <tag/Function/Move the text mode cursor to a new Y position.
1205 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1206 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
1207 <tag/Description/The function moves the text mode cursor to the specified Y
1208 position while leaving the X position untouched. The uppermost position on the
1209 screen has the coordinate 0.
1210 <tag/Limits/<itemize>
1211 <item>The function is only available as fastcall function, so it may
1212 only be used in presence of a prototype.
1213 <item>Invalid values for the Y position (out of screen coordinates) may lead
1214 to undefined behaviour.
1216 <tag/Availability/cc65
1218 <ref id="gotox" name="gotox">,
1219 <ref id="gotoxy" name="gotoxy">,
1220 <ref id="wherex" name="wherex">,
1221 <ref id="wherey" name="wherey">
1227 <sect1>isalnum<label id="isalnum"><p>
1231 <tag/Function/Check if a given character is a letter or digit.
1232 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1233 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
1234 <tag/Description/The function returns a value of zero if the given argument
1235 is a letter or digit. The return value is non zero if the character
1237 <tag/Limits/<itemize>
1238 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1239 inline sequence generated by the macro will not work correctly for values
1240 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1241 this range. The non inline function may be accessed by <tt/#undef/'ing
1243 <item>When compiling without <tt/-Os/, the function is only available as
1244 fastcall function, so it may only be used in presence of a prototype.
1246 <tag/Availability/ISO 9899
1248 <ref id="isalpha" name="isalpha">,
1249 <ref id="isascii" name="isascii">,
1250 <ref id="isblank" name="isblank">,
1251 <ref id="iscntrl" name="iscntrl">,
1252 <ref id="isdigit" name="isdigit">,
1253 <ref id="isgraph" name="isgraph">,
1254 <ref id="islower" name="islower">,
1255 <ref id="isprint" name="isprint">,
1256 <ref id="ispunct" name="ispunct">,
1257 <ref id="isspace" name="isspace">,
1258 <ref id="isupper" name="isupper">,
1259 <ref id="isxdigit" name="isxdigit">
1265 <sect1>isalpha<label id="isalpha"><p>
1269 <tag/Function/Check if a given character is a letter.
1270 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1271 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
1272 <tag/Description/The function returns a value of zero if the given argument
1273 is a letter. The return value is non zero if the character is anything else.
1274 <tag/Limits/<itemize>
1275 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1276 inline sequence generated by the macro will not work correctly for values
1277 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1278 this range. The non inline function may be accessed by <tt/#undef/'ing the
1280 <item>When compiling without <tt/-Os/, the function is only available as
1281 fastcall function, so it may only be used in presence of a prototype.
1283 <tag/Availability/ISO 9899
1285 <ref id="isalnum" name="isalnum">,
1286 <ref id="isascii" name="isascii">,
1287 <ref id="isblank" name="isblank">,
1288 <ref id="iscntrl" name="iscntrl">,
1289 <ref id="isdigit" name="isdigit">,
1290 <ref id="isgraph" name="isgraph">,
1291 <ref id="islower" name="islower">,
1292 <ref id="isprint" name="isprint">,
1293 <ref id="ispunct" name="ispunct">,
1294 <ref id="isspace" name="isspace">,
1295 <ref id="isupper" name="isupper">,
1296 <ref id="isxdigit" name="isxdigit">
1302 <sect1>isascii<label id="isascii"><p>
1306 <tag/Function/Check if a given character is in the ASCII (0..127) range.
1307 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1308 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
1309 <tag/Description/The function returns a value of zero if the given argument
1310 is in the range 0..127 (the range of valid ASCII characters) and a non zero
1312 <tag/Limits/<itemize>
1313 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1314 inline sequence generated by the macro will not work correctly for values
1315 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1316 this range. The non inline function may be accessed by <tt/#undef/'ing the
1318 <item>When compiling without <tt/-Os/, the function is only available as
1319 fastcall function, so it may only be used in presence of a prototype.
1321 <tag/Availability/ISO 9899
1323 <ref id="isalnum" name="isalnum">,
1324 <ref id="isalpha" name="isalpha">,
1325 <ref id="isblank" name="isblank">,
1326 <ref id="iscntrl" name="iscntrl">,
1327 <ref id="isdigit" name="isdigit">,
1328 <ref id="isgraph" name="isgraph">,
1329 <ref id="islower" name="islower">,
1330 <ref id="isprint" name="isprint">,
1331 <ref id="ispunct" name="ispunct">,
1332 <ref id="isspace" name="isspace">,
1333 <ref id="isupper" name="isupper">,
1334 <ref id="isxdigit" name="isxdigit">
1340 <sect1>isblank<label id="isblank"><p>
1344 <tag/Function/Check if a given character is a space or tab.
1345 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1346 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1347 <tag/Description/The function returns a value of zero if the given argument
1348 is a blank or space character. The return value is non zero if the character
1350 <tag/Limits/<itemize>
1351 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1352 inline sequence generated by the macro will not work correctly for values
1353 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1354 this range. The non inline function may be accessed by <tt/#undef/'ing the
1356 <item>When compiling without <tt/-Os/, the function is only available as
1357 fastcall function, so it may only be used in presence of a prototype.
1359 <tag/Availability/cc65
1361 <ref id="isalnum" name="isalnum">,
1362 <ref id="isalpha" name="isalpha">,
1363 <ref id="isascii" name="isascii">,
1364 <ref id="iscntrl" name="iscntrl">,
1365 <ref id="isdigit" name="isdigit">,
1366 <ref id="isgraph" name="isgraph">,
1367 <ref id="islower" name="islower">,
1368 <ref id="isprint" name="isprint">,
1369 <ref id="ispunct" name="ispunct">,
1370 <ref id="isspace" name="isspace">,
1371 <ref id="isupper" name="isupper">,
1372 <ref id="isxdigit" name="isxdigit">
1378 <sect1>iscntrl<label id="iscntrl"><p>
1382 <tag/Function/Check if a given character is a control character.
1383 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1384 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1385 <tag/Description/The function returns a value of zero if the given argument
1386 is a control character. The return value is non zero if the character
1388 <tag/Limits/<itemize>
1389 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1390 inline sequence generated by the macro will not work correctly for values
1391 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1392 this range. The non inline function may be accessed by <tt/#undef/'ing the
1394 <item>When compiling without <tt/-Os/, the function is only available as
1395 fastcall function, so it may only be used in presence of a prototype.
1397 <tag/Availability/ISO 9899
1399 <ref id="isalnum" name="isalnum">,
1400 <ref id="isalpha" name="isalpha">,
1401 <ref id="isascii" name="isascii">,
1402 <ref id="isblank" name="isblank">,
1403 <ref id="isdigit" name="isdigit">,
1404 <ref id="isgraph" name="isgraph">,
1405 <ref id="islower" name="islower">,
1406 <ref id="isprint" name="isprint">,
1407 <ref id="ispunct" name="ispunct">,
1408 <ref id="isspace" name="isspace">,
1409 <ref id="isupper" name="isupper">,
1410 <ref id="isxdigit" name="isxdigit">
1416 <sect1>isdigit<label id="isdigit"><p>
1420 <tag/Function/Check if a given character is a digit.
1421 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1422 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1423 <tag/Description/The function returns a value of zero if the given argument
1424 is a digit. The return value is non zero if the character is anything else.
1425 <tag/Limits/<itemize>
1426 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1427 inline sequence generated by the macro will not work correctly for values
1428 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1429 this range. The non inline function may be accessed by <tt/#undef/'ing the
1431 <item>When compiling without <tt/-Os/, the function is only available as
1432 fastcall function, so it may only be used in presence of a prototype.
1434 <tag/Availability/ISO 9899
1436 <ref id="isalnum" name="isalnum">,
1437 <ref id="isalpha" name="isalpha">,
1438 <ref id="isascii" name="isascii">,
1439 <ref id="isblank" name="isblank">,
1440 <ref id="iscntrl" name="iscntrl">,
1441 <ref id="isgraph" name="isgraph">,
1442 <ref id="islower" name="islower">,
1443 <ref id="isprint" name="isprint">,
1444 <ref id="ispunct" name="ispunct">,
1445 <ref id="isspace" name="isspace">,
1446 <ref id="isupper" name="isupper">,
1447 <ref id="isxdigit" name="isxdigit">
1453 <sect1>isgraph<label id="isgraph"><p>
1457 <tag/Function/Check if a given character is a printable character (except
1459 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1460 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1461 <tag/Description/The function returns a value of zero if the given argument
1462 is a printable character with the exception of space. The return value is non
1463 zero if the character is anything else.
1464 <tag/Limits/<itemize>
1465 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1466 inline sequence generated by the macro will not work correctly for values
1467 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1468 this range. The non inline function may be accessed by <tt/#undef/'ing the
1470 <item>When compiling without <tt/-Os/, the function is only available as
1471 fastcall function, so it may only be used in presence of a prototype.
1473 <tag/Availability/ISO 9899
1475 <ref id="isalnum" name="isalnum">,
1476 <ref id="isalpha" name="isalpha">,
1477 <ref id="isascii" name="isascii">,
1478 <ref id="isblank" name="isblank">,
1479 <ref id="iscntrl" name="iscntrl">,
1480 <ref id="isdigit" name="isdigit">,
1481 <ref id="islower" name="islower">,
1482 <ref id="isprint" name="isprint">,
1483 <ref id="ispunct" name="ispunct">,
1484 <ref id="isspace" name="isspace">,
1485 <ref id="isupper" name="isupper">,
1486 <ref id="isxdigit" name="isxdigit">
1492 <sect1>islower<label id="islower"><p>
1496 <tag/Function/Check if a given character is a lower case letter.
1497 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1498 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1499 <tag/Description/The function returns a value of zero if the given argument
1500 is a lower case letter. The return value is non zero if the character is
1502 <tag/Limits/<itemize>
1503 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1504 inline sequence generated by the macro will not work correctly for values
1505 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1506 this range. The non inline function may be accessed by <tt/#undef/'ing the
1508 <item>When compiling without <tt/-Os/, the function is only available as
1509 fastcall function, so it may only be used in presence of a prototype.
1511 <tag/Availability/ISO 9899
1513 <ref id="isalnum" name="isalnum">,
1514 <ref id="isalpha" name="isalpha">,
1515 <ref id="isascii" name="isascii">,
1516 <ref id="isblank" name="isblank">,
1517 <ref id="iscntrl" name="iscntrl">,
1518 <ref id="isdigit" name="isdigit">,
1519 <ref id="isgraph" name="isgraph">,
1520 <ref id="isprint" name="isprint">,
1521 <ref id="ispunct" name="ispunct">,
1522 <ref id="isspace" name="isspace">,
1523 <ref id="isupper" name="isupper">,
1524 <ref id="isxdigit" name="isxdigit">
1530 <sect1>isprint<label id="isprint"><p>
1534 <tag/Function/Check if a given character is a printable character.
1535 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1536 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1537 <tag/Description/The function returns a value of zero if the given argument
1538 is a printable character (this includes the space character). The return value
1539 is non zero if the character is anything else.
1540 <tag/Limits/<itemize>
1541 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1542 inline sequence generated by the macro will not work correctly for values
1543 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1544 this range. The non inline function may be accessed by <tt/#undef/'ing the
1546 <item>When compiling without <tt/-Os/, the function is only available as
1547 fastcall function, so it may only be used in presence of a prototype.
1549 <tag/Availability/ISO 9899
1551 <ref id="isalnum" name="isalnum">,
1552 <ref id="isalpha" name="isalpha">,
1553 <ref id="isascii" name="isascii">,
1554 <ref id="isblank" name="isblank">,
1555 <ref id="iscntrl" name="iscntrl">,
1556 <ref id="isdigit" name="isdigit">,
1557 <ref id="isgraph" name="isgraph">,
1558 <ref id="islower" name="islower">,
1559 <ref id="ispunct" name="ispunct">,
1560 <ref id="isspace" name="isspace">,
1561 <ref id="isupper" name="isupper">,
1562 <ref id="isxdigit" name="isxdigit">
1568 <sect1>ispunct<label id="ispunct"><p>
1572 <tag/Function/Check if a given character is a printable character but not a
1573 space or an alphanumeric character.
1574 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1575 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
1576 <tag/Description/The function returns a value of zero if the given argument
1577 is a printable character, but not a space or anything alphanumeric. The return
1578 value is non zero if the character is anything else.
1579 <tag/Limits/<itemize>
1580 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1581 inline sequence generated by the macro will not work correctly for values
1582 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1583 this range. The non inline function may be accessed by <tt/#undef/'ing the
1585 <item>When compiling without <tt/-Os/, the function is only available as
1586 fastcall function, so it may only be used in presence of a prototype.
1588 <tag/Availability/ISO 9899
1590 <ref id="isalnum" name="isalnum">,
1591 <ref id="isalpha" name="isalpha">,
1592 <ref id="isascii" name="isascii">,
1593 <ref id="isblank" name="isblank">,
1594 <ref id="iscntrl" name="iscntrl">,
1595 <ref id="isdigit" name="isdigit">,
1596 <ref id="isgraph" name="isgraph">,
1597 <ref id="islower" name="islower">,
1598 <ref id="isprint" name="isprint">,
1599 <ref id="isspace" name="isspace">,
1600 <ref id="isupper" name="isupper">,
1601 <ref id="isxdigit" name="isxdigit">
1607 <sect1>isspace<label id="isspace"><p>
1611 <tag/Function/Check if a given character is a a white-space character.
1612 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1613 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
1614 <tag/Description/The function returns a value of zero if the given argument
1615 is a white space character. The return value is non zero if the character is
1616 anything else. The standard white space characters are: space, formfeed ('\f'),
1617 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
1619 <tag/Limits/<itemize>
1620 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1621 inline sequence generated by the macro will not work correctly for values
1622 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1623 this range. The non inline function may be accessed by <tt/#undef/'ing the
1625 <item>When compiling without <tt/-Os/, the function is only available as
1626 fastcall function, so it may only be used in presence of a prototype.
1628 <tag/Availability/ISO 9899
1630 <ref id="isalnum" name="isalnum">,
1631 <ref id="isalpha" name="isalpha">,
1632 <ref id="isascii" name="isascii">,
1633 <ref id="isblank" name="isblank">,
1634 <ref id="iscntrl" name="iscntrl">,
1635 <ref id="isdigit" name="isdigit">,
1636 <ref id="isgraph" name="isgraph">,
1637 <ref id="islower" name="islower">,
1638 <ref id="isprint" name="isprint">,
1639 <ref id="ispunct" name="ispunct">,
1640 <ref id="isupper" name="isupper">,
1641 <ref id="isxdigit" name="isxdigit">
1647 <sect1>isupper<label id="isupper"><p>
1651 <tag/Function/Check if a given character is an upper case letter.
1652 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1653 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
1654 <tag/Description/The function returns a value of zero if the given argument
1655 is an upper case letter. The return value is non zero if the character is
1657 <tag/Limits/<itemize>
1658 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1659 inline sequence generated by the macro will not work correctly for values
1660 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1661 this range. The non inline function may be accessed by <tt/#undef/'ing the
1663 <item>When compiling without <tt/-Os/, the function is only available as
1664 fastcall function, so it may only be used in presence of a prototype.
1666 <tag/Availability/ISO 9899
1668 <ref id="isalnum" name="isalnum">,
1669 <ref id="isalpha" name="isalpha">,
1670 <ref id="isascii" name="isascii">,
1671 <ref id="isblank" name="isblank">,
1672 <ref id="iscntrl" name="iscntrl">,
1673 <ref id="isdigit" name="isdigit">,
1674 <ref id="isgraph" name="isgraph">,
1675 <ref id="islower" name="islower">,
1676 <ref id="isprint" name="isprint">,
1677 <ref id="ispunct" name="ispunct">,
1678 <ref id="isspace" name="isspace">,
1679 <ref id="isxdigit" name="isxdigit">
1685 <sect1>isxdigit<label id="isxdigit"><p>
1689 <tag/Function/Check if a given character is a hexadecimal digit.
1690 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1691 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
1692 <tag/Description/The function returns a value of zero if the given argument
1693 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
1694 if the character is anything else.
1695 <tag/Limits/<itemize>
1696 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1697 inline sequence generated by the macro will not work correctly for values
1698 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1699 this range. The non inline function may be accessed by <tt/#undef/'ing the
1701 <item>When compiling without <tt/-Os/, the function is only available as
1702 fastcall function, so it may only be used in presence of a prototype.
1704 <tag/Availability/ISO 9899
1706 <ref id="isalnum" name="isalnum">,
1707 <ref id="isalpha" name="isalpha">,
1708 <ref id="isascii" name="isascii">,
1709 <ref id="isblank" name="isblank">,
1710 <ref id="iscntrl" name="iscntrl">,
1711 <ref id="isdigit" name="isdigit">,
1712 <ref id="isgraph" name="isgraph">,
1713 <ref id="islower" name="islower">,
1714 <ref id="isprint" name="isprint">,
1715 <ref id="ispunct" name="ispunct">,
1716 <ref id="isspace" name="isspace">,
1717 <ref id="isupper" name="isupper">
1723 <sect1>kbhit<label id="kbhit"><p>
1727 <tag/Function/Check if there's a key waiting in the keyboard buffer.
1728 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1729 <tag/Declaration/<tt/unsigned char kbhit (void);/
1730 <tag/Description/The function returns a value of zero if there is no character
1731 waiting to be read from the keyboard. It returns non zero otherwise.
1732 <tag/Limits/<itemize>
1733 <item>If the system does not support a keyboard buffer (most systems
1734 do), the function is rather useless.
1736 <tag/Availability/cc65
1738 <ref id="cgetc" name="cgetc">,
1739 <ref id="cursor" name="cursor">
1745 <sect1>labs<label id="labs"><p>
1749 <tag/Function/Returns the absolute value of a long integer.
1750 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1751 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
1752 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
1754 <tag/Limits/<itemize>
1755 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
1756 <item>The function is only available as fastcall function, so it may only be
1757 used in presence of a prototype.
1759 <tag/Availability/ISO 9899
1761 <ref id="abs" name="abs">
1767 <sect1>malloc<label id="malloc"><p>
1771 <tag/Function/Allocate dynamic memory.
1772 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1773 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
1774 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
1775 pointer to the allocated memory block. On error (not enough memory available),
1776 <tt/malloc/ returns <tt/NULL/.
1779 <item>The function is only available as fastcall function, so it may only
1780 be used in presence of a prototype.
1782 <tag/Availability/ISO 9899
1784 <ref id="_heapadd" name="_heapadd">,
1785 <ref id="_heapmaxavail" name="_heapmaxavail">,
1786 <ref id="_heapmemavail" name="_heapmemavail">,
1787 <ref id="calloc" name="calloc">,
1788 <ref id="free" name="free">,
1789 <ref id="realloc" name="realloc">
1795 <sect1>raise<label id="raise"><p>
1799 <tag/Function/Send a signal to the executing program.
1800 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
1801 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
1802 <tag/Description/<tt/raise/ sends the given signal to the program. If the
1803 program has installed a signal handler for the signal, this signal handler
1804 will be executed. If no handler has been installed, the default action for
1805 the raised signal will be taken. The function returns zero on success,
1807 <tag/Limits/<itemize>
1808 <item>The function is only available as fastcall function, so it may only
1809 be used in presence of a prototype.
1811 <tag/Availability/ISO 9899
1813 <ref id="abort" name="abort">,
1814 <ref id="signal" name="signal">
1820 <sect1>rand<label id="rand"><p>
1824 <tag/Function/Return a pseudo random number.
1825 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1826 <tag/Declaration/<tt/int rand (void);/
1827 <tag/Description/The function returns a pseudo random number
1828 between 0 and <tt/RAND_MAX/ (exclusive).
1829 <tag/Limits/<itemize>
1830 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
1831 flow of numbers is generated.
1832 <item>On startup, the function behaves as if <ref id="srand" name="srand">
1833 had been used with an argument of 1.
1835 <tag/Availability/ISO 9899
1837 <ref id="_randomize" name="_randomize">,
1838 <ref id="srand" name="srand">
1844 <sect1>realloc<label id="realloc"><p>
1848 <tag/Function/Change the size of an allocated memory block.
1849 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1850 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
1851 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
1852 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
1853 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
1854 behaves as if <tt/free/ had been called. On error (not enough memory
1855 available), <tt/realloc/ returns <tt/NULL/.
1858 <item>The part of the memory block that is returned will have its contents
1860 <item>This function is somewhat dangerous to use. Be careful to save the
1861 pointer you're passing somewhere else, otherwise
1863 ptr = realloc (ptr, size);
1865 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
1866 <item>The function is only available as fastcall function, so it may only
1867 be used in presence of a prototype.
1869 <tag/Availability/ISO 9899
1871 <ref id="_heapadd" name="_heapadd">,
1872 <ref id="_heapmaxavail" name="_heapmaxavail">,
1873 <ref id="_heapmemavail" name="_heapmemavail">,
1874 <ref id="calloc" name="calloc">,
1875 <ref id="free" name="free">,
1876 <ref id="realloc" name="realloc">
1882 <sect1>revers<label id="revers"><p>
1886 <tag/Function/Control revers character display.
1887 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1888 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
1889 <tag/Description/If the argument is non zero, the function enables reverse
1890 character display. If the argument is zero, reverse character display is
1891 switched off. The old value of the setting is returned.
1892 <tag/Limits/<itemize>
1893 <item>The function may not be supported by the hardware, in which case
1894 the call is ignored.
1895 <item>The function is only available as fastcall function, so it may only
1896 be used in presence of a prototype.
1898 <tag/Availability/cc65
1900 <ref id="textcolor" name="textcolor">
1906 <sect1>screensize<label id="screensize"><p>
1910 <tag/Function/Return the dimensions of the text mode screen.
1911 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1912 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
1913 <tag/Description/The function returns the dimensions of the text mode screen.
1914 <tag/Limits/<itemize>
1915 <item>The function is only available as fastcall function, so it may only
1916 be used in presence of a prototype.
1918 <tag/Availability/cc65
1920 <ref id="gotox" name="gotox">,
1921 <ref id="gotoxy" name="gotoxy">,
1922 <ref id="gotoy" name="gotoy">,
1923 <ref id="wherex" name="wherex">,
1924 <ref id="wherey" name="wherey">
1930 <sect1>signal<label id="signal"><p>
1934 <tag/Function/Install a signal handler.
1935 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
1936 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
1937 <tag/Description/<tt/signal/ installs a handler for the given signal. The
1938 handler may either be a user supplied function, or one of the predefined
1939 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
1940 previous value if the signal , or the special function vector SIG_ERR in
1942 <tag/Limits/<itemize>
1943 <item>The function is only available as fastcall function, so it may only
1944 be used in presence of a prototype.
1946 <tag/Availability/ISO 9899
1948 <ref id="abort" name="abort">,
1949 <ref id="raise" name="raise">
1955 <sect1>slow<label id="slow"><p>
1959 <tag/Function/Switch the C128 into 1MHz mode.
1960 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1961 <tag/Declaration/<tt/void slow (void);/
1962 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
1963 will halve the speed compared to fast mode.
1964 <tag/Limits/<itemize>
1965 <item>The function is specific to the C128.
1967 <tag/Availability/C128
1969 <ref id="fast" name="fast">,
1970 <ref id="toggle_videomode" name="toggle_videomode">
1976 <sect1>srand<label id="srand"><p>
1980 <tag/Function/Initialize the pseudo random number generator.
1981 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1982 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
1983 <tag/Description/The function initializes the random number generator using
1984 the given seed. On program startup, the generator behaves as if <tt/srand/ has
1985 been called with an argument of 1.
1986 <tag/Limits/<itemize>
1987 <item>The function is only available as fastcall function, so it may only
1988 be used in presence of a prototype.
1990 <tag/Availability/ISO 9899
1992 <ref id="_randomize" name="_randomize">,
1993 <ref id="rand" name="rand">
1999 <sect1>strcat<label id="strcat"><p>
2003 <tag/Function/Concatentate two strings.
2004 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2005 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
2006 <tag/Description/The <tt/strcat/ function appends a copy of the string
2007 pointed to by s2 (including the terminating null byte) to the end of the
2008 string pointed to by s1. The initial byte of s2 overwrites the null byte at
2010 <tag/Limits/<itemize>
2011 <item>The function is only available as fastcall function, so it may only
2012 be used in presence of a prototype.
2013 <item>If copying takes place between objects that overlap, the behavior
2016 <tag/Availability/ISO 9899
2018 <ref id="strcpy" name="strcpy">
2019 <ref id="strncpy" name="strncpy">
2025 <sect1>strchr<label id="strchr"><p>
2029 <tag/Function/Search for a character in a string.
2030 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2031 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
2032 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
2033 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2034 byte is considered to be part of the string. Upon completion, the function
2035 returns a pointer to the byte, or a null pointer if the byte was not found.
2036 <tag/Limits/<itemize>
2037 <item>The function is only available as fastcall function, so it may only
2038 be used in presence of a prototype.
2040 <tag/Availability/ISO 9899
2042 <ref id="strrchr" name="strrchr">
2048 <sect1>strcpy<label id="strcpy"><p>
2052 <tag/Function/Copy a string.
2053 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2054 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
2055 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
2056 <tt/s2/ (including the terminating null byte) into the array pointed to by
2057 <tt/s1/. The function will always return <tt/s1/.
2058 <tag/Limits/<itemize>
2059 <item>The function is only available as fastcall function, so it may only
2060 be used in presence of a prototype.
2061 <item>If copying takes place between objects that overlap, the behavior
2064 <tag/Availability/ISO 9899
2066 <ref id="strcat" name="strcat">
2067 <ref id="strncpy" name="strncpy">
2072 static char hello[14];
2074 strcpy (hello, "Hello world!\n");
2080 <sect1>strlen<label id="strlen"><p>
2084 <tag/Function/Return the length of a string.
2085 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2086 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
2087 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
2088 string to which s points, not including the terminating null byte.
2089 <tag/Limits/<itemize>
2090 <item>The function is only available as fastcall function, so it may only
2091 be used in presence of a prototype.
2092 <item>When compiling with <tt/-Os/ (inline known standard functions), the
2093 function does not work correctly for strings with more than 255 characters.
2095 <tag/Availability/ISO 9899
2097 <ref id="strcpy" name="strcpy">
2103 <sect1>strlower<label id="strlower"><p>
2107 <tag/Function/Make a string lower case.
2108 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2109 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
2110 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
2111 function to each character of a string. The function will always return <tt/s/.
2112 <tag/Limits/<itemize>
2113 <item>The function is only available as fastcall function, so it may only
2114 be used in presence of a prototype.
2115 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2116 <item>An alias name for this function is <tt/strlwr/.
2118 <tag/Availability/cc65
2120 <ref id="strupper" name="strupper">
2121 <ref id="tolower" name="tolower">
2127 <sect1>strlwr<label id="strlwr"><p>
2134 <sect1>strncpy<label id="strncpy"><p>
2138 <tag/Function/Copy part of a string.
2139 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2140 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
2141 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
2142 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
2143 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
2144 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
2145 written. The function will always return <tt/s1/.
2146 <tag/Limits/<itemize>
2147 <item>The function is only available as fastcall function, so it may only
2148 be used in presence of a prototype. If there is no null byte in the first <tt/n/
2149 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
2150 <item>If copying takes place between objects that overlap, the behavior is
2153 <tag/Availability/ISO 9899
2155 <ref id="strcat" name="strcat">
2156 <ref id="strcpy" name="strcpy">
2161 static char hello[6];
2163 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
2170 <sect1>strrchr<label id="strrchr"><p>
2174 <tag/Function/Search for a character in a string.
2175 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2176 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
2177 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
2178 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2179 byte is considered to be part of the string. Upon completion, the function
2180 returns a pointer to the byte, or a null pointer if the byte was not found.
2181 <tag/Limits/<itemize>
2182 <item>The function is only available as fastcall function, so it may only
2183 be used in presence of a prototype.
2185 <tag/Availability/ISO 9899
2187 <ref id="strchr" name="strchr">
2193 <sect1>strupper<label id="strupper"><p>
2197 <tag/Function/Make a string upper case.
2198 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2199 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
2200 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
2201 function to each character of a string. The function will always return <tt/s/.
2202 <tag/Limits/<itemize>
2203 <item>The function is only available as fastcall function, so it may only
2204 be used in presence of a prototype.
2205 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2206 <item>An alias name for this function is <tt/strupr/.
2208 <tag/Availability/cc65
2210 <ref id="strlower" name="strlower">
2211 <ref id="toupper" name="toupper">
2217 <sect1>strupr<label id="strupr"><p>
2224 <sect1>textcolor<label id="textcolor"><p>
2228 <tag/Function/Set the text color.
2229 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2230 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
2231 <tag/Description/The function will set a new text color. It returns the old
2232 (current) text color. Text output using any <tt/conio.h/ function will use
2233 the color set by this function.
2234 <tag/Limits/<itemize>
2235 <item>Text colors are system dependent. The function may have no effect
2236 on systems where the text color cannot be changed.
2237 <item>The function is only available as fastcall function, so it may only
2238 be used in presence of a prototype.
2240 <tag/Availability/cc65
2242 <ref id="bgcolor" name="bgcolor">,
2243 <ref id="bordercolor" name="bordercolor">
2249 <sect1>toggle_videomode<label id="toggle_videomode"><p>
2253 <tag/Function/Toggle between 40 and 80 column mode.
2254 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2255 <tag/Declaration/<tt/void toggle_videomode (void);/
2256 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
2257 old mode (cursor position, color and so on) are saved and restored together
2259 <tag/Limits/<itemize>
2260 <item>The function is specific to the C128.
2262 <tag/Availability/C128
2264 <ref id="fast" name="fast">,
2265 <ref id="slow" name="slow">
2271 <sect1>tolower<label id="tolower"><p>
2275 <tag/Function/Convert a character into its lower case representation.
2276 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2277 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
2278 <tag/Description/The function returns the given character converted to lower
2279 case. If the given character is not a letter, it is returned unchanged.
2280 <tag/Limits/<itemize>
2281 <item>The function is only available as fastcall function, so it may
2282 only be used in presence of a prototype.
2284 <tag/Availability/ISO 9899
2286 <ref id="islower" name="islower">,
2287 <ref id="isupper" name="isupper">,
2288 <ref id="toupper" name="toupper">
2294 <sect1>toupper<label id="toupper"><p>
2298 <tag/Function/Convert a character into its upper case representation.
2299 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2300 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
2301 <tag/Description/The function returns the given character converted to upper
2302 case. If the given character is not a letter, it is returned unchanged.
2303 <tag/Limits/<itemize>
2304 <item>The function is only available as fastcall function, so it may
2305 only be used in presence of a prototype.
2307 <tag/Availability/ISO 9899
2309 <ref id="islower" name="islower">,
2310 <ref id="isupper" name="isupper">,
2311 <ref id="tolower" name="tolower">
2317 <sect1>wherex<label id="wherex"><p>
2321 <tag/Function/Return the current X position of the text mode cursor.
2322 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2323 <tag/Declaration/<tt/unsigned char wherex (void);/
2324 <tag/Description/The function returns the current X position of the text mode
2325 cursor. Zero is returned for the leftmost screen position.
2326 <tag/Availability/cc65
2328 <ref id="gotox" name="gotox">,
2329 <ref id="gotoy" name="gotoy">,
2330 <ref id="gotoxy" name="gotoxy">,
2331 <ref id="wherey" name="wherey">
2337 <sect1>wherey<label id="wherey"><p>
2341 <tag/Function/Return the current Y position of the text mode cursor.
2342 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2343 <tag/Declaration/<tt/unsigned char wherey (void);/
2344 <tag/Description/The function returns the current Y position of the text mode
2345 cursor. Zero is returned for the uppermost screen position.
2346 <tag/Availability/cc65
2348 <ref id="gotox" name="gotox">,
2349 <ref id="gotoy" name="gotoy">,
2350 <ref id="gotoxy" name="gotoxy">,
2351 <ref id="wherex" name="wherex">