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