cbase programmers reference.pdf

(207 KB) Pobierz
C∗Base
v3.3
Programmer’s Reference Guide
$Revision: 801 $
Copyright c 2003–2006 David Weinehall
Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU General Public License as published by the Free Software Foun-
dation; either version 2 of the License, or (at your option) any later version.
A copy of the license is included in the chapter “Licenses”, section “The GNU
General Public License” of the “C∗Base v3.3 User’s Guide”.
2
Contents
1 Introduction
2 BASIC Extensions
3 Memory Maps
3.1 Brief Outline . .
3.2 Zero-page . . . .
3.3
$0200-03FF
.
3.4 Interface Areas .
3.5 KERNAL-Tables
3.6 Other Tables . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
3
4
. . . .
5
. . . .
6
. . . .
9
. . . . 20
. . . . 21
. . . . 21
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22
22
22
25
27
28
29
4 Jump-Tables
4.1 Protocols (“P/”-files) . . . . . . . .
4.2
“K/ML 2.O”
. . . . . . . . . . . .
4.3
“K/ML 3.O”
. . . . . . . . . . . .
4.4
“K/NMI.ML”
and
“K/SWIFT.Dx”
5 BASIC-routines
6 KERNAL-routines
A Special Algorithms Used
30
A.1 Sorting in Toplister . . . . . . . . . . . . . . . . . . . . . . . . . 30
A.1.1 The Sorting Algorithm . . . . . . . . . . . . . . . . . . . 30
A.1.2 Efficiency of the Algorithm . . . . . . . . . . . . . . . . 30
1
1 Introduction
This is documentation is mainly meant for those about to mess around with my
code, but can also be interesting for those who are curious about the work I’ve
done to C∗Base since v3.2, and it should give a brief understanding of how this
program works. Most of the information provided here can also be applied to
C∗Base v3.2 and prior, but some of the information is specific C∗Base v3.3.
Where there are differences compared to the older version, I have
tried
to state
so in the manual. Exceptions are the JUMP-tables, where I don’t bother to docu-
ment the old calls.
2
2 BASIC Extensions
To make the BASIC-code shorter and somewhat easier to understand, and to give
provision for using MCI-commands from BASIC, there are two extensions made,
compared to the normal BASIC v2.0. They are:
@
and
<-
Both commands outputs text to both the modem and the screen, and both interprets
MCI-commands while doing so. The only difference between them is that
@
adds
an carriage-return to the end,
<-
does not.
Note, that neither of these commands can handle anything else than strings. Thus,
if you want to output the content of a variable, you must do something like this:
str$(br)
(this would turn the floating-point variable
br
into a string, and then
output it, without adding a carriage-return.)
One thing you should keep in mind is, that these commands do not ‘tokenize’
when compiling the code in (for instance) BLITZ, so the compiled program be-
comes larger.
3
Zgłoś jeśli naruszono regulamin