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