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/conio.h/<label id="conio.h"><p>
75 <item><ref id="bgcolor" name="bgcolor">
76 <item><ref id="bordercolor" name="bordercolor">
77 <item><ref id="cclear" name="cclear">
78 <item><ref id="cclearxy" name="cclearxy">
79 <item><ref id="cgetc" name="cgetc">
80 <item><ref id="chline" name="chline">
81 <item><ref id="chlinexy" name="chlinexy">
82 <item><ref id="clrscr" name="clrscr">
83 <!-- <item><ref id="cprintf" name="cprintf"> -->
84 <!-- <item><ref id="cputc" name="cputc"> -->
85 <!-- <item><ref id="cputcxy" name="cputcxy"> -->
86 <!-- <item><ref id="cputs" name="cputs"> -->
87 <!-- <item><ref id="cputsxy" name="cputsxy"> -->
88 <item><ref id="cursor" name="cursor">
89 <item><ref id="cvline" name="cvline">
90 <item><ref id="cvlinexy" name="cvlinexy">
91 <item><ref id="gotox" name="gotox">
92 <item><ref id="gotoxy" name="gotoxy">
93 <item><ref id="gotoy" name="gotoy">
94 <item><ref id="kbhit" name="kbhit">
95 <item><ref id="revers" name="revers">
96 <item><ref id="screensize" name="screensize">
97 <item><ref id="textcolor" name="textcolor">
98 <!-- <item><ref id="vcprintf" name="vcprintf"> -->
99 <item><ref id="wherex" name="wherex">
100 <item><ref id="wherey" name="wherey">
104 <sect1><tt/ctype.h/<label id="ctype.h"><p>
107 <item><ref id="isalnum" name="isalnum">
108 <item><ref id="isalpha" name="isalpha">
109 <item><ref id="isascii" name="isascii">
110 <item><ref id="isblank" name="isblank">
111 <item><ref id="iscntrl" name="iscntrl">
112 <item><ref id="isdigit" name="isdigit">
113 <item><ref id="isgraph" name="isgraph">
114 <item><ref id="islower" name="islower">
115 <item><ref id="isprint" name="isprint">
116 <item><ref id="ispunct" name="ispunct">
117 <item><ref id="isspace" name="isspace">
118 <item><ref id="isupper" name="isupper">
119 <item><ref id="isxdigit" name="isxdigit">
120 <item><ref id="tolower" name="tolower">
121 <item><ref id="toupper" name="toupper">
125 <sect1><tt/em.h/<label id="em.h"><p>
128 <item><ref id="em_commit" name="em_commit">
129 <item><ref id="em_copyfrom" name="em_copyfrom">
130 <item><ref id="em_copyto" name="em_copyto">
131 <item><ref id="em_load_driver" name="em_load_driver">
132 <item><ref id="em_map" name="em_map">
133 <item><ref id="em_pagecount" name="em_pagecount">
134 <item><ref id="em_unload" name="em_unload">
135 <item><ref id="em_use" name="em_use">
139 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
142 <item><ref id="abort" name="abort">
143 <item><ref id="atexit" name="atexit">
144 <item><ref id="exit" name="exit">
148 <sect1><tt/string.h/<label id="string.h"><p>
151 <item><ref id="strcat" name="strcat">
152 <item><ref id="strchr" name="strchr">
153 <item><ref id="strcpy" name="strcpy">
154 <item><ref id="strlen" name="strlen">
155 <item><ref id="strlower" name="strlower">
156 <item><ref id="strlwr" name="strlwr">
157 <item><ref id="strncpy" name="strncpy">
158 <item><ref id="strrchr" name="strrchr">
159 <item><ref id="strupper" name="strupper">
160 <item><ref id="strupr" name="strupr">
166 <sect>Alphabetical function reference<p>
168 <sect1>BRK<label id="BRK"><p>
172 <tag/Function/Insert a 6502 BRK instrunction into the code.
173 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
174 <tag/Declaration/<tt/void BRK (void);/
175 <tag/Description/The function will insert a 6502 BRK instruction into the code
176 which may be used to trigger a debugger.
177 <tag/Limits/<itemize>
178 <item>The function is actually a macro.
179 <item>The inserted instruction may lead to unexpected results if no debugger
182 <tag/Availability/cc65
184 <ref id="CLI" name="CLI">,
185 <ref id="SEI" name="SEI">
191 <sect1>CLI<label id="CLI"><p>
195 <tag/Function/Insert a 6502 CLI instrunction into the code.
196 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
197 <tag/Declaration/<tt/void CLI (void);/
198 <tag/Description/The function will insert a 6502 CLI instruction into the code,
199 so interrupts are disabled. Note that non maskable interrupts cannot be
201 <tag/Limits/<itemize>
202 <item>The function is actually a macro.
203 <item>Disabling interrupts may lead to unexpected results.
205 <tag/Availability/cc65
207 <ref id="BRK" name="BRK">,
208 <ref id="SEI" name="SEI">
214 <sect1>SEI<label id="SEI"><p>
218 <tag/Function/Insert a 6502 SEI instrunction into the code.
219 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
220 <tag/Declaration/<tt/void SEI (void);/
221 <tag/Description/The function will insert a 6502 SEI instruction into the code,
222 so interrupts are enabled. Enabling interrupts has no effects if they are
223 already enabled (the default).
224 <tag/Limits/<itemize>
225 <item>The function is actually a macro.
227 <tag/Availability/cc65
229 <ref id="BRK" name="BRK">,
230 <ref id="CLI" name="CLI">
236 <sect1>abort<label id="abort"><p>
240 <tag/Function/Terminates a program abnormally.
241 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
242 <tag/Declaration/<tt/void abort (void);/
243 <tag/Description/<tt/abort/ writes a termination message on stderr, then
244 terminates the program with an exit code of 3.
245 <tag/Availability/ISO 9899
247 <ref id="assert" name="assert">,
248 <ref id="exit" name="exit">
254 <sect1>assert<label id="assert"><p>
258 <tag/Function/Test a condition and possibly abort.
259 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
260 <tag/Declaration/<tt/void assert (int cond);/
261 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
262 statement. If the condition evaluates t zero (false), assert prints a message
263 on stderr and aborts the program.
264 <tag/Limits/<itemize>
265 <item>The function is actually a macro.
267 <tag/Availability/ISO 9899
269 <ref id="abort" name="abort">,
270 <ref id="exit" name="exit">
276 <sect1>atexit<label id="atexit"><p>
280 <tag/Function/Register an exit function.
281 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
282 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
283 <tag/Description/<tt/atexit/ registers the function pointed to by
284 <tt/exitfunc/ as an exit function. Exit functions are called when the program
285 terminates, they are called in LIFO order (the last function registered is
286 called first). <tt/atexit/ returns zero on success and a nonzero value on
288 <tag/Limits/<itemize>
289 <item>A maximum of 5 exit functions can be registered.
290 <item>There is no way to unregister an exit function.
291 <item>The function is only available as fastcall function, so it may only be
292 used in presence of a prototype.
294 <tag/Availability/ISO 9899
296 <ref id="abort" name="abort">,
297 <ref id="exit" name="exit">
303 <sect1>bgcolor<label id="bgcolor"><p>
307 <tag/Function/Set the background text color.
308 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
309 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
310 <tag/Description/The function will set a new background text color. It returns
311 the old (current) background color.
312 <tag/Limits/<itemize>
313 <item>Background colors are system dependent. The function may have no effect
314 on systems where the background color cannot be changed.
315 <item>The function is only available as fastcall function, so it may only be
316 used in presence of a prototype.
318 <tag/Availability/cc65
320 <ref id="bordercolor" name="bordercolor">,
321 <ref id="textcolor" name="textcolor">
327 <sect1>bordercolor<label id="bordercolor"><p>
331 <tag/Function/Set the border (frame) color.
332 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
333 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
334 <tag/Description/The function will set a new border color. It returns the old
335 (current) border color.
336 <tag/Limits/<itemize>
337 <item>Border colors are system dependent. The function may have no effect
338 on systems where the border color cannot be changed.
339 <item>The function is only available as fastcall function, so it may only
340 be used in presence of a prototype.
342 <tag/Availability/cc65
344 <ref id="bgcolor" name="bgcolor">,
345 <ref id="textcolor" name="textcolor">
351 <sect1>cclear<label id="cclear"><p>
355 <tag/Function/Clear part of a line (write a given amount of spaces).
356 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
357 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
358 <tag/Description/The function clears part of a line by writing <tt/length/
359 spaces in the current text color.
360 <tag/Limits/<itemize>
361 <item>The function is only available as fastcall function, so it may
362 only be used in presence of a prototype.
364 <tag/Availability/cc65
366 <ref id="cclearxy" name="cclearxy">,
367 <ref id="clrscr" name="clrscr">
373 <sect1>cclearxy<label id="cclearxy"><p>
377 <tag/Function/Clear part of a line (write a given amount of spaces) starting
378 at a specific screen position.
379 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
380 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
381 <tag/Description/The function moves the cursor to a specific position, and
382 will then clear part of the line by writing <tt/length/ spaces in the current
384 <tag/Limits/<itemize>
385 <item>The function is only available as fastcall function, so it may
386 only be used in presence of a prototype.
388 <tag/Availability/cc65
390 <ref id="cclear" name="cclear">,
391 <ref id="clrscr" name="clrscr">
397 <sect1>cgetc<label id="cgetc"><p>
401 <tag/Function/Read a character from the keyboard.
402 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
403 <tag/Declaration/<tt/char cgetc (void);/
404 <tag/Description/The function reads a character from the keyboard. If there is
405 no character available, <tt/cgetc/ waits until the user presses a key. If the
406 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
407 displayed while waiting.
408 <tag/Limits/<itemize>
409 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
410 from this buffer and wait only if the buffer is empty.
412 <tag/Availability/cc65
414 <ref id="cursor" name="cursor">,
415 <ref id="kbhit" name="kbhit">
421 <sect1>chline<label id="chline"><p>
425 <tag/Function/Output a horizontal line in text mode.
426 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
427 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
428 <tag/Description/The function outputs a horizontal line with the given length
429 starting at the current cursor position.
430 <tag/Limits/<itemize>
431 <item>The character used to draw the horizontal line is system dependent.
432 If available, a line drawing character is used. Drawing a line that is partially
433 off screen leads to undefined behaviour.
434 <item>The function is only available as fastcall function, so it may only be
435 used in presence of a prototype.
437 <tag/Availability/cc65
439 <ref id="chlinexy" name="chlinexy">,
440 <ref id="cvline" name="cvline">,
441 <ref id="cvlinexy" name="cvlinexy">
447 <sect1>chlinexy<label id="chlinexy"><p>
451 <tag/Function/Output a horizontal line at a given position in text mode.
452 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
453 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
454 <tag/Description/The function outputs a horizontal line with the given length
455 starting at a given position.
456 <tag/Limits/<itemize>
457 <item>The character used to draw the horizontal line is system dependent.
458 If available, a line drawing character is used. Drawing a line that is partially
459 off screen leads to undefined behaviour.
460 <item>The function is only available as fastcall function, so it may only be
461 used in presence of a prototype.
463 <tag/Availability/cc65
465 <ref id="chline" name="chline">,
466 <ref id="cvline" name="cvline">,
467 <ref id="cvlinexy" name="cvlinexy">
473 <sect1>clrscr<label id="clrscr"><p>
477 <tag/Function/Clear the text screen.
478 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
479 <tag/Declaration/<tt/void clrscr (void);/
480 <tag/Description/The function clears the text screen and moves the cursor to
481 the upper left corner.
482 <tag/Availability/cc65
484 <ref id="cclear" name="cclear">,
485 <ref id="cclearxy" name="cclearxy">
491 <sect1>cursor<label id="cursor"><p>
495 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
496 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
497 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
498 <tag/Description/If the argument to the function is non zero, a blinking cursor
499 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
500 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
501 <tag/Limits/<itemize>
502 <item>The function is only available as fastcall function, so it may only
503 be used in presence of a prototype.
505 <tag/Availability/cc65
507 <ref id="cgetc" name="cgetc">,
508 <ref id="kbhit" name="kbhit">
514 <sect1>cvline<label id="cvline"><p>
518 <tag/Function/Output a vertical line in text mode.
519 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
520 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
521 <tag/Description/The function outputs a vertical line with the given length
522 starting at the current cursor position.
523 <tag/Limits/<itemize>
524 <item>The character used to draw the vertical line is system dependent.
525 If available, a line drawing character is used. Drawing a line that is partially
526 off screen leads to undefined behaviour.
527 <item>The function is only available as fastcall function, so it may only be
528 used in presence of a prototype.
530 <tag/Availability/cc65
532 <ref id="chline" name="chline">,
533 <ref id="chlinexy" name="chlinexy">,
534 <ref id="cvlinexy" name="cvlinexy">
540 <sect1>cvlinexy<label id="cvlinexy"><p>
544 <tag/Function/Output a vertical line at a given position in text mode.
545 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
546 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
547 <tag/Description/The function outputs a vertical line with the given length
548 starting at a given position.
549 <tag/Limits/<itemize>
550 <item>The character used to draw the vertical line is system dependent.
551 If available, a line drawing character is used. Drawing a line that is partially
552 off screen leads to undefined behaviour.
553 <item>The function is only available as fastcall function, so it may only be
554 used in presence of a prototype.
556 <tag/Availability/cc65
558 <ref id="chline" name="chline">,
559 <ref id="chlinexy" name="chlinexy">,
560 <ref id="cvline" name="cvline">
566 <sect1>em_commit<label id="em_commit"><p>
570 <tag/Function/Commit changes into extended memory.
571 <tag/Header/<tt/<ref id="em.h" name="em.h">/
572 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
573 <tag/Description/Commit changes in the memory window to extended storage. If
574 the contents of the memory window have been changed, these changes may be lost
575 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
576 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
577 name="em_copyto">/ are called without calling <tt/em_commit/ first.
578 <tag/Limits/<itemize>
579 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
580 memory window are discarded, it does just mean that the drivers is allowed
582 <item>The function is only available as fastcall function, so it may only be
583 used in presence of a prototype.
584 <item>The function produces undefined results if no extended memory driver is
587 <tag/Availability/cc65
589 <ref id="em_load_driver" name="em_load_driver">,
590 <ref id="em_map" name="em_map">,
591 <ref id="em_use" name="em_use">
597 <sect1>em_copyfrom<label id="em_copyfrom"><p>
601 <tag/Function/Copy from extended into normal memory.
602 <tag/Header/<tt/<ref id="em.h" name="em.h">/
603 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
604 <tag/Description/Copy data from extended memory into linear memory. Source and
605 target addresses as well as the number of bytes to transfer are specified in
606 the <tt/em_copy/ structure that is passed as a parameter.
607 <tag/Limits/<itemize>
608 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
609 made any changes to the data in the window, call <tt/<ref id="em_commit"
610 name="em_commit">/ first, or the changes are lost.
611 <item>The function is only available as fastcall function, so it may only be
612 used in presence of a prototype.
613 <item>The function produces undefined results if no extended memory driver is
616 <tag/Availability/cc65
618 <ref id="em_commit" name="em_commit">,
619 <ref id="em_copyto" name="em_copyto">,
620 <ref id="em_load_driver" name="em_load_driver">
626 <sect1>em_copyto<label id="em_copyto"><p>
630 <tag/Function/Copy from normal into extended memory.
631 <tag/Header/<tt/<ref id="em.h" name="em.h">/
632 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
633 <tag/Description/Copy data from linear into extended memory. Source and
634 target addresses as well as the number of bytes to transfer are specified in
635 the <tt/em_copy/ structure that is passed as a parameter.
636 <tag/Limits/<itemize>
637 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
638 made any changes to the data in the window, call <tt/<ref id="em_commit"
639 name="em_commit">/ first, or the changes are lost.
640 <item>The function is only available as fastcall function, so it may only be
641 used in presence of a prototype.
642 <item>The function produces undefined results if no extended memory driver is
645 <tag/Availability/cc65
647 <ref id="em_commit" name="em_commit">,
648 <ref id="em_copyfrom" name="em_copyfrom">,
649 <ref id="em_load_driver" name="em_load_driver">
655 <sect1>em_load_driver<label id="em_load_driver"><p>
659 <tag/Function/Load and initialize an extended memory driver.
660 <tag/Header/<tt/<ref id="em.h" name="em.h">/
661 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
662 <tag/Description/Load an extended memory driver into memory and initialize
663 it. The function returns an error code that tells if all this has been
665 <tag/Limits/<itemize>
666 <item>Not all drivers are able to detect if the supported hardware is really
668 <item>The function is only available as fastcall function, so it may only be
669 used in presence of a prototype.
670 <item>The driver is loaded by name, so currently you must know the type of
671 extended memory that should be supported. There is no autodetect capability.
673 <tag/Availability/cc65
675 <ref id="em_unload" name="em_unload">
681 <sect1>em_map<label id="em_map"><p>
685 <tag/Function/Make a page of extended memory accessible.
686 <tag/Header/<tt/<ref id="em.h" name="em.h">/
687 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
688 <tag/Description/The function maps one page of extended memory into linear
689 memory and returns a pointer to the page frame. Depending on the hardware
690 and driver, the data is either mapped into the address space or transfered
691 into a buffer. If you don't need the actual contents of the page (for example
692 because you're going to overwrite it completely, it is better to call
693 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
694 data if it is possible to avoid that.
695 <tag/Limits/<itemize>
696 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
697 made any changes to the data in the window, call <tt/<ref id="em_commit"
698 name="em_commit">/ first, or the changes are lost.
699 <item>The function is only available as fastcall function, so it may only be
700 used in presence of a prototype.
701 <item>The function produces undefined results if no extended memory driver is
704 <tag/Availability/cc65
706 <ref id="em_commit" name="em_commit">,
707 <ref id="em_load_driver" name="em_load_driver">,
708 <ref id="em_use" name="em_use">
714 <sect1>em_pagecount<label id="em_pagecount"><p>
718 <tag/Function/Return the number of available extended memory pages.
719 <tag/Header/<tt/<ref id="em.h" name="em.h">/
720 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
721 <tag/Description/The function returns the size of the extended memory supported
722 by the driver in 256 byte pages.
723 <tag/Limits/<itemize>
724 <item>The function returns zero if no extended memory driver is loaded.
725 <item>The function may return zero if the supported hardware was not detected.
727 <tag/Availability/cc65
729 <ref id="em_load_driver" name="em_load_driver">
735 <sect1>em_unload<label id="em_unload"><p>
739 <tag/Function/Unload an extended memory driver.
740 <tag/Header/<tt/<ref id="em.h" name="em.h">/
741 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
742 <tag/Description/The function unloads a loaded extended memory driver and
743 frees all memory allocated for the driver.
744 <tag/Limits/<itemize>
745 <item>The function does nothing if no driver is loaded.
747 <tag/Availability/cc65
749 <ref id="em_load_driver" name="em_load_driver">
755 <sect1>em_use<label id="em_use"><p>
759 <tag/Function/Prepare an extended memory page for use.
760 <tag/Header/<tt/<ref id="em.h" name="em.h">/
761 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
762 <tag/Description/The function maps one page of extended memory into linear
763 memory and returns a pointer to the page frame. This function is similar to
764 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
765 actual memory window in the assumption that the existing data is wrong or
766 will get overwritten.
767 <tag/Limits/<itemize>
768 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
769 made any changes to the data in the window, call <tt/<ref id="em_commit"
770 name="em_commit">/ first, or the changes are lost.
771 <item>The function is only available as fastcall function, so it may only be
772 used in presence of a prototype.
773 <item>The function produces undefined results if no extended memory driver is
776 <tag/Availability/cc65
778 <ref id="em_commit" name="em_commit">,
779 <ref id="em_load_driver" name="em_load_driver">,
780 <ref id="em_map" name="em_map">
786 <sect1>exit<label id="exit"><p>
790 <tag/Function/Terminate the program.
791 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
792 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
793 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
794 return code of the program. Before termination, all files are closed, buffered
795 output is written and any functions registered with <tt/<ref id="atexit"
796 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
797 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
799 <tag/Limits/<itemize>
800 <item>The function is only available as fastcall function, so it may only
801 be used in presence of a prototype.
802 <item>It depends on the host machine if the program return code can be
803 evaluated or is ignored.
805 <tag/Availability/ISO 9899
807 <ref id="abort" name="abort">,
808 <ref id="exit" name="exit">
814 <sect1>gotox<label id="gotox"><p>
818 <tag/Function/Move the text mode cursor to a new X position.
819 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
820 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
821 <tag/Description/The function moves the text mode cursor to the specified X
822 position while leaving the Y position untouched. The leftmost position on the
823 screen has the coordinate 0.
824 <tag/Limits/<itemize>
825 <item>The function is only available as fastcall function, so it may
826 only be used in presence of a prototype.
827 <item>Invalid values for the X position (out of screen coordinates) may
828 lead to undefined behaviour.
830 <tag/Availability/cc65
832 <ref id="gotoy" name="gotoy">,
833 <ref id="gotoxy" name="gotoxy">,
834 <ref id="wherex" name="wherex">,
835 <ref id="wherey" name="wherey">
841 <sect1>gotoxy<label id="gotoxy"><p>
845 <tag/Function/Move the text mode cursor to a new position.
846 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
847 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
848 <tag/Description/The function moves the text mode cursor to the specified
849 position. The leftmost position on the screen has the X coordinate 0, the
850 topmost line has the Y coordinate 0.
851 <tag/Limits/<itemize>
852 <item>The function is only available as fastcall function, so it may only be
853 used in presence of a prototype.
854 <item>Invalid values for any of both coordinates (out of screen positions) may
855 lead to undefined behaviour.
857 <tag/Availability/cc65
859 <ref id="gotox" name="gotox">,
860 <ref id="gotoy" name="gotoy">,
861 <ref id="wherex" name="wherex">,
862 <ref id="wherey" name="wherey">
868 <sect1>gotoy<label id="gotoy"><p>
872 <tag/Function/Move the text mode cursor to a new Y position.
873 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
874 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
875 <tag/Description/The function moves the text mode cursor to the specified Y
876 position while leaving the X position untouched. The uppermost position on the
877 screen has the coordinate 0.
878 <tag/Limits/<itemize>
879 <item>The function is only available as fastcall function, so it may
880 only be used in presence of a prototype.
881 <item>Invalid values for the Y position (out of screen coordinates) may lead
882 to undefined behaviour.
884 <tag/Availability/cc65
886 <ref id="gotox" name="gotox">,
887 <ref id="gotoxy" name="gotoxy">,
888 <ref id="wherex" name="wherex">,
889 <ref id="wherey" name="wherey">
895 <sect1>isalnum<label id="isalnum"><p>
899 <tag/Function/Check if a given character is a letter or digit.
900 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
901 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
902 <tag/Description/The function returns a value of zero if the given argument
903 is a letter or digit. The return value is non zero if the character
905 <tag/Limits/<itemize>
906 <item>When compiling with <tt/-Os/ the function is actually a macro. The
907 inline sequence generated by the macro will not work correctly for values
908 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
909 this range. The non inline function may be accessed by <tt/#undef/'ing
911 <item>When compiling without <tt/-Os/, the function is only available as
912 fastcall function, so it may only be used in presence of a prototype.
914 <tag/Availability/ISO 9899
916 <ref id="isalpha" name="isalpha">,
917 <ref id="isascii" name="isascii">,
918 <ref id="isblank" name="isblank">,
919 <ref id="iscntrl" name="iscntrl">,
920 <ref id="isdigit" name="isdigit">,
921 <ref id="isgraph" name="isgraph">,
922 <ref id="islower" name="islower">,
923 <ref id="isprint" name="isprint">,
924 <ref id="ispunct" name="ispunct">,
925 <ref id="isspace" name="isspace">,
926 <ref id="isupper" name="isupper">,
927 <ref id="isxdigit" name="isxdigit">
933 <sect1>isalpha<label id="isalpha"><p>
937 <tag/Function/Check if a given character is a letter.
938 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
939 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
940 <tag/Description/The function returns a value of zero if the given argument
941 is a letter. The return value is non zero if the character is anything else.
942 <tag/Limits/<itemize>
943 <item>When compiling with <tt/-Os/ the function is actually a macro. The
944 inline sequence generated by the macro will not work correctly for values
945 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
946 this range. The non inline function may be accessed by <tt/#undef/'ing the
948 <item>When compiling without <tt/-Os/, the function is only available as
949 fastcall function, so it may only be used in presence of a prototype.
951 <tag/Availability/ISO 9899
953 <ref id="isalnum" name="isalnum">,
954 <ref id="isascii" name="isascii">,
955 <ref id="isblank" name="isblank">,
956 <ref id="iscntrl" name="iscntrl">,
957 <ref id="isdigit" name="isdigit">,
958 <ref id="isgraph" name="isgraph">,
959 <ref id="islower" name="islower">,
960 <ref id="isprint" name="isprint">,
961 <ref id="ispunct" name="ispunct">,
962 <ref id="isspace" name="isspace">,
963 <ref id="isupper" name="isupper">,
964 <ref id="isxdigit" name="isxdigit">
970 <sect1>isascii<label id="isascii"><p>
974 <tag/Function/Check if a given character is in the ASCII (0..127) range.
975 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
976 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
977 <tag/Description/The function returns a value of zero if the given argument
978 is in the range 0..127 (the range of valid ASCII characters) and a non zero
980 <tag/Limits/<itemize>
981 <item>When compiling with <tt/-Os/ the function is actually a macro. The
982 inline sequence generated by the macro will not work correctly for values
983 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
984 this range. The non inline function may be accessed by <tt/#undef/'ing the
986 <item>When compiling without <tt/-Os/, the function is only available as
987 fastcall function, so it may only be used in presence of a prototype.
989 <tag/Availability/ISO 9899
991 <ref id="isalnum" name="isalnum">,
992 <ref id="isalpha" name="isalpha">,
993 <ref id="isblank" name="isblank">,
994 <ref id="iscntrl" name="iscntrl">,
995 <ref id="isdigit" name="isdigit">,
996 <ref id="isgraph" name="isgraph">,
997 <ref id="islower" name="islower">,
998 <ref id="isprint" name="isprint">,
999 <ref id="ispunct" name="ispunct">,
1000 <ref id="isspace" name="isspace">,
1001 <ref id="isupper" name="isupper">,
1002 <ref id="isxdigit" name="isxdigit">
1008 <sect1>isblank<label id="isblank"><p>
1012 <tag/Function/Check if a given character is a space or tab.
1013 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1014 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1015 <tag/Description/The function returns a value of zero if the given argument
1016 is a blank or space character. The return value is non zero if the character
1018 <tag/Limits/<itemize>
1019 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1020 inline sequence generated by the macro will not work correctly for values
1021 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1022 this range. The non inline function may be accessed by <tt/#undef/'ing the
1024 <item>When compiling without <tt/-Os/, the function is only available as
1025 fastcall function, so it may only be used in presence of a prototype.
1027 <tag/Availability/cc65
1029 <ref id="isalnum" name="isalnum">,
1030 <ref id="isalpha" name="isalpha">,
1031 <ref id="isascii" name="isascii">,
1032 <ref id="iscntrl" name="iscntrl">,
1033 <ref id="isdigit" name="isdigit">,
1034 <ref id="isgraph" name="isgraph">,
1035 <ref id="islower" name="islower">,
1036 <ref id="isprint" name="isprint">,
1037 <ref id="ispunct" name="ispunct">,
1038 <ref id="isspace" name="isspace">,
1039 <ref id="isupper" name="isupper">,
1040 <ref id="isxdigit" name="isxdigit">
1046 <sect1>iscntrl<label id="iscntrl"><p>
1050 <tag/Function/Check if a given character is a control character.
1051 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1052 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1053 <tag/Description/The function returns a value of zero if the given argument
1054 is a control character. The return value is non zero if the character
1056 <tag/Limits/<itemize>
1057 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1058 inline sequence generated by the macro will not work correctly for values
1059 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1060 this range. The non inline function may be accessed by <tt/#undef/'ing the
1062 <item>When compiling without <tt/-Os/, the function is only available as
1063 fastcall function, so it may only be used in presence of a prototype.
1065 <tag/Availability/ISO 9899
1067 <ref id="isalnum" name="isalnum">,
1068 <ref id="isalpha" name="isalpha">,
1069 <ref id="isascii" name="isascii">,
1070 <ref id="isblank" name="isblank">,
1071 <ref id="isdigit" name="isdigit">,
1072 <ref id="isgraph" name="isgraph">,
1073 <ref id="islower" name="islower">,
1074 <ref id="isprint" name="isprint">,
1075 <ref id="ispunct" name="ispunct">,
1076 <ref id="isspace" name="isspace">,
1077 <ref id="isupper" name="isupper">,
1078 <ref id="isxdigit" name="isxdigit">
1084 <sect1>isdigit<label id="isdigit"><p>
1088 <tag/Function/Check if a given character is a digit.
1089 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1090 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1091 <tag/Description/The function returns a value of zero if the given argument
1092 is a digit. The return value is non zero if the character is anything else.
1093 <tag/Limits/<itemize>
1094 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1095 inline sequence generated by the macro will not work correctly for values
1096 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1097 this range. The non inline function may be accessed by <tt/#undef/'ing the
1099 <item>When compiling without <tt/-Os/, the function is only available as
1100 fastcall function, so it may only be used in presence of a prototype.
1102 <tag/Availability/ISO 9899
1104 <ref id="isalnum" name="isalnum">,
1105 <ref id="isalpha" name="isalpha">,
1106 <ref id="isascii" name="isascii">,
1107 <ref id="isblank" name="isblank">,
1108 <ref id="iscntrl" name="iscntrl">,
1109 <ref id="isgraph" name="isgraph">,
1110 <ref id="islower" name="islower">,
1111 <ref id="isprint" name="isprint">,
1112 <ref id="ispunct" name="ispunct">,
1113 <ref id="isspace" name="isspace">,
1114 <ref id="isupper" name="isupper">,
1115 <ref id="isxdigit" name="isxdigit">
1121 <sect1>isgraph<label id="isgraph"><p>
1125 <tag/Function/Check if a given character is a printable character (except
1127 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1128 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1129 <tag/Description/The function returns a value of zero if the given argument
1130 is a printable character with the exception of space. The return value is non
1131 zero if the character is anything else.
1132 <tag/Limits/<itemize>
1133 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1134 inline sequence generated by the macro will not work correctly for values
1135 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1136 this range. The non inline function may be accessed by <tt/#undef/'ing the
1138 <item>When compiling without <tt/-Os/, the function is only available as
1139 fastcall function, so it may only be used in presence of a prototype.
1141 <tag/Availability/ISO 9899
1143 <ref id="isalnum" name="isalnum">,
1144 <ref id="isalpha" name="isalpha">,
1145 <ref id="isascii" name="isascii">,
1146 <ref id="isblank" name="isblank">,
1147 <ref id="iscntrl" name="iscntrl">,
1148 <ref id="isdigit" name="isdigit">,
1149 <ref id="islower" name="islower">,
1150 <ref id="isprint" name="isprint">,
1151 <ref id="ispunct" name="ispunct">,
1152 <ref id="isspace" name="isspace">,
1153 <ref id="isupper" name="isupper">,
1154 <ref id="isxdigit" name="isxdigit">
1160 <sect1>islower<label id="islower"><p>
1164 <tag/Function/Check if a given character is a lower case letter.
1165 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1166 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1167 <tag/Description/The function returns a value of zero if the given argument
1168 is a lower case letter. The return value is non zero if the character is
1170 <tag/Limits/<itemize>
1171 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1172 inline sequence generated by the macro will not work correctly for values
1173 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1174 this range. The non inline function may be accessed by <tt/#undef/'ing the
1176 <item>When compiling without <tt/-Os/, the function is only available as
1177 fastcall function, so it may only be used in presence of a prototype.
1179 <tag/Availability/ISO 9899
1181 <ref id="isalnum" name="isalnum">,
1182 <ref id="isalpha" name="isalpha">,
1183 <ref id="isascii" name="isascii">,
1184 <ref id="isblank" name="isblank">,
1185 <ref id="iscntrl" name="iscntrl">,
1186 <ref id="isdigit" name="isdigit">,
1187 <ref id="isgraph" name="isgraph">,
1188 <ref id="isprint" name="isprint">,
1189 <ref id="ispunct" name="ispunct">,
1190 <ref id="isspace" name="isspace">,
1191 <ref id="isupper" name="isupper">,
1192 <ref id="isxdigit" name="isxdigit">
1198 <sect1>isprint<label id="isprint"><p>
1202 <tag/Function/Check if a given character is a printable character.
1203 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1204 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1205 <tag/Description/The function returns a value of zero if the given argument
1206 is a printable character (this includes the space character). The return value
1207 is non zero if the character is anything else.
1208 <tag/Limits/<itemize>
1209 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1210 inline sequence generated by the macro will not work correctly for values
1211 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1212 this range. The non inline function may be accessed by <tt/#undef/'ing the
1214 <item>When compiling without <tt/-Os/, the function is only available as
1215 fastcall function, so it may only be used in presence of a prototype.
1217 <tag/Availability/ISO 9899
1219 <ref id="isalnum" name="isalnum">,
1220 <ref id="isalpha" name="isalpha">,
1221 <ref id="isascii" name="isascii">,
1222 <ref id="isblank" name="isblank">,
1223 <ref id="iscntrl" name="iscntrl">,
1224 <ref id="isdigit" name="isdigit">,
1225 <ref id="isgraph" name="isgraph">,
1226 <ref id="islower" name="islower">,
1227 <ref id="ispunct" name="ispunct">,
1228 <ref id="isspace" name="isspace">,
1229 <ref id="isupper" name="isupper">,
1230 <ref id="isxdigit" name="isxdigit">
1236 <sect1>ispunct<label id="ispunct"><p>
1240 <tag/Function/Check if a given character is a printable character but not a
1241 space or an alphanumeric character.
1242 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1243 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
1244 <tag/Description/The function returns a value of zero if the given argument
1245 is a printable character, but not a space or anything alphanumeric. The return
1246 value is non zero if the character is anything else.
1247 <tag/Limits/<itemize>
1248 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1249 inline sequence generated by the macro will not work correctly for values
1250 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1251 this range. The non inline function may be accessed by <tt/#undef/'ing the
1253 <item>When compiling without <tt/-Os/, the function is only available as
1254 fastcall function, so it may only be used in presence of a prototype.
1256 <tag/Availability/ISO 9899
1258 <ref id="isalnum" name="isalnum">,
1259 <ref id="isalpha" name="isalpha">,
1260 <ref id="isascii" name="isascii">,
1261 <ref id="isblank" name="isblank">,
1262 <ref id="iscntrl" name="iscntrl">,
1263 <ref id="isdigit" name="isdigit">,
1264 <ref id="isgraph" name="isgraph">,
1265 <ref id="islower" name="islower">,
1266 <ref id="isprint" name="isprint">,
1267 <ref id="isspace" name="isspace">,
1268 <ref id="isupper" name="isupper">,
1269 <ref id="isxdigit" name="isxdigit">
1275 <sect1>isspace<label id="isspace"><p>
1279 <tag/Function/Check if a given character is a a white-space character.
1280 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1281 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
1282 <tag/Description/The function returns a value of zero if the given argument
1283 is a white space character. The return value is non zero if the character is
1284 anything else. The standard white space characters are: space, formfeed ('\f'),
1285 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
1287 <tag/Limits/<itemize>
1288 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1289 inline sequence generated by the macro will not work correctly for values
1290 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1291 this range. The non inline function may be accessed by <tt/#undef/'ing the
1293 <item>When compiling without <tt/-Os/, the function is only available as
1294 fastcall function, so it may only be used in presence of a prototype.
1296 <tag/Availability/ISO 9899
1298 <ref id="isalnum" name="isalnum">,
1299 <ref id="isalpha" name="isalpha">,
1300 <ref id="isascii" name="isascii">,
1301 <ref id="isblank" name="isblank">,
1302 <ref id="iscntrl" name="iscntrl">,
1303 <ref id="isdigit" name="isdigit">,
1304 <ref id="isgraph" name="isgraph">,
1305 <ref id="islower" name="islower">,
1306 <ref id="isprint" name="isprint">,
1307 <ref id="ispunct" name="ispunct">,
1308 <ref id="isupper" name="isupper">,
1309 <ref id="isxdigit" name="isxdigit">
1315 <sect1>isupper<label id="isupper"><p>
1319 <tag/Function/Check if a given character is an upper case letter.
1320 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1321 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
1322 <tag/Description/The function returns a value of zero if the given argument
1323 is an upper case letter. The return value is non zero if the character is
1325 <tag/Limits/<itemize>
1326 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1327 inline sequence generated by the macro will not work correctly for values
1328 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1329 this range. The non inline function may be accessed by <tt/#undef/'ing the
1331 <item>When compiling without <tt/-Os/, the function is only available as
1332 fastcall function, so it may only be used in presence of a prototype.
1334 <tag/Availability/ISO 9899
1336 <ref id="isalnum" name="isalnum">,
1337 <ref id="isalpha" name="isalpha">,
1338 <ref id="isascii" name="isascii">,
1339 <ref id="isblank" name="isblank">,
1340 <ref id="iscntrl" name="iscntrl">,
1341 <ref id="isdigit" name="isdigit">,
1342 <ref id="isgraph" name="isgraph">,
1343 <ref id="islower" name="islower">,
1344 <ref id="isprint" name="isprint">,
1345 <ref id="ispunct" name="ispunct">,
1346 <ref id="isspace" name="isspace">,
1347 <ref id="isxdigit" name="isxdigit">
1353 <sect1>isxdigit<label id="isxdigit"><p>
1357 <tag/Function/Check if a given character is a hexadecimal digit.
1358 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1359 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
1360 <tag/Description/The function returns a value of zero if the given argument
1361 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
1362 if the character is anything else.
1363 <tag/Limits/<itemize>
1364 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1365 inline sequence generated by the macro will not work correctly for values
1366 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1367 this range. The non inline function may be accessed by <tt/#undef/'ing the
1369 <item>When compiling without <tt/-Os/, the function is only available as
1370 fastcall function, so it may only be used in presence of a prototype.
1372 <tag/Availability/ISO 9899
1374 <ref id="isalnum" name="isalnum">,
1375 <ref id="isalpha" name="isalpha">,
1376 <ref id="isascii" name="isascii">,
1377 <ref id="isblank" name="isblank">,
1378 <ref id="iscntrl" name="iscntrl">,
1379 <ref id="isdigit" name="isdigit">,
1380 <ref id="isgraph" name="isgraph">,
1381 <ref id="islower" name="islower">,
1382 <ref id="isprint" name="isprint">,
1383 <ref id="ispunct" name="ispunct">,
1384 <ref id="isspace" name="isspace">,
1385 <ref id="isupper" name="isupper">
1391 <sect1>kbhit<label id="kbhit"><p>
1395 <tag/Function/Check if there's a key waiting in the keyboard buffer.
1396 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1397 <tag/Declaration/<tt/unsigned char kbhit (void);/
1398 <tag/Description/The function returns a value of zero if there is no character
1399 waiting to be read from the keyboard. It returns non zero otherwise.
1400 <tag/Limits/<itemize>
1401 <item>If the system does not support a keyboard buffer (most systems
1402 do), the function is rather useless.
1404 <tag/Availability/cc65
1406 <ref id="cgetc" name="cgetc">,
1407 <ref id="cursor" name="cursor">
1413 <sect1>revers<label id="revers"><p>
1417 <tag/Function/Control revers character display.
1418 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1419 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
1420 <tag/Description/If the argument is non zero, the function enables reverse
1421 character display. If the argument is zero, reverse character display is
1422 switched off. The old value of the setting is returned.
1423 <tag/Limits/<itemize>
1424 <item>The function may not be supported by the hardware, in which case
1425 the call is ignored.
1426 <item>The function is only available as fastcall function, so it may only
1427 be used in presence of a prototype.
1429 <tag/Availability/cc65
1431 <ref id="textcolor" name="textcolor">
1437 <sect1>screensize<label id="screensize"><p>
1441 <tag/Function/Return the dimensions of the text mode screen.
1442 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1443 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
1444 <tag/Description/The function returns the dimensions of the text mode screen.
1445 <tag/Limits/<itemize>
1446 <item>The function is only available as fastcall function, so it may only
1447 be used in presence of a prototype.
1449 <tag/Availability/cc65
1451 <ref id="gotox" name="gotox">,
1452 <ref id="gotoxy" name="gotoxy">,
1453 <ref id="gotoy" name="gotoy">,
1454 <ref id="wherex" name="wherex">,
1455 <ref id="wherey" name="wherey">
1461 <sect1>strcat<label id="strcat"><p>
1465 <tag/Function/Concatentate two strings.
1466 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1467 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
1468 <tag/Description/The <tt/strcat/ function appends a copy of the string
1469 pointed to by s2 (including the terminating null byte) to the end of the
1470 string pointed to by s1. The initial byte of s2 overwrites the null byte at
1472 <tag/Limits/<itemize>
1473 <item>The function is only available as fastcall function, so it may only
1474 be used in presence of a prototype.
1475 <item>If copying takes place between objects that overlap, the behavior
1478 <tag/Availability/ISO 9899
1480 <ref id="strcpy" name="strcpy">
1481 <ref id="strncpy" name="strncpy">
1487 <sect1>strchr<label id="strchr"><p>
1491 <tag/Function/Search for a character in a string.
1492 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1493 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
1494 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
1495 (converted to a char) in the string pointed to by <tt/s/. The terminating null
1496 byte is considered to be part of the string. Upon completion, the function
1497 returns a pointer to the byte, or a null pointer if the byte was not found.
1498 <tag/Limits/<itemize>
1499 <item>The function is only available as fastcall function, so it may only
1500 be used in presence of a prototype.
1502 <tag/Availability/ISO 9899
1504 <ref id="strrchr" name="strrchr">
1510 <sect1>strcpy<label id="strcpy"><p>
1514 <tag/Function/Copy a string.
1515 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1516 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
1517 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
1518 <tt/s2/ (including the terminating null byte) into the array pointed to by
1519 <tt/s1/. The function will always return <tt/s1/.
1520 <tag/Limits/<itemize>
1521 <item>The function is only available as fastcall function, so it may only
1522 be used in presence of a prototype.
1523 <item>If copying takes place between objects that overlap, the behavior
1526 <tag/Availability/ISO 9899
1528 <ref id="strcat" name="strcat">
1529 <ref id="strncpy" name="strncpy">
1534 static char hello[14];
1536 strcpy (hello, "Hello world!\n");
1542 <sect1>strlen<label id="strlen"><p>
1546 <tag/Function/Return the length of a string.
1547 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1548 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
1549 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
1550 string to which s points, not including the terminating null byte.
1551 <tag/Limits/<itemize>
1552 <item>The function is only available as fastcall function, so it may only
1553 be used in presence of a prototype.
1554 <item>When compiling with <tt/-Os/ (inline known standard functions), the
1555 function does not work correctly for strings with more than 255 characters.
1557 <tag/Availability/ISO 9899
1559 <ref id="strcpy" name="strcpy">
1565 <sect1>strlower<label id="strlower"><p>
1569 <tag/Function/Make a string lower case.
1570 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1571 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
1572 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
1573 function to each character of a string. The function will always return <tt/s/.
1574 <tag/Limits/<itemize>
1575 <item>The function is only available as fastcall function, so it may only
1576 be used in presence of a prototype.
1577 <item>The function prototype is unavailable when compiling in strict ANSI mode.
1578 <item>An alias name for this function is <tt/strlwr/.
1580 <tag/Availability/cc65
1582 <ref id="strupper" name="strupper">
1583 <ref id="tolower" name="tolower">
1589 <sect1>strlwr<label id="strlwr"><p>
1596 <sect1>strncpy<label id="strncpy"><p>
1600 <tag/Function/Copy part of a string.
1601 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1602 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
1603 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
1604 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
1605 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
1606 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
1607 written. The function will always return <tt/s1/.
1608 <tag/Limits/<itemize>
1609 <item>The function is only available as fastcall function, so it may only
1610 be used in presence of a prototype. If there is no null byte in the first <tt/n/
1611 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
1612 <item>If copying takes place between objects that overlap, the behavior is
1615 <tag/Availability/ISO 9899
1617 <ref id="strcat" name="strcat">
1618 <ref id="strcpy" name="strcpy">
1623 static char hello[6];
1625 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
1632 <sect1>strrchr<label id="strrchr"><p>
1636 <tag/Function/Search for a character in a string.
1637 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1638 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
1639 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
1640 (converted to a char) in the string pointed to by <tt/s/. The terminating null
1641 byte is considered to be part of the string. Upon completion, the function
1642 returns a pointer to the byte, or a null pointer if the byte was not found.
1643 <tag/Limits/<itemize>
1644 <item>The function is only available as fastcall function, so it may only
1645 be used in presence of a prototype.
1647 <tag/Availability/ISO 9899
1649 <ref id="strchr" name="strchr">
1655 <sect1>strupper<label id="strupper"><p>
1659 <tag/Function/Make a string upper case.
1660 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1661 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
1662 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
1663 function to each character of a string. The function will always return <tt/s/.
1664 <tag/Limits/<itemize>
1665 <item>The function is only available as fastcall function, so it may only
1666 be used in presence of a prototype.
1667 <item>The function prototype is unavailable when compiling in strict ANSI mode.
1668 <item>An alias name for this function is <tt/strupr/.
1670 <tag/Availability/cc65
1672 <ref id="strlower" name="strlower">
1673 <ref id="toupper" name="toupper">
1679 <sect1>strupr<label id="strupr"><p>
1686 <sect1>textcolor<label id="textcolor"><p>
1690 <tag/Function/Set the text color.
1691 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1692 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
1693 <tag/Description/The function will set a new text color. It returns the old
1694 (current) text color. Text output using any <tt/conio.h/ function will use
1695 the color set by this function.
1696 <tag/Limits/<itemize>
1697 <item>Text colors are system dependent. The function may have no effect
1698 on systems where the text color cannot be changed.
1699 <item>The function is only available as fastcall function, so it may only
1700 be used in presence of a prototype.
1702 <tag/Availability/cc65
1704 <ref id="bgcolor" name="bgcolor">,
1705 <ref id="bordercolor" name="bordercolor">
1711 <sect1>tolower<label id="tolower"><p>
1715 <tag/Function/Convert a character into its lower case representation.
1716 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1717 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
1718 <tag/Description/The function returns the given character converted to lower
1719 case. If the given character is not a letter, it is returned unchanged.
1720 <tag/Limits/<itemize>
1721 <item>The function is only available as fastcall function, so it may
1722 only be used in presence of a prototype.
1724 <tag/Availability/ISO 9899
1726 <ref id="islower" name="islower">,
1727 <ref id="isupper" name="isupper">,
1728 <ref id="toupper" name="toupper">
1734 <sect1>toupper<label id="toupper"><p>
1738 <tag/Function/Convert a character into its upper case representation.
1739 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1740 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
1741 <tag/Description/The function returns the given character converted to upper
1742 case. If the given character is not a letter, it is returned unchanged.
1743 <tag/Limits/<itemize>
1744 <item>The function is only available as fastcall function, so it may
1745 only be used in presence of a prototype.
1747 <tag/Availability/ISO 9899
1749 <ref id="islower" name="islower">,
1750 <ref id="isupper" name="isupper">,
1751 <ref id="tolower" name="tolower">
1757 <sect1>wherex<label id="wherex"><p>
1761 <tag/Function/Return the current X position of the text mode cursor.
1762 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1763 <tag/Declaration/<tt/unsigned char wherex (void);/
1764 <tag/Description/The function returns the current X position of the text mode
1765 cursor. Zero is returned for the leftmost screen position.
1766 <tag/Availability/cc65
1768 <ref id="gotox" name="gotox">,
1769 <ref id="gotoy" name="gotoy">,
1770 <ref id="gotoxy" name="gotoxy">,
1771 <ref id="wherey" name="wherey">
1777 <sect1>wherey<label id="wherey"><p>
1781 <tag/Function/Return the current Y position of the text mode cursor.
1782 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1783 <tag/Declaration/<tt/unsigned char wherey (void);/
1784 <tag/Description/The function returns the current Y position of the text mode
1785 cursor. Zero is returned for the uppermost screen position.
1786 <tag/Availability/cc65
1788 <ref id="gotox" name="gotox">,
1789 <ref id="gotoy" name="gotoy">,
1790 <ref id="gotoxy" name="gotoxy">,
1791 <ref id="wherex" name="wherex">