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