]> git.sur5r.net Git - cc65/blob - doc/funcref.sgml
026a7682338f4299674d67156b7de20a745eaa5a
[cc65] / doc / funcref.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4 <title>cc65 function reference
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
6 <date>07.11.2002
7
8 <abstract>
9 cc65 is a C compiler for 6502 based systems. This function reference describes
10 the available C functions supplied by the library.
11 </abstract>
12
13 <!-- Table of contents -->
14 <toc>
15
16 <!-- Begin the document -->
17
18 <sect>Introduction<p>
19
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.
24
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">.
28
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.
32
33 Each entry for a function contains a detailed description
34
35 <quote>
36 <descrip>
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
40 function.
41 <tag/Description/Description of the function.
42 <tag/Limits/Limits.
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.
46 </descrip>
47 </quote>
48
49
50 <sect>Functions by header file<p>
51
52 <sect1><tt/6502.h/<label id="6502.h"><p>
53
54 <itemize>
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"> -->
62 </itemize>
63
64
65 <sect1><tt/assert.h/<label id="assert.h"><p>
66
67 <itemize>
68 <item><ref id="assert" name="assert">
69 </itemize>
70
71
72 <sect1><tt/c128.h/<label id="c128.h"><p>
73
74 <itemize>
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">
79 </itemize>
80
81
82 <sect1><tt/conio.h/<label id="conio.h"><p>
83
84 <itemize>
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">
111 </itemize>
112
113
114 <sect1><tt/ctype.h/<label id="ctype.h"><p>
115
116 <itemize>
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">
132 </itemize>
133
134
135 <sect1><tt/em.h/<label id="em.h"><p>
136
137 <itemize>
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">
146 </itemize>
147
148
149 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
150
151 <itemize>
152 <item><ref id="_heapadd" name="_heapadd">
153 <item><ref id="_heapmaxavail" name="_heapmaxavail">
154 <item><ref id="_heapmemavail" name="_heapmemavail">
155 <item><ref id="_randomize" name="_randomize">
156 <!-- <item><ref id="_swap" name="_swap"> -->
157 <item><ref id="abort" name="abort">
158 <item><ref id="abs" name="abs">
159 <item><ref id="atexit" name="atexit">
160 <!-- <item><ref id="atoi" name="atoi"> -->
161 <!-- <item><ref id="atol" name="atol"> -->
162 <!-- <item><ref id="bsearch" name="bsearch"> -->
163 <item><ref id="calloc" name="calloc">
164 <!-- <item><ref id="div" name="div"> -->
165 <item><ref id="exit" name="exit">
166 <item><ref id="free" name="free">
167 <!-- <item><ref id="getenv" name="getenv"> -->
168 <!-- <item><ref id="itoa" name="itoa"> -->
169 <item><ref id="labs" name="labs">
170 <!-- <item><ref id="ltoa" name="ltoa"> -->
171 <item><ref id="malloc" name="malloc">
172 <!-- <item><ref id="qsort" name="qsort"> -->
173 <item><ref id="rand" name="rand">
174 <item><ref id="realloc" name="realloc">
175 <item><ref id="srand" name="srand">
176 <!-- <item><ref id="ultoa" name="ultoa"> -->
177 <!-- <item><ref id="utoa" name="utoa"> -->
178 </itemize>
179
180
181 <sect1><tt/string.h/<label id="string.h"><p>
182
183 <itemize>
184 <!-- <item><ref id="_stroserror" name="_stroserror"> -->
185 <!-- <item><ref id="bzero" name="bzero"> -->
186 <!-- <item><ref id="memchr" name="memchr"> -->
187 <!-- <item><ref id="memcpy" name="memcpy"> -->
188 <!-- <item><ref id="memmove" name="memmove"> -->
189 <!-- <item><ref id="memset" name="memset"> -->
190 <!-- <item><ref id="strcasecmp" name="strcasecmp"> -->
191 <item><ref id="strcat" name="strcat">
192 <item><ref id="strchr" name="strchr">
193 <!-- <item><ref id="strcmp" name="strcmp"> -->
194 <!-- <item><ref id="strcoll" name="strcoll"> -->
195 <item><ref id="strcpy" name="strcpy">
196 <!-- <item><ref id="strcspn" name="strcspn"> -->
197 <!-- <item><ref id="strdup" name="strdup"> -->
198 <!-- <item><ref id="strerror" name="strerror"> -->
199 <!-- <item><ref id="stricmp" name="stricmp"> -->
200 <item><ref id="strlen" name="strlen">
201 <item><ref id="strlower" name="strlower">
202 <item><ref id="strlwr" name="strlwr">
203 <!-- <item><ref id="strncat" name="strncat"> -->
204 <!-- <item><ref id="strncmp" name="strncmp"> -->
205 <item><ref id="strncpy" name="strncpy">
206 <item><ref id="strrchr" name="strrchr">
207 <!-- <item><ref id="strspn" name="strspn"> -->
208 <!-- <item><ref id="strstr" name="strstr"> -->
209 <!-- <item><ref id="strtok" name="strtok"> -->
210 <!-- <item><ref id="strxfrm" name="strxfrm"> -->
211 <item><ref id="strupper" name="strupper">
212 <item><ref id="strupr" name="strupr">
213 </itemize>
214
215
216
217
218 <sect>Alphabetical function reference<p>
219
220 <sect1>_heapadd<label id="_heapadd"><p>
221
222 <quote>
223 <descrip>
224 <tag/Function/Add a block to the heap.
225 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
226 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
227 <tag/Description/The function adds a block of raw memory to the heap.
228 <tag/Limits/
229 <itemize>
230 <item>The minimum blocksize that can be added is 6 bytes; the function will
231 ignore blocks with smaller sizes.
232 </itemize>
233 <tag/Availability/cc65
234 <tag/See also/
235 <ref id="_heapmaxavail" name="_heapmaxavail">,
236 <ref id="_heapmemavail" name="_heapmemavail">,
237 <ref id="calloc" name="calloc">,
238 <ref id="free" name="free">,
239 <ref id="malloc" name="malloc">,
240 <ref id="realloc" name="realloc">
241 <tag/Example/None.
242 </descrip>
243 </quote>
244
245
246 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
247
248 <quote>
249 <descrip>
250 <tag/Function/Return the largest block that is available on the heap.
251 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
252 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
253 <tag/Description/The function returns the size of the largest block that may
254 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
255 <tag/Availability/cc65
256 <tag/See also/
257 <ref id="_heapadd" name="_heapadd">,
258 <ref id="_heapmemavail" name="_heapmemavail">,
259 <ref id="calloc" name="calloc">,
260 <ref id="free" name="free">,
261 <ref id="malloc" name="malloc">,
262 <ref id="realloc" name="realloc">
263 <tag/Example/None.
264 </descrip>
265 </quote>
266
267
268 <sect1>_heapmemavail<label id="_heapmemavail"><p>
269
270 <quote>
271 <descrip>
272 <tag/Function/Return the total available space on the heap.
273 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
274 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
275 <tag/Description/The function returns the total number of bytes available on
276 the heap.
277 <tag/Limits/
278 <itemize>
279 <item>This function is of less use than usually assumed, since the returned
280 heap space may be available but not in one block. So even if this function
281 says that several times more heap space is available than needed, <ref
282 id="malloc" name="malloc"> may still return <tt/NULL/.
283 </itemize>
284 <tag/Availability/cc65
285 <tag/See also/
286 <ref id="_heapadd" name="_heapadd">,
287 <ref id="_heapmaxavail" name="_heapmaxavail">,
288 <ref id="calloc" name="calloc">,
289 <ref id="free" name="free">,
290 <ref id="malloc" name="malloc">,
291 <ref id="realloc" name="realloc">
292 <tag/Example/None.
293 </descrip>
294 </quote>
295
296
297 <sect1>_randomize<label id="_randomize"><p>
298
299 <quote>
300 <descrip>
301 <tag/Function/Initialize the pseudo random number generator.
302 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
303 <tag/Declaration/<tt/void _randomize (void);/
304 <tag/Description/The function initializes the random number generator with
305 a seed derived from fast changing hardware events, so the seed itself can be
306 considered random to a certain degree.
307 <tag/Limits/<itemize>
308 <item>The randomness of the seed depends on the machine hardware.
309 </itemize>
310 <tag/Availability/cc65
311 <tag/See also/
312 <ref id="rand" name="rand">,
313 <ref id="srand" name="srand">
314 <tag/Example/None.
315 </descrip>
316 </quote>
317
318
319 <sect1>_sys<label id="_sys"><p>
320
321 <quote>
322 <descrip>
323 <tag/Function/Call a subroutine passing register values.
324 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
325 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
326 <tag/Description/The function will call the subroutine at the address
327 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
328 registers and the CPU flags are set to the values given in the <tt/regs/
329 structure. On return from the subroutine, the new values of the registers and
330 flags are stored back overwriting the old values.
331 <tag/Limits/<itemize>
332 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
333 when calling the subroutine (they are unchanged from their current values).
334 <item>The function is only available as fastcall function, so it may only be
335 used in presence of a prototype.
336 </itemize>
337 <tag/Availability/cc65
338 <tag/Example/None.
339 </descrip>
340 </quote>
341
342
343 <sect1>BRK<label id="BRK"><p>
344
345 <quote>
346 <descrip>
347 <tag/Function/Insert a 6502 BRK instrunction into the code.
348 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
349 <tag/Declaration/<tt/void BRK (void);/
350 <tag/Description/The function will insert a 6502 BRK instruction into the code
351 which may be used to trigger a debugger.
352 <tag/Limits/<itemize>
353 <item>The function is actually a macro.
354 <item>The inserted instruction may lead to unexpected results if no debugger
355 is present.
356 </itemize>
357 <tag/Availability/cc65
358 <tag/See also/
359 <ref id="CLI" name="CLI">,
360 <ref id="SEI" name="SEI">
361 <tag/Example/None.
362 </descrip>
363 </quote>
364
365
366 <sect1>CLI<label id="CLI"><p>
367
368 <quote>
369 <descrip>
370 <tag/Function/Insert a 6502 CLI instrunction into the code.
371 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
372 <tag/Declaration/<tt/void CLI (void);/
373 <tag/Description/The function will insert a 6502 CLI instruction into the code,
374 so interrupts are disabled. Note that non maskable interrupts cannot be
375 disabled.
376 <tag/Limits/<itemize>
377 <item>The function is actually a macro.
378 <item>Disabling interrupts may lead to unexpected results.
379 </itemize>
380 <tag/Availability/cc65
381 <tag/See also/
382 <ref id="BRK" name="BRK">,
383 <ref id="SEI" name="SEI">
384 <tag/Example/None.
385 </descrip>
386 </quote>
387
388
389 <sect1>SEI<label id="SEI"><p>
390
391 <quote>
392 <descrip>
393 <tag/Function/Insert a 6502 SEI instrunction into the code.
394 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
395 <tag/Declaration/<tt/void SEI (void);/
396 <tag/Description/The function will insert a 6502 SEI instruction into the code,
397 so interrupts are enabled. Enabling interrupts has no effects if they are
398 already enabled (the default).
399 <tag/Limits/<itemize>
400 <item>The function is actually a macro.
401 </itemize>
402 <tag/Availability/cc65
403 <tag/See also/
404 <ref id="BRK" name="BRK">,
405 <ref id="CLI" name="CLI">
406 <tag/Example/None.
407 </descrip>
408 </quote>
409
410
411 <sect1>abort<label id="abort"><p>
412
413 <quote>
414 <descrip>
415 <tag/Function/Terminates a program abnormally.
416 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
417 <tag/Declaration/<tt/void abort (void);/
418 <tag/Description/<tt/abort/ writes a termination message on stderr, then
419 terminates the program with an exit code of 3.
420 <tag/Availability/ISO 9899
421 <tag/See also/
422 <ref id="assert" name="assert">,
423 <ref id="exit" name="exit">
424 <tag/Example/None.
425 </descrip>
426 </quote>
427
428
429 <sect1>abs<label id="abs"><p>
430
431 <quote>
432 <descrip>
433 <tag/Function/Returns the absolute value of an integer.
434 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
435 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
436 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
437 the function.
438 <tag/Limits/<itemize>
439 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
440 <item>The function is only available as fastcall function, so it may only be
441 used in presence of a prototype.
442 </itemize>
443 <tag/Availability/ISO 9899
444 <tag/See also/
445 <ref id="labs" name="labs">
446 <tag/Example/None.
447 </descrip>
448 </quote>
449
450
451 <sect1>assert<label id="assert"><p>
452
453 <quote>
454 <descrip>
455 <tag/Function/Test a condition and possibly abort.
456 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
457 <tag/Declaration/<tt/void assert (int cond);/
458 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
459 statement. If the condition evaluates t zero (false), assert prints a message
460 on stderr and aborts the program.
461 <tag/Limits/<itemize>
462 <item>The function is actually a macro.
463 </itemize>
464 <tag/Availability/ISO 9899
465 <tag/See also/
466 <ref id="abort" name="abort">,
467 <ref id="exit" name="exit">
468 <tag/Example/None.
469 </descrip>
470 </quote>
471
472
473 <sect1>atexit<label id="atexit"><p>
474
475 <quote>
476 <descrip>
477 <tag/Function/Register an exit function.
478 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
479 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
480 <tag/Description/<tt/atexit/ registers the function pointed to by
481 <tt/exitfunc/ as an exit function. Exit functions are called when the program
482 terminates, they are called in LIFO order (the last function registered is
483 called first). <tt/atexit/ returns zero on success and a nonzero value on
484 failure.
485 <tag/Limits/<itemize>
486 <item>A maximum of 5 exit functions can be registered.
487 <item>There is no way to unregister an exit function.
488 <item>The function is only available as fastcall function, so it may only be
489 used in presence of a prototype.
490 </itemize>
491 <tag/Availability/ISO 9899
492 <tag/See also/
493 <ref id="abort" name="abort">,
494 <ref id="exit" name="exit">
495 <tag/Example/None.
496 </descrip>
497 </quote>
498
499
500 <sect1>bgcolor<label id="bgcolor"><p>
501
502 <quote>
503 <descrip>
504 <tag/Function/Set the background text color.
505 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
506 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
507 <tag/Description/The function will set a new background text color. It returns
508 the old (current) background color.
509 <tag/Limits/<itemize>
510 <item>Background colors are system dependent. The function may have no effect
511 on systems where the background color cannot be changed.
512 <item>The function is only available as fastcall function, so it may only be
513 used in presence of a prototype.
514 </itemize>
515 <tag/Availability/cc65
516 <tag/See also/
517 <ref id="bordercolor" name="bordercolor">,
518 <ref id="textcolor" name="textcolor">
519 <tag/Example/None.
520 </descrip>
521 </quote>
522
523
524 <sect1>bordercolor<label id="bordercolor"><p>
525
526 <quote>
527 <descrip>
528 <tag/Function/Set the border (frame) color.
529 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
530 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
531 <tag/Description/The function will set a new border color. It returns the old
532 (current) border color.
533 <tag/Limits/<itemize>
534 <item>Border colors are system dependent. The function may have no effect
535 on systems where the border color cannot be changed.
536 <item>The function is only available as fastcall function, so it may only
537 be used in presence of a prototype.
538 </itemize>
539 <tag/Availability/cc65
540 <tag/See also/
541 <ref id="bgcolor" name="bgcolor">,
542 <ref id="textcolor" name="textcolor">
543 <tag/Example/None.
544 </descrip>
545 </quote>
546
547
548 <sect1>c64mode<label id="c64mode"><p>
549
550 <quote>
551 <descrip>
552 <tag/Function/Switch the C128 into C64 compatible mode.
553 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
554 <tag/Declaration/<tt/void c64mode (void);/
555 <tag/Description/The function will cause the machine to reboot into C64 mode.
556 <tag/Limits/<itemize>
557 <item>The function is specific to the C128.
558 <item>The function will not return to the caller.
559 </itemize>
560 <tag/Availability/C128
561 <tag/Example/None.
562 </descrip>
563 </quote>
564
565
566 <sect1>calloc<label id="calloc"><p>
567
568 <quote>
569 <descrip>
570 <tag/Function/Allocate and clear memory.
571 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
572 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
573 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
574 of size <tt/size/, clears the whole block with binary zeroes and returns a
575 pointer to it. On error (not enough memory available), <tt/calloc/ returns
576 <tt/NULL/.
577 <tag/Limits/
578 <itemize>
579 <item>Clearing the memory may not have the expected effect on all platforms:
580 pointers in the block may not be <tt/NULL/ and floating point variables may
581 not be zero (0.0). In other words: The "clearing" effect of this function
582 should be used with care for portable programs.
583 <item>The function is only available as fastcall function, so it may only
584 be used in presence of a prototype.
585 </itemize>
586 <tag/Availability/ISO 9899
587 <tag/See also/
588 <ref id="_heapadd" name="_heapadd">,
589 <ref id="_heapmaxavail" name="_heapmaxavail">,
590 <ref id="_heapmemavail" name="_heapmemavail">,
591 <ref id="free" name="free">,
592 <ref id="malloc" name="malloc">,
593 <ref id="realloc" name="realloc">
594 <tag/Example/None.
595 </descrip>
596 </quote>
597
598
599 <sect1>cclear<label id="cclear"><p>
600
601 <quote>
602 <descrip>
603 <tag/Function/Clear part of a line (write a given amount of spaces).
604 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
605 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
606 <tag/Description/The function clears part of a line by writing <tt/length/
607 spaces in the current text color.
608 <tag/Limits/<itemize>
609 <item>The function is only available as fastcall function, so it may
610 only be used in presence of a prototype.
611 </itemize>
612 <tag/Availability/cc65
613 <tag/See also/
614 <ref id="cclearxy" name="cclearxy">,
615 <ref id="clrscr" name="clrscr">
616 <tag/Example/None.
617 </descrip>
618 </quote>
619
620
621 <sect1>cclearxy<label id="cclearxy"><p>
622
623 <quote>
624 <descrip>
625 <tag/Function/Clear part of a line (write a given amount of spaces) starting
626 at a specific screen position.
627 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
628 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
629 <tag/Description/The function moves the cursor to a specific position, and
630 will then clear part of the line by writing <tt/length/ spaces in the current
631 text color.
632 <tag/Limits/<itemize>
633 <item>The function is only available as fastcall function, so it may
634 only be used in presence of a prototype.
635 </itemize>
636 <tag/Availability/cc65
637 <tag/See also/
638 <ref id="cclear" name="cclear">,
639 <ref id="clrscr" name="clrscr">
640 <tag/Example/None.
641 </descrip>
642 </quote>
643
644
645 <sect1>cgetc<label id="cgetc"><p>
646
647 <quote>
648 <descrip>
649 <tag/Function/Read a character from the keyboard.
650 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
651 <tag/Declaration/<tt/char cgetc (void);/
652 <tag/Description/The function reads a character from the keyboard. If there is
653 no character available, <tt/cgetc/ waits until the user presses a key. If the
654 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
655 displayed while waiting.
656 <tag/Limits/<itemize>
657 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
658 from this buffer and wait only if the buffer is empty.
659 </itemize>
660 <tag/Availability/cc65
661 <tag/See also/
662 <ref id="cursor" name="cursor">,
663 <ref id="kbhit" name="kbhit">
664 <tag/Example/None.
665 </descrip>
666 </quote>
667
668
669 <sect1>chline<label id="chline"><p>
670
671 <quote>
672 <descrip>
673 <tag/Function/Output a horizontal line in text mode.
674 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
675 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
676 <tag/Description/The function outputs a horizontal line with the given length
677 starting at the current cursor position.
678 <tag/Limits/<itemize>
679 <item>The character used to draw the horizontal line is system dependent.
680 If available, a line drawing character is used. Drawing a line that is partially
681 off screen leads to undefined behaviour.
682 <item>The function is only available as fastcall function, so it may only be
683 used in presence of a prototype.
684 </itemize>
685 <tag/Availability/cc65
686 <tag/See also/
687 <ref id="chlinexy" name="chlinexy">,
688 <ref id="cvline" name="cvline">,
689 <ref id="cvlinexy" name="cvlinexy">
690 <tag/Example/None.
691 </descrip>
692 </quote>
693
694
695 <sect1>chlinexy<label id="chlinexy"><p>
696
697 <quote>
698 <descrip>
699 <tag/Function/Output a horizontal line at a given position in text mode.
700 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
701 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
702 <tag/Description/The function outputs a horizontal line with the given length
703 starting at a given position.
704 <tag/Limits/<itemize>
705 <item>The character used to draw the horizontal line is system dependent.
706 If available, a line drawing character is used. Drawing a line that is partially
707 off screen leads to undefined behaviour.
708 <item>The function is only available as fastcall function, so it may only be
709 used in presence of a prototype.
710 </itemize>
711 <tag/Availability/cc65
712 <tag/See also/
713 <ref id="chline" name="chline">,
714 <ref id="cvline" name="cvline">,
715 <ref id="cvlinexy" name="cvlinexy">
716 <tag/Example/None.
717 </descrip>
718 </quote>
719
720
721 <sect1>clrscr<label id="clrscr"><p>
722
723 <quote>
724 <descrip>
725 <tag/Function/Clear the text screen.
726 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
727 <tag/Declaration/<tt/void clrscr (void);/
728 <tag/Description/The function clears the text screen and moves the cursor to
729 the upper left corner.
730 <tag/Availability/cc65
731 <tag/See also/
732 <ref id="cclear" name="cclear">,
733 <ref id="cclearxy" name="cclearxy">
734 <tag/Example/None.
735 </descrip>
736 </quote>
737
738
739 <sect1>cursor<label id="cursor"><p>
740
741 <quote>
742 <descrip>
743 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
744 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
745 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
746 <tag/Description/If the argument to the function is non zero, a blinking cursor
747 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
748 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
749 <tag/Limits/<itemize>
750 <item>The function is only available as fastcall function, so it may only
751 be used in presence of a prototype.
752 </itemize>
753 <tag/Availability/cc65
754 <tag/See also/
755 <ref id="cgetc" name="cgetc">,
756 <ref id="kbhit" name="kbhit">
757 <tag/Example/None.
758 </descrip>
759 </quote>
760
761
762 <sect1>cvline<label id="cvline"><p>
763
764 <quote>
765 <descrip>
766 <tag/Function/Output a vertical line in text mode.
767 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
768 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
769 <tag/Description/The function outputs a vertical line with the given length
770 starting at the current cursor position.
771 <tag/Limits/<itemize>
772 <item>The character used to draw the vertical line is system dependent.
773 If available, a line drawing character is used. Drawing a line that is partially
774 off screen leads to undefined behaviour.
775 <item>The function is only available as fastcall function, so it may only be
776 used in presence of a prototype.
777 </itemize>
778 <tag/Availability/cc65
779 <tag/See also/
780 <ref id="chline" name="chline">,
781 <ref id="chlinexy" name="chlinexy">,
782 <ref id="cvlinexy" name="cvlinexy">
783 <tag/Example/None.
784 </descrip>
785 </quote>
786
787
788 <sect1>cvlinexy<label id="cvlinexy"><p>
789
790 <quote>
791 <descrip>
792 <tag/Function/Output a vertical line at a given position in text mode.
793 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
794 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
795 <tag/Description/The function outputs a vertical line with the given length
796 starting at a given position.
797 <tag/Limits/<itemize>
798 <item>The character used to draw the vertical line is system dependent.
799 If available, a line drawing character is used. Drawing a line that is partially
800 off screen leads to undefined behaviour.
801 <item>The function is only available as fastcall function, so it may only be
802 used in presence of a prototype.
803 </itemize>
804 <tag/Availability/cc65
805 <tag/See also/
806 <ref id="chline" name="chline">,
807 <ref id="chlinexy" name="chlinexy">,
808 <ref id="cvline" name="cvline">
809 <tag/Example/None.
810 </descrip>
811 </quote>
812
813
814 <sect1>em_commit<label id="em_commit"><p>
815
816 <quote>
817 <descrip>
818 <tag/Function/Commit changes into extended memory.
819 <tag/Header/<tt/<ref id="em.h" name="em.h">/
820 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
821 <tag/Description/Commit changes in the memory window to extended storage. If
822 the contents of the memory window have been changed, these changes may be lost
823 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
824 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
825 name="em_copyto">/ are called without calling <tt/em_commit/ first.
826 <tag/Limits/<itemize>
827 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
828 memory window are discarded, it does just mean that the drivers is allowed
829 to discard it.
830 <item>The function is only available as fastcall function, so it may only be
831 used in presence of a prototype.
832 <item>The function produces undefined results if no extended memory driver is
833 loaded.
834 </itemize>
835 <tag/Availability/cc65
836 <tag/See also/
837 <ref id="em_load_driver" name="em_load_driver">,
838 <ref id="em_map" name="em_map">,
839 <ref id="em_use" name="em_use">
840 <tag/Example/None.
841 </descrip>
842 </quote>
843
844
845 <sect1>em_copyfrom<label id="em_copyfrom"><p>
846
847 <quote>
848 <descrip>
849 <tag/Function/Copy from extended into normal memory.
850 <tag/Header/<tt/<ref id="em.h" name="em.h">/
851 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
852 <tag/Description/Copy data from extended memory into linear memory. Source and
853 target addresses as well as the number of bytes to transfer are specified in
854 the <tt/em_copy/ structure that is passed as a parameter.
855 <tag/Limits/<itemize>
856 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
857 made any changes to the data in the window, call <tt/<ref id="em_commit"
858 name="em_commit">/ first, or the changes are lost.
859 <item>The function is only available as fastcall function, so it may only be
860 used in presence of a prototype.
861 <item>The function produces undefined results if no extended memory driver is
862 loaded.
863 </itemize>
864 <tag/Availability/cc65
865 <tag/See also/
866 <ref id="em_commit" name="em_commit">,
867 <ref id="em_copyto" name="em_copyto">,
868 <ref id="em_load_driver" name="em_load_driver">
869 <tag/Example/None.
870 </descrip>
871 </quote>
872
873
874 <sect1>em_copyto<label id="em_copyto"><p>
875
876 <quote>
877 <descrip>
878 <tag/Function/Copy from normal into extended memory.
879 <tag/Header/<tt/<ref id="em.h" name="em.h">/
880 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
881 <tag/Description/Copy data from linear into extended memory. Source and
882 target addresses as well as the number of bytes to transfer are specified in
883 the <tt/em_copy/ structure that is passed as a parameter.
884 <tag/Limits/<itemize>
885 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
886 made any changes to the data in the window, call <tt/<ref id="em_commit"
887 name="em_commit">/ first, or the changes are lost.
888 <item>The function is only available as fastcall function, so it may only be
889 used in presence of a prototype.
890 <item>The function produces undefined results if no extended memory driver is
891 loaded.
892 </itemize>
893 <tag/Availability/cc65
894 <tag/See also/
895 <ref id="em_commit" name="em_commit">,
896 <ref id="em_copyfrom" name="em_copyfrom">,
897 <ref id="em_load_driver" name="em_load_driver">
898 <tag/Example/None.
899 </descrip>
900 </quote>
901
902
903 <sect1>em_load_driver<label id="em_load_driver"><p>
904
905 <quote>
906 <descrip>
907 <tag/Function/Load and initialize an extended memory driver.
908 <tag/Header/<tt/<ref id="em.h" name="em.h">/
909 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
910 <tag/Description/Load an extended memory driver into memory and initialize
911 it. The function returns an error code that tells if all this has been
912 successful.
913 <tag/Limits/<itemize>
914 <item>Not all drivers are able to detect if the supported hardware is really
915 present.
916 <item>The function is only available as fastcall function, so it may only be
917 used in presence of a prototype.
918 <item>The driver is loaded by name, so currently you must know the type of
919 extended memory that should be supported. There is no autodetect capability.
920 </itemize>
921 <tag/Availability/cc65
922 <tag/See also/
923 <ref id="em_unload" name="em_unload">
924 <tag/Example/None.
925 </descrip>
926 </quote>
927
928
929 <sect1>em_map<label id="em_map"><p>
930
931 <quote>
932 <descrip>
933 <tag/Function/Make a page of extended memory accessible.
934 <tag/Header/<tt/<ref id="em.h" name="em.h">/
935 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
936 <tag/Description/The function maps one page of extended memory into linear
937 memory and returns a pointer to the page frame. Depending on the hardware
938 and driver, the data is either mapped into the address space or transfered
939 into a buffer. If you don't need the actual contents of the page (for example
940 because you're going to overwrite it completely, it is better to call
941 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
942 data if it is possible to avoid that.
943 <tag/Limits/<itemize>
944 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
945 made any changes to the data in the window, call <tt/<ref id="em_commit"
946 name="em_commit">/ first, or the changes are lost.
947 <item>The function is only available as fastcall function, so it may only be
948 used in presence of a prototype.
949 <item>The function produces undefined results if no extended memory driver is
950 loaded.
951 </itemize>
952 <tag/Availability/cc65
953 <tag/See also/
954 <ref id="em_commit" name="em_commit">,
955 <ref id="em_load_driver" name="em_load_driver">,
956 <ref id="em_use" name="em_use">
957 <tag/Example/None.
958 </descrip>
959 </quote>
960
961
962 <sect1>em_pagecount<label id="em_pagecount"><p>
963
964 <quote>
965 <descrip>
966 <tag/Function/Return the number of available extended memory pages.
967 <tag/Header/<tt/<ref id="em.h" name="em.h">/
968 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
969 <tag/Description/The function returns the size of the extended memory supported
970 by the driver in 256 byte pages.
971 <tag/Limits/<itemize>
972 <item>The function returns zero if no extended memory driver is loaded.
973 <item>The function may return zero if the supported hardware was not detected.
974 </itemize>
975 <tag/Availability/cc65
976 <tag/See also/
977 <ref id="em_load_driver" name="em_load_driver">
978 <tag/Example/None.
979 </descrip>
980 </quote>
981
982
983 <sect1>em_unload<label id="em_unload"><p>
984
985 <quote>
986 <descrip>
987 <tag/Function/Unload an extended memory driver.
988 <tag/Header/<tt/<ref id="em.h" name="em.h">/
989 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
990 <tag/Description/The function unloads a loaded extended memory driver and
991 frees all memory allocated for the driver.
992 <tag/Limits/<itemize>
993 <item>The function does nothing if no driver is loaded.
994 </itemize>
995 <tag/Availability/cc65
996 <tag/See also/
997 <ref id="em_load_driver" name="em_load_driver">
998 <tag/Example/None.
999 </descrip>
1000 </quote>
1001
1002
1003 <sect1>em_use<label id="em_use"><p>
1004
1005 <quote>
1006 <descrip>
1007 <tag/Function/Prepare an extended memory page for use.
1008 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1009 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1010 <tag/Description/The function maps one page of extended memory into linear
1011 memory and returns a pointer to the page frame. This function is similar to
1012 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1013 actual memory window in the assumption that the existing data is wrong or
1014 will get overwritten.
1015 <tag/Limits/<itemize>
1016 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1017 made any changes to the data in the window, call <tt/<ref id="em_commit"
1018 name="em_commit">/ first, or the changes are lost.
1019 <item>The function is only available as fastcall function, so it may only be
1020 used in presence of a prototype.
1021 <item>The function produces undefined results if no extended memory driver is
1022 loaded.
1023 </itemize>
1024 <tag/Availability/cc65
1025 <tag/See also/
1026 <ref id="em_commit" name="em_commit">,
1027 <ref id="em_load_driver" name="em_load_driver">,
1028 <ref id="em_map" name="em_map">
1029 <tag/Example/None.
1030 </descrip>
1031 </quote>
1032
1033
1034 <sect1>exit<label id="exit"><p>
1035
1036 <quote>
1037 <descrip>
1038 <tag/Function/Terminate the program.
1039 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1040 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1041 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1042 return code of the program. Before termination, all files are closed, buffered
1043 output is written and any functions registered with <tt/<ref id="atexit"
1044 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1045 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1046 name="stdlib.h">/.
1047 <tag/Limits/<itemize>
1048 <item>The function is only available as fastcall function, so it may only
1049 be used in presence of a prototype.
1050 <item>It depends on the host machine if the program return code can be
1051 evaluated or is ignored.
1052 </itemize>
1053 <tag/Availability/ISO 9899
1054 <tag/See also/
1055 <ref id="abort" name="abort">,
1056 <ref id="exit" name="exit">
1057 <tag/Example/None.
1058 </descrip>
1059 </quote>
1060
1061
1062 <sect1>fast<label id="fast"><p>
1063
1064 <quote>
1065 <descrip>
1066 <tag/Function/Switch the C128 into 2MHz mode.
1067 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1068 <tag/Declaration/<tt/void fast (void);/
1069 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1070 will nearly double the speed compared to slow mode.
1071 <tag/Limits/<itemize>
1072 <item>The function is specific to the C128.
1073 <item>2MHz clock will not work in 40 column mode.
1074 </itemize>
1075 <tag/Availability/C128
1076 <tag/See also/
1077 <ref id="slow" name="slow">,
1078 <ref id="toggle_videomode" name="toggle_videomode">
1079 <tag/Example/None.
1080 </descrip>
1081 </quote>
1082
1083
1084 <sect1>free<label id="free"><p>
1085
1086 <quote>
1087 <descrip>
1088 <tag/Function/Free a block of dynamic memory.
1089 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1090 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
1091 <tag/Description/Free a block of dynamic memory previously allocated with
1092 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
1093 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
1094 pointer is <tt/NULL/, no action is performed.
1095 <tag/Limits/
1096 <itemize>
1097 <item>Passing an already free'd block to <tt/free/ again will cause undefined
1098 behaviour and may crash your program.
1099 <item>The function is only available as fastcall function, so it may only
1100 be used in presence of a prototype.
1101 </itemize>
1102 <tag/Availability/ISO 9899
1103 <tag/See also/
1104 <ref id="_heapadd" name="_heapadd">,
1105 <ref id="_heapmaxavail" name="_heapmaxavail">,
1106 <ref id="_heapmemavail" name="_heapmemavail">,
1107 <ref id="calloc" name="calloc">,
1108 <ref id="malloc" name="malloc">,
1109 <ref id="realloc" name="realloc">
1110 <tag/Example/None.
1111 </descrip>
1112 </quote>
1113
1114
1115 <sect1>getcpu<label id="getcpu"><p>
1116
1117 <quote>
1118 <descrip>
1119 <tag/Function/Determine on which CPU the program is running.
1120 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
1121 <tag/Declaration/<tt/unsigned char getcpu (void);/
1122 <tag/Description/The function checks on which CPU the code is running. It
1123 returns one of the constants<itemize>
1124 <item><tt/CPU_6502/
1125 <item><tt/CPU_65C02/
1126 <item><tt/CPU_65816/
1127 </itemize>
1128 <tag/Limits/<itemize>
1129 <item>Other, more exotic CPU types are not disinguished.
1130 </itemize>
1131 <tag/Availability/cc65
1132 <tag/Example/None.
1133 </descrip>
1134 </quote>
1135
1136
1137 <sect1>gotox<label id="gotox"><p>
1138
1139 <quote>
1140 <descrip>
1141 <tag/Function/Move the text mode cursor to a new X position.
1142 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1143 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
1144 <tag/Description/The function moves the text mode cursor to the specified X
1145 position while leaving the Y position untouched. The leftmost position on the
1146 screen has the coordinate 0.
1147 <tag/Limits/<itemize>
1148 <item>The function is only available as fastcall function, so it may
1149 only be used in presence of a prototype.
1150 <item>Invalid values for the X position (out of screen coordinates) may
1151 lead to undefined behaviour.
1152 </itemize>
1153 <tag/Availability/cc65
1154 <tag/See also/
1155 <ref id="gotoy" name="gotoy">,
1156 <ref id="gotoxy" name="gotoxy">,
1157 <ref id="wherex" name="wherex">,
1158 <ref id="wherey" name="wherey">
1159 <tag/Example/None.
1160 </descrip>
1161 </quote>
1162
1163
1164 <sect1>gotoxy<label id="gotoxy"><p>
1165
1166 <quote>
1167 <descrip>
1168 <tag/Function/Move the text mode cursor to a new position.
1169 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1170 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
1171 <tag/Description/The function moves the text mode cursor to the specified
1172 position. The leftmost position on the screen has the X coordinate 0, the
1173 topmost line has the Y coordinate 0.
1174 <tag/Limits/<itemize>
1175 <item>The function is only available as fastcall function, so it may only be
1176 used in presence of a prototype.
1177 <item>Invalid values for any of both coordinates (out of screen positions) may
1178 lead to undefined behaviour.
1179 </itemize>
1180 <tag/Availability/cc65
1181 <tag/See also/
1182 <ref id="gotox" name="gotox">,
1183 <ref id="gotoy" name="gotoy">,
1184 <ref id="wherex" name="wherex">,
1185 <ref id="wherey" name="wherey">
1186 <tag/Example/None.
1187 </descrip>
1188 </quote>
1189
1190
1191 <sect1>gotoy<label id="gotoy"><p>
1192
1193 <quote>
1194 <descrip>
1195 <tag/Function/Move the text mode cursor to a new Y position.
1196 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1197 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
1198 <tag/Description/The function moves the text mode cursor to the specified Y
1199 position while leaving the X position untouched. The uppermost position on the
1200 screen has the coordinate 0.
1201 <tag/Limits/<itemize>
1202 <item>The function is only available as fastcall function, so it may
1203 only be used in presence of a prototype.
1204 <item>Invalid values for the Y position (out of screen coordinates) may lead
1205 to undefined behaviour.
1206 </itemize>
1207 <tag/Availability/cc65
1208 <tag/See also/
1209 <ref id="gotox" name="gotox">,
1210 <ref id="gotoxy" name="gotoxy">,
1211 <ref id="wherex" name="wherex">,
1212 <ref id="wherey" name="wherey">
1213 <tag/Example/None.
1214 </descrip>
1215 </quote>
1216
1217
1218 <sect1>isalnum<label id="isalnum"><p>
1219
1220 <quote>
1221 <descrip>
1222 <tag/Function/Check if a given character is a letter or digit.
1223 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1224 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
1225 <tag/Description/The function returns a value of zero if the given argument
1226 is a letter or digit. The return value is non zero if the character
1227 is anything else.
1228 <tag/Limits/<itemize>
1229 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1230 inline sequence generated by the macro will not work correctly for values
1231 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1232 this range. The non inline function may be accessed by <tt/#undef/'ing
1233 the macro.
1234 <item>When compiling without <tt/-Os/, the function is only available as
1235 fastcall function, so it may only be used in presence of a prototype.
1236 </itemize>
1237 <tag/Availability/ISO 9899
1238 <tag/See also/
1239 <ref id="isalpha" name="isalpha">,
1240 <ref id="isascii" name="isascii">,
1241 <ref id="isblank" name="isblank">,
1242 <ref id="iscntrl" name="iscntrl">,
1243 <ref id="isdigit" name="isdigit">,
1244 <ref id="isgraph" name="isgraph">,
1245 <ref id="islower" name="islower">,
1246 <ref id="isprint" name="isprint">,
1247 <ref id="ispunct" name="ispunct">,
1248 <ref id="isspace" name="isspace">,
1249 <ref id="isupper" name="isupper">,
1250 <ref id="isxdigit" name="isxdigit">
1251 <tag/Example/None.
1252 </descrip>
1253 </quote>
1254
1255
1256 <sect1>isalpha<label id="isalpha"><p>
1257
1258 <quote>
1259 <descrip>
1260 <tag/Function/Check if a given character is a letter.
1261 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1262 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
1263 <tag/Description/The function returns a value of zero if the given argument
1264 is a letter. The return value is non zero if the character is anything else.
1265 <tag/Limits/<itemize>
1266 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1267 inline sequence generated by the macro will not work correctly for values
1268 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1269 this range. The non inline function may be accessed by <tt/#undef/'ing the
1270 macro.
1271 <item>When compiling without <tt/-Os/, the function is only available as
1272 fastcall function, so it may only be used in presence of a prototype.
1273 </itemize>
1274 <tag/Availability/ISO 9899
1275 <tag/See also/
1276 <ref id="isalnum" name="isalnum">,
1277 <ref id="isascii" name="isascii">,
1278 <ref id="isblank" name="isblank">,
1279 <ref id="iscntrl" name="iscntrl">,
1280 <ref id="isdigit" name="isdigit">,
1281 <ref id="isgraph" name="isgraph">,
1282 <ref id="islower" name="islower">,
1283 <ref id="isprint" name="isprint">,
1284 <ref id="ispunct" name="ispunct">,
1285 <ref id="isspace" name="isspace">,
1286 <ref id="isupper" name="isupper">,
1287 <ref id="isxdigit" name="isxdigit">
1288 <tag/Example/None.
1289 </descrip>
1290 </quote>
1291
1292
1293 <sect1>isascii<label id="isascii"><p>
1294
1295 <quote>
1296 <descrip>
1297 <tag/Function/Check if a given character is in the ASCII (0..127) range.
1298 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1299 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
1300 <tag/Description/The function returns a value of zero if the given argument
1301 is in the range 0..127 (the range of valid ASCII characters) and a non zero
1302 value if not.
1303 <tag/Limits/<itemize>
1304 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1305 inline sequence generated by the macro will not work correctly for values
1306 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1307 this range. The non inline function may be accessed by <tt/#undef/'ing the
1308 macro.
1309 <item>When compiling without <tt/-Os/, the function is only available as
1310 fastcall function, so it may only be used in presence of a prototype.
1311 </itemize>
1312 <tag/Availability/ISO 9899
1313 <tag/See also/
1314 <ref id="isalnum" name="isalnum">,
1315 <ref id="isalpha" name="isalpha">,
1316 <ref id="isblank" name="isblank">,
1317 <ref id="iscntrl" name="iscntrl">,
1318 <ref id="isdigit" name="isdigit">,
1319 <ref id="isgraph" name="isgraph">,
1320 <ref id="islower" name="islower">,
1321 <ref id="isprint" name="isprint">,
1322 <ref id="ispunct" name="ispunct">,
1323 <ref id="isspace" name="isspace">,
1324 <ref id="isupper" name="isupper">,
1325 <ref id="isxdigit" name="isxdigit">
1326 <tag/Example/None.
1327 </descrip>
1328 </quote>
1329
1330
1331 <sect1>isblank<label id="isblank"><p>
1332
1333 <quote>
1334 <descrip>
1335 <tag/Function/Check if a given character is a space or tab.
1336 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1337 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1338 <tag/Description/The function returns a value of zero if the given argument
1339 is a blank or space character. The return value is non zero if the character
1340 is anything else.
1341 <tag/Limits/<itemize>
1342 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1343 inline sequence generated by the macro will not work correctly for values
1344 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1345 this range. The non inline function may be accessed by <tt/#undef/'ing the
1346 macro.
1347 <item>When compiling without <tt/-Os/, the function is only available as
1348 fastcall function, so it may only be used in presence of a prototype.
1349 </itemize>
1350 <tag/Availability/cc65
1351 <tag/See also/
1352 <ref id="isalnum" name="isalnum">,
1353 <ref id="isalpha" name="isalpha">,
1354 <ref id="isascii" name="isascii">,
1355 <ref id="iscntrl" name="iscntrl">,
1356 <ref id="isdigit" name="isdigit">,
1357 <ref id="isgraph" name="isgraph">,
1358 <ref id="islower" name="islower">,
1359 <ref id="isprint" name="isprint">,
1360 <ref id="ispunct" name="ispunct">,
1361 <ref id="isspace" name="isspace">,
1362 <ref id="isupper" name="isupper">,
1363 <ref id="isxdigit" name="isxdigit">
1364 <tag/Example/None.
1365 </descrip>
1366 </quote>
1367
1368
1369 <sect1>iscntrl<label id="iscntrl"><p>
1370
1371 <quote>
1372 <descrip>
1373 <tag/Function/Check if a given character is a control character.
1374 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1375 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1376 <tag/Description/The function returns a value of zero if the given argument
1377 is a control character. The return value is non zero if the character
1378 is anything else.
1379 <tag/Limits/<itemize>
1380 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1381 inline sequence generated by the macro will not work correctly for values
1382 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1383 this range. The non inline function may be accessed by <tt/#undef/'ing the
1384 macro.
1385 <item>When compiling without <tt/-Os/, the function is only available as
1386 fastcall function, so it may only be used in presence of a prototype.
1387 </itemize>
1388 <tag/Availability/ISO 9899
1389 <tag/See also/
1390 <ref id="isalnum" name="isalnum">,
1391 <ref id="isalpha" name="isalpha">,
1392 <ref id="isascii" name="isascii">,
1393 <ref id="isblank" name="isblank">,
1394 <ref id="isdigit" name="isdigit">,
1395 <ref id="isgraph" name="isgraph">,
1396 <ref id="islower" name="islower">,
1397 <ref id="isprint" name="isprint">,
1398 <ref id="ispunct" name="ispunct">,
1399 <ref id="isspace" name="isspace">,
1400 <ref id="isupper" name="isupper">,
1401 <ref id="isxdigit" name="isxdigit">
1402 <tag/Example/None.
1403 </descrip>
1404 </quote>
1405
1406
1407 <sect1>isdigit<label id="isdigit"><p>
1408
1409 <quote>
1410 <descrip>
1411 <tag/Function/Check if a given character is a digit.
1412 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1413 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1414 <tag/Description/The function returns a value of zero if the given argument
1415 is a digit. The return value is non zero if the character is anything else.
1416 <tag/Limits/<itemize>
1417 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1418 inline sequence generated by the macro will not work correctly for values
1419 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1420 this range. The non inline function may be accessed by <tt/#undef/'ing the
1421 macro.
1422 <item>When compiling without <tt/-Os/, the function is only available as
1423 fastcall function, so it may only be used in presence of a prototype.
1424 </itemize>
1425 <tag/Availability/ISO 9899
1426 <tag/See also/
1427 <ref id="isalnum" name="isalnum">,
1428 <ref id="isalpha" name="isalpha">,
1429 <ref id="isascii" name="isascii">,
1430 <ref id="isblank" name="isblank">,
1431 <ref id="iscntrl" name="iscntrl">,
1432 <ref id="isgraph" name="isgraph">,
1433 <ref id="islower" name="islower">,
1434 <ref id="isprint" name="isprint">,
1435 <ref id="ispunct" name="ispunct">,
1436 <ref id="isspace" name="isspace">,
1437 <ref id="isupper" name="isupper">,
1438 <ref id="isxdigit" name="isxdigit">
1439 <tag/Example/None.
1440 </descrip>
1441 </quote>
1442
1443
1444 <sect1>isgraph<label id="isgraph"><p>
1445
1446 <quote>
1447 <descrip>
1448 <tag/Function/Check if a given character is a printable character (except
1449 space).
1450 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1451 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1452 <tag/Description/The function returns a value of zero if the given argument
1453 is a printable character with the exception of space. The return value is non
1454 zero if the character is anything else.
1455 <tag/Limits/<itemize>
1456 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1457 inline sequence generated by the macro will not work correctly for values
1458 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1459 this range. The non inline function may be accessed by <tt/#undef/'ing the
1460 macro.
1461 <item>When compiling without <tt/-Os/, the function is only available as
1462 fastcall function, so it may only be used in presence of a prototype.
1463 </itemize>
1464 <tag/Availability/ISO 9899
1465 <tag/See also/
1466 <ref id="isalnum" name="isalnum">,
1467 <ref id="isalpha" name="isalpha">,
1468 <ref id="isascii" name="isascii">,
1469 <ref id="isblank" name="isblank">,
1470 <ref id="iscntrl" name="iscntrl">,
1471 <ref id="isdigit" name="isdigit">,
1472 <ref id="islower" name="islower">,
1473 <ref id="isprint" name="isprint">,
1474 <ref id="ispunct" name="ispunct">,
1475 <ref id="isspace" name="isspace">,
1476 <ref id="isupper" name="isupper">,
1477 <ref id="isxdigit" name="isxdigit">
1478 <tag/Example/None.
1479 </descrip>
1480 </quote>
1481
1482
1483 <sect1>islower<label id="islower"><p>
1484
1485 <quote>
1486 <descrip>
1487 <tag/Function/Check if a given character is a lower case letter.
1488 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1489 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1490 <tag/Description/The function returns a value of zero if the given argument
1491 is a lower case letter. The return value is non zero if the character is
1492 anything else.
1493 <tag/Limits/<itemize>
1494 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1495 inline sequence generated by the macro will not work correctly for values
1496 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1497 this range. The non inline function may be accessed by <tt/#undef/'ing the
1498 macro.
1499 <item>When compiling without <tt/-Os/, the function is only available as
1500 fastcall function, so it may only be used in presence of a prototype.
1501 </itemize>
1502 <tag/Availability/ISO 9899
1503 <tag/See also/
1504 <ref id="isalnum" name="isalnum">,
1505 <ref id="isalpha" name="isalpha">,
1506 <ref id="isascii" name="isascii">,
1507 <ref id="isblank" name="isblank">,
1508 <ref id="iscntrl" name="iscntrl">,
1509 <ref id="isdigit" name="isdigit">,
1510 <ref id="isgraph" name="isgraph">,
1511 <ref id="isprint" name="isprint">,
1512 <ref id="ispunct" name="ispunct">,
1513 <ref id="isspace" name="isspace">,
1514 <ref id="isupper" name="isupper">,
1515 <ref id="isxdigit" name="isxdigit">
1516 <tag/Example/None.
1517 </descrip>
1518 </quote>
1519
1520
1521 <sect1>isprint<label id="isprint"><p>
1522
1523 <quote>
1524 <descrip>
1525 <tag/Function/Check if a given character is a printable character.
1526 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1527 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1528 <tag/Description/The function returns a value of zero if the given argument
1529 is a printable character (this includes the space character). The return value
1530 is non zero if the character is anything else.
1531 <tag/Limits/<itemize>
1532 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1533 inline sequence generated by the macro will not work correctly for values
1534 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1535 this range. The non inline function may be accessed by <tt/#undef/'ing the
1536 macro.
1537 <item>When compiling without <tt/-Os/, the function is only available as
1538 fastcall function, so it may only be used in presence of a prototype.
1539 </itemize>
1540 <tag/Availability/ISO 9899
1541 <tag/See also/
1542 <ref id="isalnum" name="isalnum">,
1543 <ref id="isalpha" name="isalpha">,
1544 <ref id="isascii" name="isascii">,
1545 <ref id="isblank" name="isblank">,
1546 <ref id="iscntrl" name="iscntrl">,
1547 <ref id="isdigit" name="isdigit">,
1548 <ref id="isgraph" name="isgraph">,
1549 <ref id="islower" name="islower">,
1550 <ref id="ispunct" name="ispunct">,
1551 <ref id="isspace" name="isspace">,
1552 <ref id="isupper" name="isupper">,
1553 <ref id="isxdigit" name="isxdigit">
1554 <tag/Example/None.
1555 </descrip>
1556 </quote>
1557
1558
1559 <sect1>ispunct<label id="ispunct"><p>
1560
1561 <quote>
1562 <descrip>
1563 <tag/Function/Check if a given character is a printable character but not a
1564 space or an alphanumeric character.
1565 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1566 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
1567 <tag/Description/The function returns a value of zero if the given argument
1568 is a printable character, but not a space or anything alphanumeric. The return
1569 value is non zero if the character is anything else.
1570 <tag/Limits/<itemize>
1571 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1572 inline sequence generated by the macro will not work correctly for values
1573 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1574 this range. The non inline function may be accessed by <tt/#undef/'ing the
1575 macro.
1576 <item>When compiling without <tt/-Os/, the function is only available as
1577 fastcall function, so it may only be used in presence of a prototype.
1578 </itemize>
1579 <tag/Availability/ISO 9899
1580 <tag/See also/
1581 <ref id="isalnum" name="isalnum">,
1582 <ref id="isalpha" name="isalpha">,
1583 <ref id="isascii" name="isascii">,
1584 <ref id="isblank" name="isblank">,
1585 <ref id="iscntrl" name="iscntrl">,
1586 <ref id="isdigit" name="isdigit">,
1587 <ref id="isgraph" name="isgraph">,
1588 <ref id="islower" name="islower">,
1589 <ref id="isprint" name="isprint">,
1590 <ref id="isspace" name="isspace">,
1591 <ref id="isupper" name="isupper">,
1592 <ref id="isxdigit" name="isxdigit">
1593 <tag/Example/None.
1594 </descrip>
1595 </quote>
1596
1597
1598 <sect1>isspace<label id="isspace"><p>
1599
1600 <quote>
1601 <descrip>
1602 <tag/Function/Check if a given character is a a white-space character.
1603 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1604 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
1605 <tag/Description/The function returns a value of zero if the given argument
1606 is a white space character. The return value is non zero if the character is
1607 anything else. The standard white space characters are: space, formfeed ('\f'),
1608 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
1609 ('\v').
1610 <tag/Limits/<itemize>
1611 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1612 inline sequence generated by the macro will not work correctly for values
1613 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1614 this range. The non inline function may be accessed by <tt/#undef/'ing the
1615 macro.
1616 <item>When compiling without <tt/-Os/, the function is only available as
1617 fastcall function, so it may only be used in presence of a prototype.
1618 </itemize>
1619 <tag/Availability/ISO 9899
1620 <tag/See also/
1621 <ref id="isalnum" name="isalnum">,
1622 <ref id="isalpha" name="isalpha">,
1623 <ref id="isascii" name="isascii">,
1624 <ref id="isblank" name="isblank">,
1625 <ref id="iscntrl" name="iscntrl">,
1626 <ref id="isdigit" name="isdigit">,
1627 <ref id="isgraph" name="isgraph">,
1628 <ref id="islower" name="islower">,
1629 <ref id="isprint" name="isprint">,
1630 <ref id="ispunct" name="ispunct">,
1631 <ref id="isupper" name="isupper">,
1632 <ref id="isxdigit" name="isxdigit">
1633 <tag/Example/None.
1634 </descrip>
1635 </quote>
1636
1637
1638 <sect1>isupper<label id="isupper"><p>
1639
1640 <quote>
1641 <descrip>
1642 <tag/Function/Check if a given character is an upper case letter.
1643 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1644 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
1645 <tag/Description/The function returns a value of zero if the given argument
1646 is an upper case letter. The return value is non zero if the character is
1647 anything else.
1648 <tag/Limits/<itemize>
1649 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1650 inline sequence generated by the macro will not work correctly for values
1651 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1652 this range. The non inline function may be accessed by <tt/#undef/'ing the
1653 macro.
1654 <item>When compiling without <tt/-Os/, the function is only available as
1655 fastcall function, so it may only be used in presence of a prototype.
1656 </itemize>
1657 <tag/Availability/ISO 9899
1658 <tag/See also/
1659 <ref id="isalnum" name="isalnum">,
1660 <ref id="isalpha" name="isalpha">,
1661 <ref id="isascii" name="isascii">,
1662 <ref id="isblank" name="isblank">,
1663 <ref id="iscntrl" name="iscntrl">,
1664 <ref id="isdigit" name="isdigit">,
1665 <ref id="isgraph" name="isgraph">,
1666 <ref id="islower" name="islower">,
1667 <ref id="isprint" name="isprint">,
1668 <ref id="ispunct" name="ispunct">,
1669 <ref id="isspace" name="isspace">,
1670 <ref id="isxdigit" name="isxdigit">
1671 <tag/Example/None.
1672 </descrip>
1673 </quote>
1674
1675
1676 <sect1>isxdigit<label id="isxdigit"><p>
1677
1678 <quote>
1679 <descrip>
1680 <tag/Function/Check if a given character is a hexadecimal digit.
1681 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1682 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
1683 <tag/Description/The function returns a value of zero if the given argument
1684 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
1685 if the character is anything else.
1686 <tag/Limits/<itemize>
1687 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1688 inline sequence generated by the macro will not work correctly for values
1689 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1690 this range. The non inline function may be accessed by <tt/#undef/'ing the
1691 macro.
1692 <item>When compiling without <tt/-Os/, the function is only available as
1693 fastcall function, so it may only be used in presence of a prototype.
1694 </itemize>
1695 <tag/Availability/ISO 9899
1696 <tag/See also/
1697 <ref id="isalnum" name="isalnum">,
1698 <ref id="isalpha" name="isalpha">,
1699 <ref id="isascii" name="isascii">,
1700 <ref id="isblank" name="isblank">,
1701 <ref id="iscntrl" name="iscntrl">,
1702 <ref id="isdigit" name="isdigit">,
1703 <ref id="isgraph" name="isgraph">,
1704 <ref id="islower" name="islower">,
1705 <ref id="isprint" name="isprint">,
1706 <ref id="ispunct" name="ispunct">,
1707 <ref id="isspace" name="isspace">,
1708 <ref id="isupper" name="isupper">
1709 <tag/Example/None.
1710 </descrip>
1711 </quote>
1712
1713
1714 <sect1>kbhit<label id="kbhit"><p>
1715
1716 <quote>
1717 <descrip>
1718 <tag/Function/Check if there's a key waiting in the keyboard buffer.
1719 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1720 <tag/Declaration/<tt/unsigned char kbhit (void);/
1721 <tag/Description/The function returns a value of zero if there is no character
1722 waiting to be read from the keyboard. It returns non zero otherwise.
1723 <tag/Limits/<itemize>
1724 <item>If the system does not support a keyboard buffer (most systems
1725 do), the function is rather useless.
1726 </itemize>
1727 <tag/Availability/cc65
1728 <tag/See also/
1729 <ref id="cgetc" name="cgetc">,
1730 <ref id="cursor" name="cursor">
1731 <tag/Example/None.
1732 </descrip>
1733 </quote>
1734
1735
1736 <sect1>labs<label id="labs"><p>
1737
1738 <quote>
1739 <descrip>
1740 <tag/Function/Returns the absolute value of a long integer.
1741 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1742 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
1743 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
1744 the function.
1745 <tag/Limits/<itemize>
1746 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
1747 <item>The function is only available as fastcall function, so it may only be
1748 used in presence of a prototype.
1749 </itemize>
1750 <tag/Availability/ISO 9899
1751 <tag/See also/
1752 <ref id="abs" name="abs">
1753 <tag/Example/None.
1754 </descrip>
1755 </quote>
1756
1757
1758 <sect1>malloc<label id="malloc"><p>
1759
1760 <quote>
1761 <descrip>
1762 <tag/Function/Allocate dynamic memory.
1763 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1764 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
1765 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
1766 pointer to the allocated memory block. On error (not enough memory available),
1767 <tt/malloc/ returns <tt/NULL/.
1768 <tag/Limits/
1769 <itemize>
1770 <item>The function is only available as fastcall function, so it may only
1771 be used in presence of a prototype.
1772 </itemize>
1773 <tag/Availability/ISO 9899
1774 <tag/See also/
1775 <ref id="_heapadd" name="_heapadd">,
1776 <ref id="_heapmaxavail" name="_heapmaxavail">,
1777 <ref id="_heapmemavail" name="_heapmemavail">,
1778 <ref id="calloc" name="calloc">,
1779 <ref id="free" name="free">,
1780 <ref id="realloc" name="realloc">
1781 <tag/Example/None.
1782 </descrip>
1783 </quote>
1784
1785
1786 <sect1>rand<label id="rand"><p>
1787
1788 <quote>
1789 <descrip>
1790 <tag/Function/Return a pseudo random number.
1791 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1792 <tag/Declaration/<tt/int rand (void);/
1793 <tag/Description/The function returns a pseudo random number
1794 between 0 and <tt/RAND_MAX/ (exclusive).
1795 <tag/Limits/<itemize>
1796 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
1797 flow of numbers is generated.
1798 <item>On startup, the function behaves as if <ref id="srand" name="srand">
1799 had been used with an argument of 1.
1800 </itemize>
1801 <tag/Availability/ISO 9899
1802 <tag/See also/
1803 <ref id="_randomize" name="_randomize">,
1804 <ref id="srand" name="srand">
1805 <tag/Example/None.
1806 </descrip>
1807 </quote>
1808
1809
1810 <sect1>realloc<label id="realloc"><p>
1811
1812 <quote>
1813 <descrip>
1814 <tag/Function/Change the size of an allocated memory block.
1815 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1816 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
1817 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
1818 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
1819 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
1820 behaves as if <tt/free/ had been called. On error (not enough memory
1821 available), <tt/realloc/ returns <tt/NULL/.
1822 <tag/Limits/
1823 <itemize>
1824 <item>The part of the memory block that is returned will have its contents
1825 unchanged.
1826 <item>This function is somewhat dangerous to use. Be careful to save the
1827 pointer you're passing somewhere else, otherwise
1828 <tscreen><verb>
1829         ptr = realloc (ptr, size);
1830 </verb></tscreen>
1831 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
1832 <item>The function is only available as fastcall function, so it may only
1833 be used in presence of a prototype.
1834 </itemize>
1835 <tag/Availability/ISO 9899
1836 <tag/See also/
1837 <ref id="_heapadd" name="_heapadd">,
1838 <ref id="_heapmaxavail" name="_heapmaxavail">,
1839 <ref id="_heapmemavail" name="_heapmemavail">,
1840 <ref id="calloc" name="calloc">,
1841 <ref id="free" name="free">,
1842 <ref id="realloc" name="realloc">
1843 <tag/Example/None.
1844 </descrip>
1845 </quote>
1846
1847
1848 <sect1>revers<label id="revers"><p>
1849
1850 <quote>
1851 <descrip>
1852 <tag/Function/Control revers character display.
1853 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1854 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
1855 <tag/Description/If the argument is non zero, the function enables reverse
1856 character display. If the argument is zero, reverse character display is
1857 switched off. The old value of the setting is returned.
1858 <tag/Limits/<itemize>
1859 <item>The function may not be supported by the hardware, in which case
1860 the call is ignored.
1861 <item>The function is only available as fastcall function, so it may only
1862 be used in presence of a prototype.
1863 </itemize>
1864 <tag/Availability/cc65
1865 <tag/See also/
1866 <ref id="textcolor" name="textcolor">
1867 <tag/Example/None.
1868 </descrip>
1869 </quote>
1870
1871
1872 <sect1>screensize<label id="screensize"><p>
1873
1874 <quote>
1875 <descrip>
1876 <tag/Function/Return the dimensions of the text mode screen.
1877 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1878 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
1879 <tag/Description/The function returns the dimensions of the text mode screen.
1880 <tag/Limits/<itemize>
1881 <item>The function is only available as fastcall function, so it may only
1882 be used in presence of a prototype.
1883 </itemize>
1884 <tag/Availability/cc65
1885 <tag/See also/
1886 <ref id="gotox" name="gotox">,
1887 <ref id="gotoxy" name="gotoxy">,
1888 <ref id="gotoy" name="gotoy">,
1889 <ref id="wherex" name="wherex">,
1890 <ref id="wherey" name="wherey">
1891 <tag/Example/None.
1892 </descrip>
1893 </quote>
1894
1895
1896 <sect1>slow<label id="slow"><p>
1897
1898 <quote>
1899 <descrip>
1900 <tag/Function/Switch the C128 into 1MHz mode.
1901 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1902 <tag/Declaration/<tt/void slow (void);/
1903 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
1904 will halve the speed compared to fast mode.
1905 <tag/Limits/<itemize>
1906 <item>The function is specific to the C128.
1907 </itemize>
1908 <tag/Availability/C128
1909 <tag/See also/
1910 <ref id="fast" name="fast">,
1911 <ref id="toggle_videomode" name="toggle_videomode">
1912 <tag/Example/None.
1913 </descrip>
1914 </quote>
1915
1916
1917 <sect1>srand<label id="srand"><p>
1918
1919 <quote>
1920 <descrip>
1921 <tag/Function/Initialize the pseudo random number generator.
1922 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1923 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
1924 <tag/Description/The function initializes the random number generator using
1925 the given seed. On program startup, the generator behaves as if <tt/srand/ has
1926 been called with an argument of 1.
1927 <tag/Limits/<itemize>
1928 <item>The function is only available as fastcall function, so it may only
1929 be used in presence of a prototype.
1930 </itemize>
1931 <tag/Availability/ISO 9899
1932 <tag/See also/
1933 <ref id="_randomize" name="_randomize">,
1934 <ref id="rand" name="rand">
1935 <tag/Example/None.
1936 </descrip>
1937 </quote>
1938
1939
1940 <sect1>strcat<label id="strcat"><p>
1941
1942 <quote>
1943 <descrip>
1944 <tag/Function/Concatentate two strings.
1945 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1946 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
1947 <tag/Description/The <tt/strcat/ function appends a copy of the string
1948 pointed to by s2 (including the terminating null byte) to the end of the
1949 string pointed to by s1. The initial byte of s2 overwrites the null byte at
1950 the end of s1.
1951 <tag/Limits/<itemize>
1952 <item>The function is only available as fastcall function, so it may only
1953 be used in presence of a prototype.
1954 <item>If copying takes place between objects that overlap, the behavior
1955 is undefined.
1956 </itemize>
1957 <tag/Availability/ISO 9899
1958 <tag/See also/
1959 <ref id="strcpy" name="strcpy">
1960 <ref id="strncpy" name="strncpy">
1961 <tag/Example/None.
1962 </descrip>
1963 </quote>
1964
1965
1966 <sect1>strchr<label id="strchr"><p>
1967
1968 <quote>
1969 <descrip>
1970 <tag/Function/Search for a character in a string.
1971 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1972 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
1973 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
1974 (converted to a char) in the string pointed to by <tt/s/. The terminating null
1975 byte is considered to be part of the string. Upon completion, the function
1976 returns a pointer to the byte, or a null pointer if the byte was not found.
1977 <tag/Limits/<itemize>
1978 <item>The function is only available as fastcall function, so it may only
1979 be used in presence of a prototype.
1980 </itemize>
1981 <tag/Availability/ISO 9899
1982 <tag/See also/
1983 <ref id="strrchr" name="strrchr">
1984 <tag/Example/None.
1985 </descrip>
1986 </quote>
1987
1988
1989 <sect1>strcpy<label id="strcpy"><p>
1990
1991 <quote>
1992 <descrip>
1993 <tag/Function/Copy a string.
1994 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1995 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
1996 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
1997 <tt/s2/ (including the terminating null byte) into the array pointed to by
1998 <tt/s1/. The function will always return <tt/s1/.
1999 <tag/Limits/<itemize>
2000 <item>The function is only available as fastcall function, so it may only
2001 be used in presence of a prototype.
2002 <item>If copying takes place between objects that overlap, the behavior
2003 is undefined.
2004 </itemize>
2005 <tag/Availability/ISO 9899
2006 <tag/See also/
2007 <ref id="strcat" name="strcat">
2008 <ref id="strncpy" name="strncpy">
2009 <tag/Example/
2010 <verb>
2011 #include <string.h>
2012
2013 static char hello[14];
2014
2015 strcpy (hello, "Hello world!\n");
2016 </verb>
2017 </descrip>
2018 </quote>
2019
2020
2021 <sect1>strlen<label id="strlen"><p>
2022
2023 <quote>
2024 <descrip>
2025 <tag/Function/Return the length of a string.
2026 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2027 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
2028 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
2029 string to which s points, not including the terminating null byte.
2030 <tag/Limits/<itemize>
2031 <item>The function is only available as fastcall function, so it may only
2032 be used in presence of a prototype.
2033 <item>When compiling with <tt/-Os/ (inline known standard functions), the
2034 function does not work correctly for strings with more than 255 characters.
2035 </itemize>
2036 <tag/Availability/ISO 9899
2037 <tag/See also/
2038 <ref id="strcpy" name="strcpy">
2039 <tag/Example/None.
2040 </descrip>
2041 </quote>
2042
2043
2044 <sect1>strlower<label id="strlower"><p>
2045
2046 <quote>
2047 <descrip>
2048 <tag/Function/Make a string lower case.
2049 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2050 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
2051 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
2052 function to each character of a string. The function will always return <tt/s/.
2053 <tag/Limits/<itemize>
2054 <item>The function is only available as fastcall function, so it may only
2055 be used in presence of a prototype.
2056 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2057 <item>An alias name for this function is <tt/strlwr/.
2058 </itemize>
2059 <tag/Availability/cc65
2060 <tag/See also/
2061 <ref id="strupper" name="strupper">
2062 <ref id="tolower" name="tolower">
2063 <tag/Example/None.
2064 </descrip>
2065 </quote>
2066
2067
2068 <sect1>strlwr<label id="strlwr"><p>
2069
2070 <quote>
2071 See <tt/strlower/.
2072 </quote>
2073
2074
2075 <sect1>strncpy<label id="strncpy"><p>
2076
2077 <quote>
2078 <descrip>
2079 <tag/Function/Copy part of a string.
2080 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2081 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
2082 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
2083 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
2084 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
2085 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
2086 written. The function will always return <tt/s1/.
2087 <tag/Limits/<itemize>
2088 <item>The function is only available as fastcall function, so it may only
2089 be used in presence of a prototype. If there is no null byte in the first <tt/n/
2090 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
2091 <item>If copying takes place between objects that overlap, the behavior is
2092 undefined.
2093 </itemize>
2094 <tag/Availability/ISO 9899
2095 <tag/See also/
2096 <ref id="strcat" name="strcat">
2097 <ref id="strcpy" name="strcpy">
2098 <tag/Example/
2099 <verb>
2100 #include <string.h>
2101
2102 static char hello[6];
2103
2104 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
2105 hello[5] = '\0';
2106 </verb>
2107 </descrip>
2108 </quote>
2109
2110
2111 <sect1>strrchr<label id="strrchr"><p>
2112
2113 <quote>
2114 <descrip>
2115 <tag/Function/Search for a character in a string.
2116 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2117 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
2118 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
2119 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2120 byte is considered to be part of the string. Upon completion, the function
2121 returns a pointer to the byte, or a null pointer if the byte was not found.
2122 <tag/Limits/<itemize>
2123 <item>The function is only available as fastcall function, so it may only
2124 be used in presence of a prototype.
2125 </itemize>
2126 <tag/Availability/ISO 9899
2127 <tag/See also/
2128 <ref id="strchr" name="strchr">
2129 <tag/Example/None.
2130 </descrip>
2131 </quote>
2132
2133
2134 <sect1>strupper<label id="strupper"><p>
2135
2136 <quote>
2137 <descrip>
2138 <tag/Function/Make a string upper case.
2139 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2140 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
2141 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
2142 function to each character of a string. The function will always return <tt/s/.
2143 <tag/Limits/<itemize>
2144 <item>The function is only available as fastcall function, so it may only
2145 be used in presence of a prototype.
2146 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2147 <item>An alias name for this function is <tt/strupr/.
2148 </itemize>
2149 <tag/Availability/cc65
2150 <tag/See also/
2151 <ref id="strlower" name="strlower">
2152 <ref id="toupper" name="toupper">
2153 <tag/Example/None.
2154 </descrip>
2155 </quote>
2156
2157
2158 <sect1>strupr<label id="strupr"><p>
2159
2160 <quote>
2161 See <tt/strupper/.
2162 </quote>
2163
2164
2165 <sect1>textcolor<label id="textcolor"><p>
2166
2167 <quote>
2168 <descrip>
2169 <tag/Function/Set the text color.
2170 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2171 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
2172 <tag/Description/The function will set a new text color. It returns the old
2173 (current) text color. Text output using any <tt/conio.h/ function will use
2174 the color set by this function.
2175 <tag/Limits/<itemize>
2176 <item>Text colors are system dependent. The function may have no effect
2177 on systems where the text color cannot be changed.
2178 <item>The function is only available as fastcall function, so it may only
2179 be used in presence of a prototype.
2180 </itemize>
2181 <tag/Availability/cc65
2182 <tag/See also/
2183 <ref id="bgcolor" name="bgcolor">,
2184 <ref id="bordercolor" name="bordercolor">
2185 <tag/Example/None.
2186 </descrip>
2187 </quote>
2188
2189
2190 <sect1>toggle_videomode<label id="toggle_videomode"><p>
2191
2192 <quote>
2193 <descrip>
2194 <tag/Function/Toggle between 40 and 80 column mode.
2195 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2196 <tag/Declaration/<tt/void toggle_videomode (void);/
2197 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
2198 old mode (cursor position, color and so on) are saved and restored together
2199 with the mode.
2200 <tag/Limits/<itemize>
2201 <item>The function is specific to the C128.
2202 </itemize>
2203 <tag/Availability/C128
2204 <tag/See also/
2205 <ref id="fast" name="fast">,
2206 <ref id="slow" name="slow">
2207 <tag/Example/None.
2208 </descrip>
2209 </quote>
2210
2211
2212 <sect1>tolower<label id="tolower"><p>
2213
2214 <quote>
2215 <descrip>
2216 <tag/Function/Convert a character into its lower case representation.
2217 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2218 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
2219 <tag/Description/The function returns the given character converted to lower
2220 case. If the given character is not a letter, it is returned unchanged.
2221 <tag/Limits/<itemize>
2222 <item>The function is only available as fastcall function, so it may
2223 only be used in presence of a prototype.
2224 </itemize>
2225 <tag/Availability/ISO 9899
2226 <tag/See also/
2227 <ref id="islower" name="islower">,
2228 <ref id="isupper" name="isupper">,
2229 <ref id="toupper" name="toupper">
2230 <tag/Example/None.
2231 </descrip>
2232 </quote>
2233
2234
2235 <sect1>toupper<label id="toupper"><p>
2236
2237 <quote>
2238 <descrip>
2239 <tag/Function/Convert a character into its upper case representation.
2240 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2241 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
2242 <tag/Description/The function returns the given character converted to upper
2243 case. If the given character is not a letter, it is returned unchanged.
2244 <tag/Limits/<itemize>
2245 <item>The function is only available as fastcall function, so it may
2246 only be used in presence of a prototype.
2247 </itemize>
2248 <tag/Availability/ISO 9899
2249 <tag/See also/
2250 <ref id="islower" name="islower">,
2251 <ref id="isupper" name="isupper">,
2252 <ref id="tolower" name="tolower">
2253 <tag/Example/None.
2254 </descrip>
2255 </quote>
2256
2257
2258 <sect1>wherex<label id="wherex"><p>
2259
2260 <quote>
2261 <descrip>
2262 <tag/Function/Return the current X position of the text mode cursor.
2263 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2264 <tag/Declaration/<tt/unsigned char wherex (void);/
2265 <tag/Description/The function returns the current X position of the text mode
2266 cursor. Zero is returned for the leftmost screen position.
2267 <tag/Availability/cc65
2268 <tag/See also/
2269 <ref id="gotox" name="gotox">,
2270 <ref id="gotoy" name="gotoy">,
2271 <ref id="gotoxy" name="gotoxy">,
2272 <ref id="wherey" name="wherey">
2273 <tag/Example/None.
2274 </descrip>
2275 </quote>
2276
2277
2278 <sect1>wherey<label id="wherey"><p>
2279
2280 <quote>
2281 <descrip>
2282 <tag/Function/Return the current Y position of the text mode cursor.
2283 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2284 <tag/Declaration/<tt/unsigned char wherey (void);/
2285 <tag/Description/The function returns the current Y position of the text mode
2286 cursor. Zero is returned for the uppermost screen position.
2287 <tag/Availability/cc65
2288 <tag/See also/
2289 <ref id="gotox" name="gotox">,
2290 <ref id="gotoy" name="gotoy">,
2291 <ref id="gotoxy" name="gotoxy">,
2292 <ref id="wherex" name="wherex">
2293 <tag/Example/None.
2294 </descrip>
2295 </quote>
2296
2297
2298 </article>
2299
2300