Projekt Project
Hardware Hardware
Bedienung Operation
BASIC (1) BASIC (1)
BASIC (2) BASIC (2)
BASIC (3) BASIC (3)
Interna Internals
Beispiele Examples
Erweiterungen Extensions
Bibliotheken Libraries
Treiber Driver
Programme Programs


Bezugsquellen: Where to buy:
Bausatz Kit
Leerplatine Empty board

AVR-ChipBasic2: Interna AVR ChipBasic2: Internals

V1.45 (c) 2006-2012 Jörg Wolfram V1.45 (c) 2006-2012 Jörg Wolfram



1 Organisation des Videospeichers 1 Organization of the video memory



1.1 Unterschiede bei 8 und 16 Farben 1.1 The differences at 8 and 16 colors

Die I (Intensitäts-) Bits sind nur von Relevanz, wenn die 16-Farben-Erweiterung angeschlossen ist. The I (intensity) bits are only relevant if the 16-color extension is connected. Die etwas ungewöhnliche Verteilung der Bits (Intensität als LSB) ist durch die Kompatibilität zum 8-Farben Modus der "normalen" Hardware bedingt. The somewhat unusual distribution of the bits (LSB intensity) is due to the compatibility with the 8-color mode to "normal" hardware.

1.2 Videomode 0 (Standard-Mode) 1.2 Video Mode 0 (default mode)

Dieser Mode ist ein Textmodus mit festem Zeichensatz von 256 Zeichen. This mode is a text mode with a fixed set of 256 characters. Jedem Zeichen kann getrennt Vorder- und Hintergrundfarbe zugewiesen werden. Each character can separate foreground and background color can be assigned. Es gibt 23 Zeilen a 30 Zeichen, dies resultiert einfach daraus daß das Projekt zum Teil mit einem 37 cm TV-Gerät mit recht großem Rand entwickelt wurde. There are 23 lines with 30 characters, this results simply from the fact that the project was developed in part with a 37 cm TV with a fairly large margin. Im Bildspeicher finden sich nacheinander: In the frame buffer to find successively:


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 689 689 690 690 Zeichen Sign
690 690 1379 1379 690 690 Attribute Attributes
1380 1380 2759 2759 1380 1380 Backup für Monitor Backup Monitor






Für die Pseudografik sind die Zeichen 0...15 in 4 "Pixel" aufgeteilt. For the pseudo-graphic characters are 0 .. 15 in 4 "pixels" divided. Bei 23 Zeilen a 30 Zeichen ergibt sich so eine Arbeitsfläche von 60x46 Punkten. At 23 lines each of 30 characters results in a working area of ​​60x46 points.

1.3 Videomode 1 1.3 Video Mode 1

Die Pixelauflösung beträgt 168x116 Pixel, wobei für jeweils 8x8 (am unteren Rand nur 4x8) Pixel Vorder- und Hintergrundfarbe eingestellt werden können. The pixel resolution is 168x116 pixels, for each 8x8 (4x8 only at the bottom) pixels foreground and background color can be set.


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 2435 2435 2436 2436 Pixelinformation Pixel information
2436 2436 2750 2750 315 315 Attribute Attributes
2751 2751 2759 2759 9 9 ungenutzt unused






Die Pixelbytes sind von links nach rechts sowie von oben nach unten organisiert. The pixel bytes are from left to right and from top to bottom organized. Innerhalb des Bytes entspricht Bit 0 dem Pixel ganz links. Within the byte bit 0 corresponds to the leftmost pixel.

1.4 Videomode 2 1.4 Video Mode 2

Die Pixelauflösung beträgt 120x76 Pixel, jedes Pixel kann eine aus 4 über die Palette einstellbaren Farben annehmen. The pixel resolution is 120x76 pixels, each pixel can be adjusted over the range of 4 colors.


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 2279 2279 2280 2280 Pixelinformation Pixel information
2280 2280 2759 2759 480 480 ungenutzt unused




Die Pixelbytes sind von links nach rechts sowie von oben nach unten organisiert. The pixel bytes are from left to right and from top to bottom organized. Innerhalb des Bytes entsprechen Bit 0 und 1 dem Pixel ganz links. Within the byte bits 0 and 1 correspond to the leftmost pixel. Jedes Pixel wird durch zwei Bits repräsentiert, die auf einen der ersten 4 Paletteneinträge zeigen. Each pixel is represented by two bits, which point to a range of the first 4 entries. Der Paletteneintrag bestimmt dann die Farbe. The palette entry determines the color.

1.5 Videomode 3 1.5 Video Mode 3

Die Pixelauflösung beträgt 84x58 Pixel, jedes Pixel kann eine aus 16 über die Palette einstellbaren Farben annehmen. The pixel resolution is 84x58 pixels, each pixel can be adjusted over the range of 16 colors.


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 2435 2435 2436 2436 Pixelinformation Pixel information
2436 2436 2759 2759 324 324 ungenutzt unused




Die Pixelbytes sind von links nach rechts sowie von oben nach unten organisiert. The pixel bytes are from left to right and from top to bottom organized. Jedes Byte ist in 2 Nibbles zu 4 Bit unterteilt, die auf einen der 16 Paletteneinträge zeigen. Each byte is divided into two nibbles of 4 bits, which point to one of the 16 palette entries. Der Paletteneintrag bestimmt dann die Farbe. The palette entry determines the color.

1.6 Videomode 4 1.6 Video Mode 4

Dieser Mode ist ein Textmodus mit variablen Zeichensatz von 128 Zeichen. This mode is a text mode with variable character set of 128 characters. Jedem Zeichen kann getrennt Vorder- und Hintergrundfarbe zugewiesen werden. Each character can separate foreground and background color can be assigned. Beim Wechsel in den Videomodus werden die unteren 128 Zeichen aus dem festen Zeichensatz in den variablen Zeichensatz kopiert. When you switch to video mode the lower 128 characters of the fixed character set in the variable character set will be copied. Im Bildspeicher finden sich nacheinander: In the frame buffer to find successively:


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 689 689 690 690 Zeichen Sign
690 690 1379 1379 690 690 Attribute Attributes
1448 1448 2727 2727 1280 1280 Zeichensatz Charset
2728 2728 2759 2759 32 32 ungenutzt unused








Im Zeichensatz sind die Bytes nach Zeichenzeilen geordnet, also 128 Bytes für die erste Zeichenzeile, dann 128 Bytes für die zweite Zeichenzeile... In the character set, the bytes are ordered by character lines, ie 128 bytes for the first character line, then 128 bytes for the second character line ...
Dabei sind die Pixel innerhalb einer Zeichenzeile noch differentiell gespeichert, Bit 7 ist das Pixel ganz links, ist Bit 6 "0", hat das nächste Pixeldie gleiche Farbe, bei einer "1" ändert sie sich. Here, the pixels are stored within a character line yet differentially, bit 7 is the leftmost pixel, bit 6 is "0", the next Pixeldie has same color, with a "1" it changes. Ein Byte ergibt eine Zeichenzeile von 6 Pixeln wobei Bit 0 und 1 nicht berücksichtigt werden, ein Zeichen besteht aus 10 dieser Zeichenzeilen. A byte is a character line of 6 pixels with bit 0 and 1 are not considered, a character consists of 10 of these lines of characters.

1.7 Videomode 5 1.7 Video Mode 5

Die Pixelauflösung beträgt 128x64 Pixel, jedes Pixel kann eine aus 2 über die Palette einstellbaren Farben annehmen. The pixel resolution is 128x64 pixels, each pixel can be adjusted over the range of 2 colors. Dieser Modus dient hauptsächlich zur Emulation von Grafik-LCD mit der entsprechenden Auflösung. This mode is primarily used to emulate graphic LCD with the corresponding resolution.


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 1023 1023 1024 1024 Pixelinformation Pixel information
1024 1024 2759 2759 1736 1736 Backup für Monitor Backup Monitor




Die Pixelbytes sind von links nach rechts sowie von oben nach unten organisiert. The pixel bytes are from left to right and from top to bottom organized. Innerhalb des Bytes entspricht Bit 0 dem Pixel ganz links. Within the byte bit 0 corresponds to the leftmost pixel. Für jedes Pixel gibt es ganau ein Bit, welches auf einen der ersten beiden Paletteneinträge zeigt. For each pixel, there is a bit ganau showing on one of the first two palette entries. Der Paletteneintrag bestimmt dann die Farbe. The palette entry determines the color.

1.8 Videomode 6 1.8 Video Mode 6

Dieser Modus ist ein Textmodus mit variablen Zeichensatz von 64 Zeichen. This mode is a text mode with variable character set of 64 characters. Jedem Pixel in jedem Zeichen kann eine der 8 Farben zugewiesen werden. Each pixel in each character, one of the eight colors can be assigned to. Beim Wechsel in den Videomodus werden die unteren Zeichen aus dem festen Zeichensatz in den variablen Zeichensatz kopiert. When you switch to video mode, the lower sign of the solid character set to the character set variable to be copied. Im Bildspeicher finden sich nacheinander: In the frame buffer to find successively:


Anfangsadresse Start address Endadresse End address Bytes Bytes Funktion Function
0 0 689 689 690 690 Zeichen Sign
690 690 2609 2609 1920 1920 Zeichensatz Charset
2610 2610 2759 2759 150 150 ungenutzt unused






Im Zeichensatz liegen die 30 Bytes jedes Zeichens direkt hintereinander. In the character set are the 30 bytes of each character in a row directly. Jedes Pixel wird durch drei Bits repräsentiert, innerhalb des Bytes entsprechen Bit 1...3 dem rechten und Bit 5...7 dem linken Pixel. Each pixel is represented by three bits, corresponding to bits within the byte 1 .. 3 of the right and the left bit 5 .. 7 pixels. Drei Bytes ergeben eine Zeichenzeile von 6 Pixeln, ein Zeichen besteht aus 10 dieser Zeichenzeilen. Three bytes are a line of characters of 6 pixels, a sign consists of 10 rows of characters.

1.9 Videomode 7 1.9 Video Mode 7

Der Videomodus 7 wurde in der aktuellen Version entfernt. The video mode 7 was removed in the current version. Stattdessen kann ein eigener Treiber auf Programmplatz 8 installiert werden. Instead, a separate driver on program 8th. Für Video Treiber ist der ID-Bereich 0xc0 bis 0xdf im HIGH-Byte reserviert. Video drivers for the ID field is reserved to 0xc0 0xDF in HIGH byte. Ist keine derartige ID vorhanden, bewirkt ein VMODE 7 nur einen Constant Error. Is no such ID exists, a 7 VMODE causes only a constant error. Bei Binärprogrammen muss allerdings selbst darauf geachtet werden, ob ein passender Treiber installiert ist. In binaries themselves but must be taken to ensure that an appropriate driver is installed.

2 Das API für Binärprogramme 2 The API for binaries



2.1 Allgemeines 2.1 General

Hmmm..., API - was ist das? Hmmm ... API - what is it? API ist die Abkürzung für "Apllication Programming Interface" und dient in diesem fall dazu, auch native (zB mit einem Assembler erzeugte) Binärprogramme auf dem ChipBasic2 Computer laufen zu lassen. API stands for "Apllication Programming Interface" and is used in this case to also native to run (for example, generated by an assembler) binaries on the ChipBasic2 computer.

2.2 Möglichkeiten und Einschränkungen 2.2 Possibilities and Limitations

Da wäre zuerst die Programmgröße. First there would be the program size. Diese ist auf 3072 Bytes begrenzt, wobei noch am Anfang des Speicherbereiches 12 Bytes für den Programmnamen, 1 Byte für die Unterscheidung zu BASIC Programmen (ist bei Binärprogrammen immer "N") und 19 weitere Bytes für zB das Programm-Icon reserviert sind. This is limited to 3072 bytes, still at the beginning of the memory area of ​​12 bytes (is in binaries always "N") for the program name, 1 byte for the distinction to BASIC programs and 19 additional bytes for example, the program's icon are reserved.
Damit die Programme auch nach einem Update des Systems noch funktionieren, sollten direkte Unterprogrammaufrufe (ohne Umweg über die API Funktionen) vermieden werden. Thus, the programs work after upgrading the system yet, should direct subroutine calls (without using the API functions) can be avoided. Ebenso sollten die Auskunfts-Funktionen genutzt werden, um die Adressen von bestimmten Speicherbereichen abzufragen, anstelle mit den gerade aktuellen Adressen zu arbeiten. Similarly, the functions are used to provide information to retrieve the addresses of certain memory areas, instead of working with the current reading addresses. Außerdem ist es nicht sinnvoll, innerhalb des Programmes mit JMP oder CALL zu arbeiten, da die Programm-Adresse je nach Programmplatz variiert. It also does not make sense to work within the program with JMP or CALL, because the program's address space varies depending on the program. Damit ist leider auch nicht so einfach, auf zB im Quelltext eingebunde Tabellen zuzugreifen. So unfortunately is not as easy to access as the source code is bunde tables. Allerdings ist das über das API möglich: However, this is possible via the API:
.include "M644Pdef.inc" . Include "M644Pdef.inc"
.include "api.inc" . Include "api.inc"
.org 0x4000 . Org 0x4000
start: .db "TestprogrammN",0xec,0xff,0xff start:. db "test Programmn" 0xec, 0xff, 0xff
             .db "+--+" . Db "+ - +"
             .db "ABCD" . Db "ABCD"
             .db "+--+" . Db "+ - +"
.org 0x4010 . Org 0x4010
lese: call api_getvram ;setzt Y auf den Anfang des Bildspeichers read: call api_getvram; sets Y to the beginning of the frame buffer
             ldi XL,LOW(daten-start) ;Bestimmung des Offsets ldi XL, low (data-start); determining offset
             ldi XH,HIGH(daten-start) ldi XH, HIGH (data-start)
             call api_dataptr ;setzt Z auf die Adresse von "daten:" call api_dataptr; sets Z to the address of "data"
             call api_orom ;ROM-Text ab (Z) ausgeben call api_orom; ROM text from (Z) output
             ret ret
daten: .db "Mein Text",0 data:. db "my text", 0
Am Anfang müssen 12 bytes Programmname und ein "N" (0x4E) stehen, danach folgen 3 Bytes für verschiedene Flags und Bibliotheks/Treibernummer. In the beginning, the program name must be 12 bytes and an "N" (0x4E), are followed by 3 bytes for various flags and library / driver number. Im Anschluss stehen 12 Bytes für das Programm-Icon zur Verfügung. Following 12 bytes are available for the program icon is available. Das eigentliche Programm beginnt mit einem Offset von 32 Bytes (16 Words). The actual program starts with an offset of 32 bytes (16 words). Anstelle die API-Funktionen über CALL oder JMP aufzurufen ist es praktischer, die Makros zu verwenden. Instead, the API functions via CALL or JMP call it is more practical to use the macros. Allerdings funktionieren die nicht mit allen Assemblern richtig (nur mit AVRA getestet): However, do not work properly with all assemblers (only tested with AVRA):
.include "M644Pdef.inc" . Include "M644Pdef.inc"
.include "api_macros.inc" . Include "api_macros.inc"
.org 0x4000 . Org 0x4000
start: .db "TestprogrammN",0xec,0xff,0xff start:. db "test Programmn" 0xec, 0xff, 0xff
             .db "+--+" . Db "+ - +"
             .db "ABCD" . Db "ABCD"
             .db "+--+" . Db "+ - +"
.org 0x4010 . Org 0x4010
lese: api_getvram ;setzt Y auf den Anfang des Bildspeichers read: api_getvram, Y is to the beginning of the frame buffer
             ldi XL,LOW(daten-start) ;Bestimmung des Offsets ldi XL, low (data-start); determining offset
             ldi XH,HIGH(daten-start) ldi XH, HIGH (data-start)
             api_dataptr ;setzt Z auf die Adresse von "daten:" api_dataptr; sets Z to the address of "data"
             api_orom ;ROM-Text ab (Z) ausgeben api_orom; ROM text from (Z) output
             ret ret
daten: .db "Mein Text",0 data:. db "my text", 0
Der mit dem Assembler erzeugte Code ist aber letztendlich derselbe. The electricity generated by the assembler code is ultimately the same.

2.3 Die Flags im Header 2.3 The flags in the header

In Byte 13 des Headers befinden sich verschiedene Flags und die Vordergrundfarbe des Icons. In byte 13 of the header contains various flags and the foreground color of the icon.

Bit Bit Name Name Funktion Function
7 7 --- --- z.Zt. currently nicht benutzt not used
6 6 UPAR UPAR 0 = Treiber benutzt Parallelport 0 = driver uses parallel port
5 5 ISLIB ISLIB 0 = Programm ist eine Bibliothek 0 = Program is a library
4 4 EXEC EXEC 0 = Programm ist aus dem Hauptemü heraus startbar 0 = program can be started from the Hauptemü out
3...0 3rd .. 0 ICOL Icol ICON-Vordergrundfarbe ICON foreground color


Bei der ICON-Vordergrundfarbe kann theoretisch jeder der 16 Werte benutzt werden, für Übersichtlichkeit und Konsistenz innerhalb des Systems sollte bei der Entwicklung neuer Programme die folgende Zuordnung beibehalten werden: When ICON foreground color theory, each of the 16 values ​​are used for clarity and consistency within the system in the development of new programs should be maintained, the following assignment:

Farbcode Color Code Farbe Color Dateityp File Type
0000 0000 schwarz black nicht benutzt (unsichtbar) not used (invisible)
x001 x001 blau blue nicht benutzt (mangelnder Kontrast) not used (lack of contrast)
x010 x010 rot red Reserviert für Loader Reserved for Loader
x011 x011 magenta magenta Vorgabe für Treiber Requirement for drivers
x100 x100 grün green Vorgabe für Bibliotheken Default for libraries
x101 x101 cyan cyan Vorgabe für Binärprogramme Default for binaries
x110 x110 gelb yellow Reserviert für nicht startbare BASIC-Programme (Text) Reserved for non-bootable BASIC programs (text)
x111 x111 weiss white Reserviert für BASIC-Programme Reserved for BASIC programs


Nachfolgend einige Beispiele für sinnvolle Byte-Kombinationen: Some examples of reasonable byte combinations:

Typ Type Flagbyte Flag byte Programmtyp Program Type
"B" "B" 0xf7 0xF7 Daten Data
"N" "N" 0xe5 0xE5 Binärprogramm Binary
"N" "N" 0xd4 0xD4 Binär-Bibliothek Binary library
"N" "N" 0xf3 0xf3 Treiber Driver
"N" "N" 0xb3 0xb3 Treiber, benutzt Parallelport Drivers used parallel port
"L" "L" 0xf2 0xF2 Loader Loader


In Byte 14 befinden sich weitere 8 Flags. In byte 14 are another 8 flags. Diese stehen für verschiedene Erweiterungen. These are available for various extensions. Bietet ein Programm bzw. eine Bibliothek eine oder mehrere Erweiterungen, so ist das entsprechende Bit auf 0 gesetzt. Offers a program or a library, one or several extensions, the corresponding bit is set to 0. Beim Systemstart und wenn ein Programm geladen oder gelöscht wird, werden die Flagbytes aller Programme eingelesen und das Programm mit dem letzten Auftreten in einer Tabelle gespeichert. At system startup and when a program is loaded or unloaded, the Flagbytes all programs are read and saved the program with the last occurrence in a table. Diese Tabelle kann dann benutzt werden, um die Funktionen aufzurufen. This table can then be used to access the functions. Wenn es keine entsprechende Erweiterung im Speicher gibt, ist das entsprechende Byte = 0xff, ansonsten entspricht es der High-Adresse in Words des letzten Programmes mit aktivem Flag. If there is no corresponding expansion in the memory, the corresponding byte = 0xff, otherwise it corresponds to the high address in Words of the last program with active flag. Befinden sich zum Beispiel auf den Programmplätzen 4 und 6 Video-Treiber, so steht im Tabelleneintrag 0 der Wert 0x66 für die Anfangsadresse von Programmplatz 6. Are, for example, to the program positions 4 and 6 video drivers, so in the table entry is 0, the value 0x66 for the start address of program 6th place Mit der API Funktion api_getprg wird das Y Register auf den Anfang der Tabelle gesetzt. Api_getprg with the API function, the Y register is set to the beginning of the table. Wird aus einem Binärprogramm heraus der Inhalt des Programmspeichers (Programm 1-8) modifiziert, sollte vorher die Funktion api_extdisable aufgerufen werden. Is a binary out of the program memory content modified (range 1-8), the function should be called before api_extdisable. Diese sperrt die externen Funktionen, die zyklisch aufgerufen werden (Videoausgabe, Sound, Frame) um zu verhindern dass Programmaufrufe zu ungültigen Routinen ausgeführt werden. This locks the external functions that are called cyclically (video output, sound, frame) to prevent that program calls are executed on invalid routines. Anschließend muß mit einem Aufruf von api_extsearch die Tabelle wieder aktualisiert werden. Then a call to api_extsearch the table must be updated again.
Die Belegung der Bits geht aus folgender Tabelle hervor, die Bitnummer entspricht dabei gleichzeitig dem Offset gegennüber dem Tabellenanfang: The bit assignment is shown in the following table, the bit number corresponds to the same offset relative to the beginning of the table:

Bit Bit Funktion Function
7 7 Nicht belegt Not used
6 6 Programm enthält einen Font Program contains a font
5 5 Programm enthält einen Dateisystemtreiber Program includes a file system driver
4 4 Programm enthält Treiber für externen/internen Speicher Program includes drivers for external / internal memory
3 3 Programm enthält BASIC-Erweiterung Program contains BASIC Extension
2 2 Programm enthält Sound-Routinen Program includes sound routines
1 1 Programm enthält zyklische Routine, die in jedem Frame aufgerufen wird Program includes cyclic routine that is called on every frame
0 0 Programm enthält Video-Treiber Program contains video drivers


In Byte 15 steht die Bibliotheksnummer. In byte 15 is the library number. Bei Programmen, die keine Bibliotheksfunktion bereitstellen sollte diese mit 0xff belegt sein. For programs that do not provide this library function should be assigned to 0xff. Mit dem BASIC Befehl LFIND kann dann festgestellt werden, ob sich die gesuchte Bibliothek im Speicher befindet. With the BASIC command lfind can then be determined whether the requested library is in memory.

2.4 Beispiele für Programmköpfe 2.4 Examples of program heads

Die nachfolgenden Beispiele enthalten Programmköpfe für verschiedene Programmtypen. The following examples contain program headers for different types of programs. Wenn Programme, Bibliotheken oder Treiber zusätzliche Funktionen bereitstellen, müssen die zugehörigen Bits im Flagbyte 2 gelöscht sein. If deploy programs, libraries or drivers additional features must be deleted, the corresponding bits in the flag byte second

2.4.1 Programmkopf von einfachen Binärprogrammen 2.4.1 Program head of simple binaries

Binärprogramme werden normalerweise vom Hauptmenü aus gestartet, alternativ ist auch ein Start über XCALL P,n möglich, wobei P hier für den Programmplatz 1...8 steht und n nicht ausgewertet wird. Binaries are typically started from the main menu, alternatively is also a start on XCALL P, n possible, where P here for the first space program .. 8 and n is not evaluated.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x00 0x00 0x00 0x00 12 12 Programmname Program Name
--- --- 0x0c 0x0c 1 1 "N" als Kennzeichnung für Binärprogramme "N" as a label for binaries
--- --- 0x0d 0x0d 1 1 Flagbyte 1, normalerweise 0xe5 Flag byte 1, normally 0xE5
--- --- 0x0e 0x0e 1 1 Flagbyte 2, normalerweise 0xff Flag byte 2, normally 0xff
--- --- 0x0f 0x0f 1 1 Bibliotheksnummer, sollte 0xff sein Library number should be 0xff
0x08 0x08 0x10 0x10 12 12 Icon-Daten Icon data
0x0e 0x0e 0x1c 0x1c 2 2 kann beliebig verwendet werden can be used any
0x0f 0x0f 0x1e 0x1e 2 2 kann beliebig verwendet werden can be used any
0x10 0x10 0x20 0x20 2 2 Start des Programms Start the program
% %

2.4.2 Programmkopf von Binärbibliotheken 2.4.2 Program head of binary libraries

Die einzelnen Funktionen von Binärbibliotheken werden vom BASIC aus gestartet, es können entweder numerische Parameter oder auch ein String übergeben werden. The individual functions of binary libraries are started by the BASIC from, it can either be a string or numeric parameter is passed. Wie die Parameterübergabe erfolgt, wird durch das T-Flag festgelegt. As the parameter passing, is determined by the T flag. Ist es gelöscht, sind numerische Parameter übergeben worden. If it is deleted, numerical parameters have been passed. Bei gesetztem T-Flag befindet sich in Y die Adresse des Strings im RAM. With set T flag is located in the Y address of the string in RAM. Das Ende des Strings ist entweder durch "Gänsefüsschen" (0x22) oder durch 0xff markiert. The end of the string is marked either "quote char" (0x22) or 0xff.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x00 0x00 0x00 0x00 12 12 Programmname Program Name
--- --- 0x0c 0x0c 1 1 "N" als Kennzeichnung für Binärprogramme "N" as a label for binaries
--- --- 0x0d 0x0d 1 1 Flagbyte 1 = 0xd4 Flag byte 1 = 0xD4
--- --- 0x0e 0x0e 1 1 Flagbyte 2 = 0xff oder Zusatzfunktionen Flag byte 2 = 0xff or additional functions
--- --- 0x0f 0x0f 1 1 Bibliotheksnummer Library number
0x08 0x08 0x10 0x10 12 12 Icon-Daten Icon data
0x0e 0x0e 0x1c 0x1c 2 2 kann beliebig verwendet werden can be used any
0x0f 0x0f 0x1e 0x1e 2 2 kann beliebig verwendet werden can be used any
0x10 0x10 0x20 0x20 2 2 Sprung zur Routine Nr.0 Jump routine No.0
0x11 0x11 0x22 0x22 2 2 Sprung zur Routine Nr.1 Jump routine No.1
0x12 0x12 0x24 0x24 2 2 Sprung zur Routine Nr.2, weitere Routinen bis 119 möglich Jump routine No.2, more routines to 119 possible


2.4.3 Programmkopf von BASIC-Erweiterungen 2.4.3 Program head of BASIC extensions

Das BASIC kann mit BASIC-Erweiterungen um eigene Befehle ergänzt werden. The BASIC can be supplemented with BASIC extensions to their own commands. Wird dann ein externer Befehl (beginnt mit Unterstrich) erkannt, so wird die Parser-Routine aufgerufen. Then an external command (starts with an underscore) is detected, the parser routine is called.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x00 0x00 0x00 0x00 12 12 Programmname Program Name
--- --- 0x0c 0x0c 1 1 "N" als Kennzeichnung für Binärprogramme "N" as a label for binaries
--- --- 0x0d 0x0d 1 1 Flagbyte 1 = 0xf4 Flag byte 1 = 0xf4
--- --- 0x0e 0x0e 1 1 Flagbyte 2 = 0xf7 Flag byte 2 = 0xF7
--- --- 0x0f 0x0f 1 1 Bibliotheksnummer Library number
0x08 0x08 0x10 0x10 12 12 Icon-Daten Icon data
0x0e 0x0e 0x1c 0x1c 2 2 sollte 0xffff sein should be 0xffff
0x0f 0x0f 0x1e 0x1e 2 2 sollte 0xffff sein should be 0xffff
0x10 0x10 0x20 0x20 2 2 (Sprung zur) Parser-Routine (Jump to) parsing routine
0x11 0x11 0x22 0x22 2 2 Sprung zur Routine Nr.1 Jump routine No.1
0x12 0x12 0x24 0x24 2 2 Sprung zur Routine Nr.2, weitere Routinen bis 119 möglich Jump routine No.2, more routines to 119 possible


2.4.4 Programmkopf von Video-Treibern 2.4.4 Program head of video drivers

Nicht benutzte Routinen sollten mit einem RET beendet werden. Unused routines should be ended with a RET.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x00 0x00 0x00 0x00 12 12 Programmname Program Name
--- --- 0x0c 0x0c 1 1 "N" als Kennzeichnung für Binärprogramme "N" as a label for binaries
--- --- 0x0d 0x0d 1 1 Flagbyte 1 = 0xd3 Flag byte 1 = 0xd3
--- --- 0x0e 0x0e 1 1 Flagbyte 2 = 0xfe Flag byte 2 = 0xfe
--- --- 0x0f 0x0f 1 1 Bibliotheksnummer Library number
0x08 0x08 0x10 0x10 12 12 Icon-Daten Icon data
0x0e 0x0e 0x1c 0x1c 2 2 Sprung zur IN-expansion oder R24 (ereg) auf 40 setzen Jump to the IN expansion or R24 ​​(ereg) put on 40
0x0f 0x0f 0x1e 0x1e 2 2 Sprung zur OUT-expansion oder R24 (ereg) auf 40 setzen Jump to the OUT expansion or R24 ​​(ereg) put on 40
0x10 0x10 0x20 0x20 2 2 Sprung zur (Demo) Anwendung falls Programm startbar Jump to (demo) application program can be started if
0x11 0x11 0x22 0x22 2 2 Sprung zur INIT Videomode (T-Flag gesetzt) oder EXIT Videomode (T-Flag gelöscht) (T-flag set) jump to INIT video mode or video mode EXIT (T flag is cleared)
0x12 0x12 0x24 0x24 2 2 Sprung zur CLS-Routine Jump to the CLS routine
0x13 0x13 0x26 0x26 2 2 Sprung zur Zeichenausgabe, Zeichen in R20 Jump to the character issue, sign in R20
0x14 0x14 0x28 0x28 2 2 Sprung zur Routine, um Cursorposition auf XH:XL setzen Jump to the routine to the cursor position on XH: Set XL
0x15 0x15 0x2a 0x2a 2 2 Sprung zur Plot XH:XL Jump to the plot XH: XL
0x16 0x16 0x2c 0x2c 2 2 Sprung zur Newline-Routine, Cursor zum Anfang der nächsten Zeile Jump to newline routine cursor to the beginning of the next line
0x17 0x17 0x2e 0x2e 2 2 Sprung zur Videoausgabe-Routine Jump to the video output routine
0x18 0x18 0x30 0x30 2 2 Sprung zur Init-Routine bei Systemstart Jump to the init routine at system startup
0x19 0x19 0x32 0x32 2 2 Sprung zur Routine Nr.9, kann bis 119 gehen Jump routine No.9 can go to 119




2.4.5 XMEM Erweiterungen 2.4.5 Extensions XMEM

Mittels Speichererweiterungen kann der nutzbare Speicher vergrößert werden. Memory means the usable memory can be increased. Maximal sind 64 Kilobytes zusätzlicher Speicher möglich, welcher Seitenweise in die Arrayzellen 768...1023 eingeblendet wird. Maximum of 64 kilobytes of additional storage are possible, which side manner appears in the array cells 768th .. 1023rd Im Flagbyte muss dazu Bit 4 gelöscht sein. The flag byte to bit 4 must be deleted.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x19 0x19 0x32 0x32 2 2 Sprung zur Array-READ Routine (Page/R20=Pointer, XL=Daten) Anchor Array READ routine (Page/R20 = Pointer, XL = data)
0x1a 0x1a 0x34 0x34 2 2 Sprung zur Array-WRITE Routine (Page/R20=Pointer, XL=Daten) Anchor Array WRITE routine (Page/R20 = Pointer, XL = data)
0x1b 0x1b 0x36 0x36 2 2 Sprung zur Byte-READ Routine (X+) -> r18 Jump to byte READ routine (X +) -> r18
0x1c 0x1c 0x38 0x38 2 2 Sprung zur Byte-WRITE Routine r18 -> (X+) Jump to byte WRITE routine r18 -> (X +)
0x1d 0x1d 0x3a 0x3a 2 2 Sprung zur Word-READ Routine (X+) -> r19/r18 Jump to the Word READ routine (X +) -> r19/r18
0x1e 0x1e 0x3c 0x3c 2 2 Sprung zur Word-WRITE Routine r19/r18 -> (X+) Jump to the Word WRITE routine r19/r18 -> (X +)
0x1f 0x1f 0x3e 0x3e 2 2 Sprung zur XMEM-CHEXK Routine (X=Adresse der letzten Speicherzelle oder 0, falls kein XMEM existiert) Jump to XMEM CHEXK routine (X = address of the last memory cell, or 0 if no XMEM exists)
0x20 0x20 0x40 0x40 2 2 Sprung zur XMEM-CLEAR Routine (beschreibt komplettes XMEM mit 0x00) Jump to XMEM CLEAR routine (complete describes XMEM with 0x00)
0x21 0x21 0x42 0x42 2 2 Sprung zur Routine Nr.17, kann bis 119 gehen No.17 can jump routine, go to 119




2.4.6 Frame Interrupts 2.4.6 Frame Interrupts

Mittels der Frame-Interrupt Erweiterung kann eine eigene Routine am unteren Ende des farbigen Randes (Border) aufgerufen werden. By means of the frame interrupt expansion can own routine at the lower end of the colored border (board) to be called. Anwendungsbeispiel wäre zB die Abfrage einer Echtzeituhr oder die Abtastung von DCF77 Signalen. Application example would be to query a time clock or the scanning of DCF77 signals. Im Flagbyte 2 muss dazu Bit 1 gelöscht sein. The flag byte 2 to 1 bit must be cleared.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x21 0x21 0x42 0x42 2 2 Sprung zur Frame-INT Routine Jump to frame INT routine




2.4.7 SOUND Erweiterungen 2.4.7 SOUND extensions

Mittels Sound-Erweiterungen kann die Tonausgabe in gewissen Grenzen an eigene Bedürfnisse angepasst werden. Through sound enhancements, the sound to a certain extent be adapted to your own needs. So können eigene Tabellen für die Tonerzeugung verwendet und die Lautstärkeberechnung modifiziert werden. Thus, their own tables used for the tone and volume calculation can be modified. Im Flagbyte 2 muss dazu Bit 2 gelöscht sein. In this flag byte 2 Bit 2 must be deleted.


WORD Offset WORD offset BYTE Offset BYTE offset Länge (Bytes) Length (Bytes) Funktion Function
0x22 0x22 0x44 0x44 2 2 Sprung zur Envelope Routine (am Ende des Frames) Jump to Envelope routine (at the end of frame)
0x23 0x23 0x46 0x46 2 2 Sprung zur Noten Routine Jump to notes routine




2.5 Übergabe von Parametern und Resultaten 2.5 passing parameters and results

Um Erweiterungen für das BASIC zu schreiben, kann auf die Übergabeparameter und den Resultatwert zugegriffen werden. To write extensions for the BASIC, can be accessed on the transfer parameters and the return value. Dies geschieht mit der Funktion api_getvalues , die einen Zeiger auf die folgende Struktur im Y-Register zurückliefert: This happens api_getvalues ​​with the function returns a pointer to the structure in the Y-register:


Offset Offset Format Format Inhalt Content
0 0 INTEGER INTEGER Rückgabewert der Funktion Return value of the function
2 2 INTEGER INTEGER Aufruf-Paramter 1 Call 1-parameter
4 4 INTEGER INTEGER Aufruf-Paramter 2 Usage parameter 2
6 6 INTEGER INTEGER Aufruf-Paramter 3 Usage parameter 3
8 8 INTEGER INTEGER Aufruf-Paramter 4 Usage parameter 4
10 10 INTEGER INTEGER Aufruf-Paramter 5 Call parameter 5
12 12 BYTE BYTE Anzahl der übergebenen Paramter Number of passed parameters


Die Parameter-Werte habe nur Gültigkeit wenn das T-Flag gelöscht ist (numerische Parameter), der Rückgabewert ist aber in beiden Fällen nutzbar. The parameter values ​​have validity only if the T flag is cleared (numeric parameter), the return value is used in both cases.

2.6 Adressbereich für I/O-Erweiterungen 2.6 Address range for I / O expansion

Damit I/O Erweiterungen möglichst universell genutzt werden können, ist eine Standardisierung zumindest für die wiichtigsten Adressbereiche notwendig. Thus I / O can be used as universally as possible extensions, at least for a standardization wiichtigsten address ranges is necessary. Die vorliegende Tabelle stellt nur eine Minimalbasis dar und wird wahrscheinlich im Laufe der Zeit noch ergänzt werden müssen. This table shows only a minimal basis and is likely in time have to be supplemented. Alle Treiber müssen für Adressbereiche die sie nicht bedienen den Wert 40 (0x28) im Register R24 (ereg) zurückliefern. All drivers need to address areas for which they do not use the return value of 40 (0x28) in the register R24 ​​(ereg).
Startadresse Start Address Endadresse End address Bedeutung Importance
0x800 0x800 0x809 0x809 Pegel der nutzbaren Ausgabe-Pins, wenn I/O deaktiviert ist (0/1) Level of usable output pins when I / O is disabled (0/1)
0x810 0x810 0x819 0x819 Datenrichtung der nutzbaren Ausgabe-Pins, wenn I/O deaktiviert ist (0/1) Data direction of usable output pins when I / O is disabled (0/1)
0x900 # CHAN_ 0x900 0xbff 0xbff Treiberspezifische I/O Driver-specific I / O
0x0c00 0x0c00 0xffff 0xffff zur Zeit nicht belegt not currently occupied


2.7 Build-Prozess zum Erstellen einer eigenen Applikation 2.7 Build process to create your own application

Das Erstellen eines Binärprogrammes unterscheidet sich etwas von der "normalen " Vorgehensweise. Creating a Binärprogrammes is somewhat different from the "normal" procedure. Die nachfolgende Aufzählung beschreibt das Vorgehen unter Linux und wird so unter anderen Betriebssystemen nur eingeschränkt oder nicht funktionieren. The following list describes the process in Linux and is so limited under other operating systems or just do not work. Die notwendigen Include-Dateien für die von mir erstellten Programme und Bibliotheken werden im Verzeichnis /usr/local/include/chipbasic2 erwartet, ggf. muss der Pfad angepasst werden. The necessary header files that I created for the programs and libraries are located in the directory / usr/local/include/chipbasic2, if the path needs to be adjusted.
Folgende Schritte sind zum Erstellen einer Binärdatei notwendig: The following steps are necessary to create a binary file:
  1. Erstellung des Programmes Creation of the program
  2. Assemblierung mit AVRA Assembly with AVRA
  3. Umwandlung in das Binärformat mit hex2bin Conversion to binary format with Hex2Bin
  4. Kontrolle, dass die Binärdatei maximal 3072 Bytes groß ist Check that the binary maximum 3072 bytes in size
  5. Erstellung einer beliebigen Datei, welche zusammen mit der Binärdatei aus dem vorigen Schritt genau 3072 Bytes lang ist Creation of any file, which is exactly along with the binary file in the previous step 3072 bytes long
  6. Die erstellte Datei an die Binärdatei anhängen The created file to the binary file append
  7. Die im Schritt 5 erzeugte Datei kann nun wieder gelöscht werden The file created in Step 5 can now be deleted again
Um das nicht jedesmal von Hand machen zu müssen gibt es ein kleines Build-Script, welches einen Großteil der Arbeit abnimmt. To not do this manually each time it must have a small build script, which decreases much of the work. Aufgerufen wird es mit build-bin name , wobei name für die ASM-Datei (ohne .asm) steht. It is activated with build-bin name, where name for the ASM file (without. Asm) stands.
Nach Abschluss sollte im Verzeichnis eine Datei name.bin stehen, die dann zum AVR-Computer via XModem übertragen werden kann. After completion of a file in the directory should be name.bin which can then be transmitted to the AVR-computer via XModem.

3 Verzeichnis der API-Funktionen 3 List of API functions



3.1 Aufbau der Funktionstabelle 3.1 Structure of the function table

Funktionsname Function Name Name der API-Funktion, entspricht auch dem Makro-Aufruf Name of the API function, is consistent with the macro call
Aufruf ohne Makro Call without macro Aufruf der Funktion, wenn ohne Makros gearbeitet wird The function is called when working with macros
Funktionsbeschreibung Function Description Kurzbeschreibung der Funktion Brief Description of Function
Parameter Parameter Registerzuordnung zu den Parametern Assignment tab on the parameters
Rückgabewerte Return Values Registerzuordnung zu den Rückgabewerten Register allocation to the return values
Register Register Register, deren Inhalt verändert wird (ausser Rückgabewerte) Register, the content is changed (except for return values)
Videomodi Modes Videomodi, in denen die Funktion sinnvoll einsetzbar ist. Modes in which the function should be used. Wenn diese Tabellenzeile fehlt, ist die Funktion in allen Videomodi anwendbar. If this row is missing, the function is applicable in all video modes.


Zusätzlich zu den angegebenen Registern werden teilweise die Register R0 und R1 sowie das Fehlerregister R24 durch die API-Funktionen überschrieben. In addition to the specified registers partly the registers R0 and R1, and the error register R24 ​​is overwritten by the API functions.

3.2 Sichern und Restaurieren von Registern 3.2 Back up and restoring registers

Funktionsname Function Name api_pushxyz api_pushxyz
Aufruf ohne Makro Call without macro call api_pushxyz call api_pushxyz
Funktionsbeschreibung Function Description sichert die Register X,Y und Z auf den Stack ensures the registers X, Y and Z on the stack
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R0, R1 R0, R1



Funktionsname Function Name api_popxyz api_popxyz
Aufruf ohne Makro Call without macro jmp api_popxyz jmp api_popxyz
Funktionsbeschreibung Function Description holt die Register X,Y und Z vom Stack und führt ein RET aus fetches the registers X, Y and Z from the stack and performs a RET
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register X, Y, Z X, Y, Z



Funktionsname Function Name api_pushregs api_pushregs
Aufruf ohne Makro Call without macro call api_pushregs call api_pushregs
Funktionsbeschreibung Function Description sichert die Register X,Y und Z sowie R20-R23 auf den Stack ensures the registers X, Y and Z and R20-R23 to the stack
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R0, R1 R0, R1



Funktionsname Function Name api_popxyz api_popxyz
Aufruf ohne Makro Call without macro jmp api_popregs jmp api_popregs
Funktionsbeschreibung Function Description holt die Register X,Y und Z sowie R20-R23 vom Stack und führt ein RET aus fetches the registers X, Y and Z and R20-R23 from the stack and performs a RET
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register X, Y, Z, R20, R21, R22, R23 X, Y, Z, R20, R21, R22, R23


3.3 Berechnungsfunktionen 3.3 Calculation Functions

Alle Berechnungsfunktionen (außer der Quadratwurzel) beziehen sich auf vorzeichenbehaftete 16 Bit Zahlen. All calculation functions (except the square root) related to signed 16-bit numbers. Dabei bildet das X-Register eine Art "Akkumulator", als zweiter Operand wird das Registerpaar R16/R17 genutzt. Here is the X-register a "battery", as the second operand, the register pair R16/R17 used. R24 ist nach der Operation entweder 0 (kein Fehler) oder enthält einen Fehlercode. R24 after surgery either 0 (no error) or contains an error code. Die Fehlercodes entsprechen denen im BASIC Programm. The error codes correspond to those in the BASIC program.
Funktionsname Function Name api_add api_add
Aufruf ohne Makro Call without macro call api_add call api_add
Funktionsbeschreibung Function Description X = X + R16/R17 X = X + R16/R17
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X X
Register Register R18 R18



Funktionsname Function Name api_sub api_sub
Aufruf ohne Makro Call without macro call api_sub call api_sub
Funktionsbeschreibung Function Description X = X - R16/R17 X = X - R16/R17
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X X
Register Register R16/R17 = -R16/R17 R16/R17 = -R16/R17



Funktionsname Function Name api_mul api_mul
Aufruf ohne Makro Call without macro call api_mul call api_mul
Funktionsbeschreibung Function Description X = X * R16/R17 X = X * R16/R17
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X X
Register Register R16...R21 R16 R21 ...



Funktionsname Function Name api_div api_div
Aufruf ohne Makro Call without macro call api_div call api_div
Funktionsbeschreibung Function Description X = X / R16/R17 X = X / R16/R17
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X = Quotient, R18/R19 = Rest X = ratio, R18/R19 = remainder
Register Register R20, R21 R20, R21



Funktionsname Function Name api_sin api_sin
Aufruf ohne Makro Call without macro call api_sin call api_sin
Funktionsbeschreibung Function Description X = 256 * SIN(X) X = 256 * SIN (X)
Parameter Parameter X (in Grad) X (in degrees)
Rückgabewerte Return Values X X
Register Register Z, R16, R17 Z, R16, R17



Funktionsname Function Name api_cos api_cos
Aufruf ohne Makro Call without macro call api_cos call api_cos
Funktionsbeschreibung Function Description X = 256 * COS(X) X = 256 * COS (X)
Parameter Parameter X (in Grad) X (in degrees)
Rückgabewerte Return Values X X
Register Register Z, R16, R17 Z, R16, R17



Funktionsname Function Name api_eq api_eq
Aufruf ohne Makro Call without macro call api_eq call api_eq
Funktionsbeschreibung Function Description gibt 1 zurück, wenn X == R16/R17, ansonsten 0 returns 1 if X == R16/R17 otherwise, 0
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X X
Register Register --- ---



Funktionsname Function Name api_gt api_gt
Aufruf ohne Makro Call without macro call api_gt call api_gt
Funktionsbeschreibung Function Description gibt 1 zurück, wenn X > R16/R17, ansonsten 0 returns 1 if X> R16/R17 otherwise, 0
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X X
Register Register --- ---



Funktionsname Function Name api_lt api_lt
Aufruf ohne Makro Call without macro call api_lt call api_lt
Funktionsbeschreibung Function Description gibt 1 zurück, wenn X < R16/R17, ansonsten 0 returns 1 if X <R16/R17 otherwise, 0
Parameter Parameter X, R16, R17 X, R16, R17
Rückgabewerte Return Values X X
Register Register --- ---



Funktionsname Function Name api_sqr api_sqr
Aufruf ohne Makro Call without macro call api_sqr call api_sqr
Funktionsbeschreibung Function Description gibt die Quadratwurzel aus X zurück, X ist in diesem Fall vorzeichenlos returns the square root of X, X is unsigned in this case
Parameter Parameter X X
Rückgabewerte Return Values X X
Register Register R16, R17, R18, R19 R16, R17, R18, R19



Funktionsname Function Name api_abs api_abs
Aufruf ohne Makro Call without macro call api_abs call api_abs
Funktionsbeschreibung Function Description gibt den Absolutwert von X zurück returns the absolute value of X
Parameter Parameter X X
Rückgabewerte Return Values X X
Register Register --- ---



Funktionsname Function Name api_rnd api_rnd
Aufruf ohne Makro Call without macro call api_rnd call api_rnd
Funktionsbeschreibung Function Description gibt eine Zufallszahl zwischen 0 und X-1 zurück returns a random number between 0 and X-1
Parameter Parameter X X
Rückgabewerte Return Values X X
Register Register R16...R19 R16 R19 ...



Funktionsname Function Name api_dbit api_dbit
Aufruf ohne Makro Call without macro call api_dbit call api_dbit
Funktionsbeschreibung Function Description berechnet Bitmuster für Zeichensätze im Videomode 4, entspricht der DBIT() Funktion im BASIC calculated pattern for fonts in video mode 4, corresponds to the DBIT () function in BASIC
Parameter Parameter X X
Rückgabewerte Return Values X X
Register Register --- ---



Funktionsname Function Name api_adc api_adc
Aufruf ohne Makro Call without macro call api_adc call api_adc
Funktionsbeschreibung Function Description startet den ADC und gibt den ADC-Wert zurück. starts the ADC and returns the ADC value.
Parameter Parameter X = Kanal (0...7) X = channel (0 .. 7)
Rückgabewerte Return Values X = ADC Wert X = ADC value
Register Register --- ---



Funktionsname Function Name api_scale api_scale
Aufruf ohne Makro Call without macro call api_scale call api_scale
Funktionsbeschreibung Function Description Skalierungsfunktion Scaling function
Parameter Parameter Die Parameter liegen in dem mit api_getpartab definierten Bereich The parameters are within the range defined by api_getpartab
Rückgabewerte Return Values R16/R17 = Resultat R16/R17 = result
Register Register R4-R7,R18,R19 R4-R7, R18, R19


Die Funktion entspricht dem SCALE Befehl im BASIC. The function corresponds to the SCALE command in BASIC. Berechnet wird Is calculated

Y = Y0 + ((Y1 - Y0) * (X - X0) / (X1 - X0)) Y = Y0 + ((Y1 - Y0) * (X - X0) / (X1 - X0))

Die Parameter liegen hintereinander im Parameterbereich des Interpreters, der durch api_getpartab bestimmt werden kann, wobei immer zuerst das LSB und danach das MSB im Speicher liegt. The parameters are in a row in the parameter area of the interpreter, which can be determined by api_getpartab, always first the LSB and then the MSB is in memory. Die Reihenfolge der Parameter ist dabei wie folgt festgelegt: The order of the parameters is defined as follows:


Offset Offset Parameter Parameter
0 0 Y0 Y0
2 2 Y1 Y1
4 4 X0 X0
6 6 X X
8 8 X1 X1


3.4 Programmsteuerung 3.4 Program Control

Funktionsname Function Name api_sync api_sync
Aufruf ohne Makro Call without macro call api_sync call api_sync
Funktionsbeschreibung Function Description wartet auf das Ende des gerade dargestellten Halbbildes (unterer Rand des genutzen Bereiches) waiting for the end of the currently displayed field (lower edge of the range for use anywhere)
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_fast api_fast
Aufruf ohne Makro Call without macro call api_fast call api_fast
Funktionsbeschreibung Function Description schaltet die Bildausgabe ab switches the output image
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_slow api_slow
Aufruf ohne Makro Call without macro call api_slow call api_slow
Funktionsbeschreibung Function Description schaltet die Bildausgabe ein switches the output image
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_wpage api_wpage
Aufruf ohne Makro Call without macro call api_wpage call api_wpage
Funktionsbeschreibung Function Description schreibt eine Flash-Page writes a Flash Page
Parameter Parameter Y=RAM-Adresse, Z=Flash-Adresse Y = RAM address, Z = flash address
Rückgabewerte Return Values --- ---
Register Register R20...R23,X,Y,Z R20 ... R23, X, Y, Z


3.5 Auskunftsfunktionen 3.5 Information functions

Funktionsname Function Name api_version api_version
Aufruf ohne Makro Call without macro call api_version call api_version
Funktionsbeschreibung Function Description ermittelt die API-Version determine the API version
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = API-Version (derzeit 6) R20 = API version (currently 6)
Register Register --- ---



Funktionsname Function Name api_getvram api_getvram
Aufruf ohne Makro Call without macro call api_getvram call api_getvram
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des Bildspeichers determines the initial address of the image memory
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang des Bildspeichers Y points to the beginning of the image memory
Register Register --- ---



Funktionsname Function Name api_getsysram api_getsysram
Aufruf ohne Makro Call without macro call api_getsysram call api_getsysram
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des System-Speichers determines the start address of the system memory
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang des System-Speichers Y points to the beginning of the system memory
Register Register --- ---



Funktionsname Function Name api_getpal api_getpal
Aufruf ohne Makro Call without macro call api_getpal call api_getpal
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des Paletten-Speichers determines the start address of the palette memory
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang des Paletten-Speichers Y points to the beginning of the pallet storage
Register Register --- ---



Funktionsname Function Name api_getarray api_getarray
Aufruf ohne Makro Call without macro call api_getarray call api_getarray
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des Arrays determines the start address of the array
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang des Arrays Y points to the beginning of the array
Register Register --- ---



Funktionsname Function Name api_getvar api_getvar
Aufruf ohne Makro Call without macro call api_getvar call api_getvar
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse der BASIC-Variablen determines the initial address of the BASIC variables
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang der BASIC-Variablen (Variable "A") Y points to the beginning of the BASIC variables (variable "A")
Register Register --- ---



Funktionsname Function Name api_getprg api_getprg
Aufruf ohne Makro Call without macro call api_getprg call api_getprg
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse der Programmbelegung determines the starting address of the program allocation
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang der Belegungstabelle (Word) Y points to the beginning of the allocation table (Word)
Register Register --- ---


Die Belegungstabelle besteht aus 8 Werten. The allocation table consists of 8 levels. Diese sind 8 möglichen Funktionalitäten zugeordnet. These are associated with 8 possible functionalities. Wenn mindestens ein Programm / Treiber / Bibliothek die Funktionalität anbietet, befindet sich die HIGH-Adresse ider entsprechenden Speicherzelle. If at least one program / driver / library provides the functionality, is the HIGH address ider corresponding memory cell. Die Adresse bezieht sich auf 16-Bit Werte, so dass der Wert direkt in das ZH-Register für Sprünge und Unterprogrammaufrufe verwendet werden kann. The address refers to 16-bit values, so that the value can be used directly in the ZH-register for jumps and subroutine calls. Wird eine Funktionalität nicht angeboten, so befindet sich in der entsprechenden Speicherzelle der Wert 0 Is a functionality not offered, is located in the corresponding memory cell, the value 0
Funktionsname Function Name api_getvalues api_getvalues
Aufruf ohne Makro Call without macro call api_getvalues call api_getvalues
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des Funktionsparameter-Blocks determines the start address of function block parameters
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang des Blockes Y points to the beginning of the block
Register Register --- ---



Funktionsname Function Name api_getpartab api_getpartab
Aufruf ohne Makro Call without macro call api_getpartab call api_getpartab
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des (internen) Parameter-Blocks determines the start address of the (internal) parameter block
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang des Blockes Y points to the beginning of the block
Register Register --- ---



Funktionsname Function Name api_getchart0 api_getchart0
Aufruf ohne Makro Call without macro call api_getchart0 call api_getchart0
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse der Zeichentabelle für Font 0 im Flash determines the initial address of the character table for font 0 in Flash
Parameter Parameter --- ---
Rückgabewerte Return Values Z zeigt auf den Anfang der Zeichentabelle für Font 0 Z points to the beginning of the character table for Font 0
Register Register --- ---



Funktionsname Function Name api_getchart1 api_getchart1
Aufruf ohne Makro Call without macro call api_getchart1 call api_getchart1
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse der Zeichentabelle für Font 1 im Flash determines the initial address of the character table for font 1 in Flash
Parameter Parameter --- ---
Rückgabewerte Return Values Z zeigt auf den Anfang der Zeichentabelle für Font 1 Z points to the beginning of the character table for Font 1
Register Register --- ---



Funktionsname Function Name api_getbuffer api_getbuffer
Aufruf ohne Makro Call without macro call api_getbuffer call api_getbuffer
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse der beiden BASIC Buffer determines the initial address of the buffer BASIC
Parameter Parameter --- ---
Rückgabewerte Return Values Y zeigt auf den Anfang der beiden Speicherbereiche Y points to the beginning of the two memory areas
Register Register --- ---

  • Der BASIC Pufferbereich besteht aus zwei Puffern a 40 Bytes. The BASIC buffer area consists of two buffers, a 40 bytes. Der erste Bereich ist der Textpuffer, der zB den bei INPUT eingegebenen Text enthält. The first area is the text buffer containing eg the entered text at INPUT. Außerdem dient er als Source-Puffer bei den api_token und api_untoken Routinen. He also serves as the source buffer at the api_token and api_untoken routines.
  • Der zweite Bereich ist der Code-Buffer für das BASIC. The second area is the code buffer for the BASIC. Zum einen werden aus diesem Speicherbereich die BASIC-Zeilen interpretiert, zum anderen dient er als Code-Puffer für die api_token und api_untoken Routinen. To one of said memory area, the BASIC lines are interpreted, and secondly, it serves as a buffer for the code and api_token api_untoken routines.

Funktionsname Function Name api_getprog api_getprog
Aufruf ohne Makro Call without macro call api_getprog call api_getprog
Funktionsbeschreibung Function Description bestimmd die Nummer des aufrufenden Programmes im Flash bestimmd the number of the calling program in the flash
Parameter Parameter --- ---
Rückgabewerte Return Values ZL = Programmnummer (0...7) ZL = program number (0 .. 7)
Register Register ZH ZH



Funktionsname Function Name api_getbase api_getbase
Aufruf ohne Makro Call without macro call api_getbase call api_getbase
Funktionsbeschreibung Function Description bestimmt die Anfangsadresse des aufrufenden Programmes im Flash determines the initial address of the calling program in the flash
Parameter Parameter --- ---
Rückgabewerte Return Values Z zeigt auf den Anfang des aufrufenden Programmes Z points to the beginning of the calling program
Register Register --- ---



Funktionsname Function Name api_dataptr api_dataptr
Aufruf ohne Makro Call without macro call api_dataptr call api_dataptr
Funktionsbeschreibung Function Description bestimmt die Adresse eines Datenblocks im aufrufenden Programm determines the address of a data block in the calling program
Parameter Parameter X = Offset X = Offset
Rückgabewerte Return Values Z zeigt auf die absolute Adresse eines Datenblocks im aufrufenden Programm Z points to the absolute address of a data block in the calling program
Register Register --- ---



Funktionsname Function Name api_drvcode api_drvcode
Aufruf ohne Makro Call without macro call api_drvcode call api_drvcode
Funktionsbeschreibung Function Description bestimmt Flagbyte und Drivercode eines geladenen Treibers determined flag byte code of a loaded driver and Driver
Parameter Parameter --- ---
Rückgabewerte Return Values R20=Flagbyte, R21=Drivercode Flag byte = R20, R21 = Driver Code
Register Register --- ---


3.6 Tastatur 3.6 Keyboard

Funktionsname Function Name api_waitkey api_waitkey
Aufruf ohne Makro Call without macro call api_waitkey call api_waitkey
Funktionsbeschreibung Function Description wartet auf einen Tastendruck (ausser SHIFT, CTRL, ALT) waits for a key press (except SHIFT, CTRL, ALT)
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = Keycode der gedrückten Taste R20 = keycode of the key pressed
Register Register --- ---



Funktionsname Function Name api_nokey api_nokey
Aufruf ohne Makro Call without macro call api_nokey call api_nokey
Funktionsbeschreibung Function Description wartet solange, bis keine Taste mehr gedrückt ist (ausser SHIFT, CTRL, ALT) waits, and no key is pressed (except SHIFT, CTRL, ALT)
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_kstate api_kstate
Aufruf ohne Makro Call without macro call api_kstate call api_kstate
Funktionsbeschreibung Function Description gibt den augenblicklichen Zustand der SHIFT-, CTRL- und ALT-Tasten zurück returns the current state of the SHIFT, CTRL and ALT keys
Parameter Parameter --- ---
Rückgabewerte Return Values R20 (Bit0=LSHIFT, Bit1=RSHIFT, Bit2=LCTRL, Bit3=RCTRL, Bit4=ALT) R20 (Bit0 = LSHIFT, Bit1 = RSHIFT, bit 2 = Left Ctrl, bit 3 = RCTRL, Bit 4 = ALT)
Register Register --- ---



Funktionsname Function Name api_keycode api_keycode
Aufruf ohne Makro Call without macro call api_keycode call api_keycode
Funktionsbeschreibung Function Description gibt den Keycode der gerade gedrückten Taste oder 0x00 (keine Taste gedrückt) zurück is the key code of the key currently pressed or 0x00 (press any button) back
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = Keycode R20 = keycode
Register Register --- ---



Funktionsname Function Name api_lastkey api_lastkey
Aufruf ohne Makro Call without macro call api_lastkey call api_lastkey
Funktionsbeschreibung Function Description gibt den Keycode der zuletzt gedrückten Taste oder 0x00 (noch keine Taste gedrückt) zurück is the key code of the last key pressed, or 0x00 (not press a key) back
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = Keycode R20 = keycode
Register Register --- ---



Funktionsname Function Name api_scancode api_scancode
Aufruf ohne Makro Call without macro call api_scancode call api_scancode
Funktionsbeschreibung Function Description gibt den Scancode der zuletzt gedrückten Taste zurück returns the scan code of the last key pressed
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = Scancode R20 = scancode
Register Register --- ---


3.7 Bildschirmausgabe 3.7 screen output

Funktionsname Function Name api_clrscr api_clrscr
Aufruf ohne Makro Call without macro call api_clrscr call api_clrscr
Funktionsbeschreibung Function Description löscht den Bildschirm mit der aktuellen Farbeinstellung clears the screen with the current color setting
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R20 R20
Videomodi Modes 0...6 0 .. 6



Funktionsname Function Name api_clearvec api_clearvec
Aufruf ohne Makro Call without macro call api_clearvec call api_clearvec
Funktionsbeschreibung Function Description löscht den Vektorbereich im Grafikmode 7 deletes the vector field in the graphics mode 7
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 7 7



Funktionsname Function Name api_cleartext api_cleartext
Aufruf ohne Makro Call without macro call api_cleartext call api_cleartext
Funktionsbeschreibung Function Description löscht den Textbereich im Grafikmode 7 mit der aktuellen Farbeinstellung clears the text area in the graphic mode 7 with the current color setting
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 7 7



Funktionsname Function Name api_gotoxy api_gotoxy
Aufruf ohne Makro Call without macro call api_gotoxy call api_gotoxy
Funktionsbeschreibung Function Description setzt die Position des Text-Cursors (auch in den Grafikmodi) sets the position of the text cursor (also in the video modes)
Parameter Parameter XL = X-Position, XH = Y-Position, In den Grafikmodi als Pixelposition XL = X position, XH = Y position, as in the graphics modes pixel position
Rückgabewerte Return Values --- ---
Register Register Im Textmodus werden XL und XH auf die maximalen Bildschirmkoordinaten begrenzt In text mode, XL and XH are limited to the maximum screen coordinates
Videomodi Modes alle all


Bei den Ausgabefunktionen bestimmt R25 den Modus, die Werte sind beim PRINT Befehl näher erläutert. When the output functions determined R25 mode, the values ​​are the PRINT command in more detail. Ebenso bestimmt der eingestellte Channel, wohin ausgegeben wird. Also determined the set channel is displayed where.
Funktionsname Function Name api_outchar api_outchar
Aufruf ohne Makro Call without macro call api_outchar call api_outchar
Funktionsbeschreibung Function Description gibt ein Zeichen aus outputs a signal
Parameter Parameter R20 = Zeichen, R25 = Mode R20 = sign, R25 = Fashion
Rückgabewerte Return Values --- ---
Register Register R20, R21 R20, R21
Videomodi Modes alle all



Funktionsname Function Name api_newline api_newline
Aufruf ohne Makro Call without macro call api_newline call api_newline
Funktionsbeschreibung Function Description gibt einen Zeilenvorschub aus is a line feed
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R20, R21 R20, R21
Videomodi Modes 0, 4, 6 0, 4, 6



Funktionsname Function Name api_outdez api_outdez
Aufruf ohne Makro Call without macro call api_outdez call api_outdez
Funktionsbeschreibung Function Description gibt den Inhalt von X dezimal aus (-32768...32767) returns the contents of X in decimal (-32768 ... 32767)
Parameter Parameter X= 16-Bit Wert, R25 = Mode/Format X = 16-bit value, R25 = Mode / Format
Rückgabewerte Return Values --- ---
Register Register R20, R21 R20, R21
Videomodi Modes alle all



Funktionsname Function Name api_outhex api_outhex
Aufruf ohne Makro Call without macro call api_outhex call api_outhex
Funktionsbeschreibung Function Description gibt den Inhalt von X hexadezimal aus (00...FF oder 0000...FFFF) returns the contents of X in hexadecimal (00 .. FF or 0000 ... FFFF)
Parameter Parameter X= 16-Bit Wert, R25 = Mode/Format X = 16-bit value, R25 = Mode / Format
Rückgabewerte Return Values --- ---
Register Register R20, R21 R20, R21
Videomodi Modes alle all



Funktionsname Function Name api_romtext api_romtext
Aufruf ohne Makro Call without macro call api_romtext call api_romtext
Funktionsbeschreibung Function Description gibt einen nullterminierten String aus dem Flash aus returns a null-terminated string from flash
Parameter Parameter Z = Zeiger auf den String im Flash Z = pointer to the string in flash
Rückgabewerte Return Values --- ---
Register Register Z, R20, R21 Z, R20, R21
Videomodi Modes alle all



Funktionsname Function Name api_thistext api_thistext
Aufruf ohne Makro Call without macro call api_thistext call api_thistext
Funktionsbeschreibung Function Description gibt einen nullterminierten String aus dem Flash aus, der direkt auf den Aufruf folgt. returns a null-terminated string from flash, immediately following the call.
Parameter Parameter Wenn das erste Byte 0xFF ist, folgt direkt der auszugebende String, andernfalls wird das erste Byte als Y-Koordinate und das zweite als X-Koordinate gewertet, bevor die eigentliche Zeichenkette folgt. If the first byte is 0xFF, directly follows the string to be output, otherwise the first byte is interpreted as Y coordinate, and the second for the X coordinate, before the actual string follows.
Rückgabewerte Return Values --- ---
Register Register Z, R20, R21 Z, R20, R21
Videomodi Modes alle all



Funktionsname Function Name api_cbox api_cbox
Aufruf ohne Makro Call without macro call api_cbox call api_cbox
Funktionsbeschreibung Function Description Löscht eine Rechteckfläche mit der eingestellten Farbe Clears a rectangular area with the selected color
Parameter Parameter YL = X1, YH = Y1, ZL = X2, ZH = Y2 YL = X1, Y = Y1, X2 = ZL, ZH = Y2
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 4 0, 1, 4



Funktionsname Function Name api_ibox api_ibox
Aufruf ohne Makro Call without macro call api_ibox call api_ibox
Funktionsbeschreibung Function Description Invertiert eine Rechteckfläche (tauscht Vorder- mit Hintergrundfarbe) Invert a rectangular area (front replaced with the background color)
Parameter Parameter YL = X1, YH = Y1, ZL = X2, ZH = Y2 YL = X1, Y = Y1, X2 = ZL, ZH = Y2
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 4 0, 1, 4



Funktionsname Function Name api_scroll api_scroll
Aufruf ohne Makro Call without macro call api_scroll call api_scroll
Funktionsbeschreibung Function Description Scrollt den inneren Bildschirmbereich, siehe SCROLL Befehl Scrolls the inner area of ​​the screen, see SCROLL command
Parameter Parameter R20 = Richtung (0=nach oben, 1=nach rechts, 2=nach unten, 3=nach links) R20 = direction (0 = up, 1 = right, 2 = down, 3 = left)
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 4, 6 0, 4, 6



Funktionsname Function Name api_sprite api_sprite
Aufruf ohne Makro Call without macro call api_sprite call api_sprite
Funktionsbeschreibung Function Description stellt ein Sprite dar (siehe BASIC Refrenz) represents a sprite (see BASIC Refrence)
Parameter Parameter XL=X, XH=Y, Y=Pointer auf Sprite-Daten XL = X, XH = Y, Y = Pointer to sprite data
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 4, 6 0, 4, 6



Funktionsname Function Name api_copychar4 api_copychar4
Aufruf ohne Makro Call without macro call api_copychar4 call api_copychar4
Funktionsbeschreibung Function Description kopiert ein Zeichen aus dem System-Zeichensatz in den User-Zeichensatz für Videomode 4 copy a character from the system font in the user font for Video Mode 4
Parameter Parameter R20 = System-Zeichen, R21 = User Zeichen (0...127) R20 = system character, R21 = User characters (0 .. 127)
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 4 4



Funktionsname Function Name api_copychar6 api_copychar6
Aufruf ohne Makro Call without macro call api_copychar6 call api_copychar6
Funktionsbeschreibung Function Description kopiert ein Zeichen aus dem System-Zeichensatz in den User-Zeichensatz für Videomode 6 copy a character from the system font in the user font for video mode 6
Parameter Parameter R20 = System-Zeichen, R21 = User Zeichen (0...63), R22 = VG/HG Farbe R20 = system character, R21 = User characters (0 .. 63), R22 = FG / BG Color
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 6 6



Funktionsname Function Name api_sbackup api_sbackup
Aufruf ohne Makro Call without macro call api_sbackup call api_sbackup
Funktionsbeschreibung Function Description kopiert den sichtbaren Screen-Bereich in den Monitor-Backup Screen copied the visible screen area in the Monitor Backup Screen
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R20, X, Y, Z R20, X, Y, Z
Videomodi Modes nur bei 1 und 5 sinnvoll useful only for 1 and 5



Funktionsname Function Name api_srestore api_srestore
Aufruf ohne Makro Call without macro call api_srestore call api_srestore
Funktionsbeschreibung Function Description kopiert den Monitor-Backup Screen in den sichtbaren Screen-Bereich copies the backup monitor screen in the visible screen area
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R20, X, Y, Z R20, X, Y, Z
Videomodi Modes nur bei 1 und 5 sinnvoll useful only for 1 and 5


3.8 Grafik 3.8 Graphics

Funktionsname Function Name api_plot api_plot
Aufruf ohne Makro Call without macro call api_plot call api_plot
Funktionsbeschreibung Function Description Zeichnet einen Punkt in der eingestellten Vordergrundfarbe Draws a point in the set foreground color
Parameter Parameter XL=X, XH=Y XL = X, Y = XH
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 2, 3, (4), 5 0, 1, 2, 3, (4), 5



Funktionsname Function Name api_draw api_draw
Aufruf ohne Makro Call without macro call api_draw call api_draw
Funktionsbeschreibung Function Description Zeichnet eine Linie in der eingestellten Vordergrundfarbe Draw a line in the selected foreground color
Parameter Parameter YL=X1, YH=Y1, ZL=X2, ZH=Y2 YL = X1, Y = Y1, X2 = ZL, ZH = Y2
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 2, 3, (4), 5 0, 1, 2, 3, (4), 5



Funktionsname Function Name api_box api_box
Aufruf ohne Makro Call without macro call api_box call api_box
Funktionsbeschreibung Function Description Zeichnet ein Rechteck in der eingestellten Vordergrundfarbe Draw a rectangle in the specified foreground color
Parameter Parameter YL=X1, YH=Y1, ZL=X2, ZH=Y2 YL = X1, Y = Y1, X2 = ZL, ZH = Y2
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 2, 3, (4), 5 0, 1, 2, 3, (4), 5



Funktionsname Function Name api_fbox api_fbox
Aufruf ohne Makro Call without macro call api_fbox call api_fbox
Funktionsbeschreibung Function Description Zeichnet ein ausgefülltes Rechteck in der eingestellten Vordergrundfarbe Draws a filled rectangle in the set foreground color
Parameter Parameter YL=X1, YH=Y1, ZL=X2, ZH=Y2 YL = X1, Y = Y1, X2 = ZL, ZH = Y2
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 2, 3, (4), 5 0, 1, 2, 3, (4), 5



Funktionsname Function Name api_circle api_circle
Aufruf ohne Makro Call without macro call api_circle call api_circle
Funktionsbeschreibung Function Description Zeichnet einen Kreis/Ellipse in der eingestellten Vordergrundfarbe Draw a circle / ellipse in the set foreground color
Parameter Parameter YL=X, YH=Y, ZL=RX, ZH=RY YL = X, Y = Y, Z L = RX, Z = RY
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 2, 3, (4), 5 0, 1, 2, 3, (4), 5



Funktionsname Function Name api_fcircle api_fcircle
Aufruf ohne Makro Call without macro call api_fcircle call api_fcircle
Funktionsbeschreibung Function Description Zeichnet einen ausgefülltesn Kreis in der eingestellten Vordergrundfarbe Draw a circle in the ausgefülltesn set foreground color
Parameter Parameter YL=X, YH=Y, ZL=RX, ZH=RY YL = X, Y = Y, Z L = RX, Z = RY
Rückgabewerte Return Values --- ---
Register Register --- ---
Videomodi Modes 0, 1, 2, 3, (4), 5 0, 1, 2, 3, (4), 5



Funktionsname Function Name api_bcopy1 api_bcopy1
Aufruf ohne Makro Call without macro call api_bcopy1 call api_bcopy1
Funktionsbeschreibung Function Description Kopiert einen Bildschirmausschnitt an eine andere Stelle Copied a screen image to a different location
Parameter Parameter YL=SRCX, YH=SRCY, ZL=DESTX, ZH=DESTY, R21=Bytes/Zeile, R22=Zeilen YL = srcX, YH = SrcY, ZL = destX, ZH = Desty, R21 = bytes / line, R22 = lines
Rückgabewerte Return Values --- ---
Register Register R4ldotsR7 R4ldotsR7
Videomodi Modes 1, 2, 3, 5 1, 2, 3, 5



Funktionsname Function Name api_bcopy2 api_bcopy2
Aufruf ohne Makro Call without macro call api_bcopy2 call api_bcopy2
Funktionsbeschreibung Function Description Kopiert einen Bildschirmausschnitt vom Bildspeicher in das RAM Copies a screen capture from the image memory in the RAM
Parameter Parameter YL=SRCX, YH=SRCY, Z=RAM-Adresse, R21=Bytes/Zeile, R22=Zeilen YL = srcX, YH = SrcY, Z = RAM address, R21 = bytes / line, R22 = lines
Rückgabewerte Return Values --- ---
Register Register R4ldotsR7 R4ldotsR7
Videomodi Modes 1, 2, 3, 5 1, 2, 3, 5



Funktionsname Function Name api_bcopy3 api_bcopy3
Aufruf ohne Makro Call without macro call api_bcopy3 call api_bcopy3
Funktionsbeschreibung Function Description Kopiert einen Bildschirmausschnitt RAM in den Bildspeicher Copied a screen clipping in the image RAM memory
Parameter Parameter YL=DESTX, YH=DESTY, Z=RAM-Adresse YL = destX, YH = Desty, Z = RAM address
Rückgabewerte Return Values --- ---
Register Register R4ldotsR7 R4ldotsR7
Videomodi Modes 1, 2, 3, 5 1, 2, 3, 5


3.9 Kommunikation 3.9 Communication

Funktionsname Function Name api_putpar api_putpar
Aufruf ohne Makro Call without macro call api_putpar call api_putpar
Funktionsbeschreibung Function Description gibt ein Zeichen über die parallele Schnittstelle aus outputs a character via the parallel interface
Parameter Parameter R20 = Zeichen R20 = sign
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_getser api_getser
Aufruf ohne Makro Call without macro call api_getser call api_getser
Funktionsbeschreibung Function Description wartet auf ein Zeichen von der seriellen Schnittstelle, keine Abbruchmöglichkeit waiting for a signal from the serial port, no cancel option
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = Zeichen R20 = sign
Register Register --- ---



Funktionsname Function Name api_getserb api_getserb
Aufruf ohne Makro Call without macro call api_getserb call api_getserb
Funktionsbeschreibung Function Description wartet auf ein Zeichen von der seriellen Schnittstelle, Abbruch mit ESC möglich waiting for a signal from the serial port, can be aborted with ESC
Parameter Parameter --- ---
Rückgabewerte Return Values R20 = Zeichen oder 0x1B (bei Abbruch mit ESC) R20 = sign or 0x1B (at abort with ESC)
Register Register --- ---



Funktionsname Function Name api_putser api_putser
Aufruf ohne Makro Call without macro call api_putser call api_putser
Funktionsbeschreibung Function Description gibt ein Zeichen über die serielle Schnittstelle aus outputs a character via the serial interface
Parameter Parameter R20 = Zeichen R20 = sign
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_putsernl api_putsernl
Aufruf ohne Makro Call without macro call api_putsernl call api_putsernl
Funktionsbeschreibung Function Description gibt einen Zeilenvorschub über die serielle Schnittstelle aus is a line feed, via the serial interface
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register Y = Y + 128 Y = Y + 128



Funktionsname Function Name api_hexline api_hexline
Aufruf ohne Makro Call without macro call api_hexline call api_hexline
Funktionsbeschreibung Function Description gibt einen Speicherbereich als Hexstring mit abschliessendem Zeilenvorschub über die serielle Schnittstelle aus outputs a space than with final Hexstring linefeed via the serial port
Parameter Parameter Y = Adresse RAM Block, ZL=Anzahl Bytes Y = RAM address block, ZL = number of bytes
Rückgabewerte Return Values --- ---
Register Register ZL, R20, Y = Y + 128 ZL, R20, Y = Y + 128



Funktionsname Function Name api_putxm api_putxm
Aufruf ohne Makro Call without macro call api_putxm call api_putxm
Funktionsbeschreibung Function Description gibt einen X-Modem Block über die serielle Schnittstelle aus outputs an X-block modem via the serial port
Parameter Parameter R22 = Blocknummer, Y = Adresse RAM Block R22 = block number, Y = RAM address block
Rückgabewerte Return Values --- ---
Register Register Y = Y + 128 Y = Y + 128



Funktionsname Function Name api_getxm api_getxm
Aufruf ohne Makro Call without macro call api_getxm call api_getxm
Funktionsbeschreibung Function Description liest einen X-Modem Block über die serielle Schnittstelle ein reads a block X modem via the serial port
Parameter Parameter Y = Adresse RAM Block Y = RAM address block
Rückgabewerte Return Values R22 = Blocknummer R22 = block number
Register Register Y = Y + 128 Y = Y + 128



Funktionsname Function Name api_preceive api_preceive
Aufruf ohne Makro Call without macro call api_preceive call api_preceive
Funktionsbeschreibung Function Description lädt ein Programm (im Binärmode) über das X-Modem Protokoll loads a program (in binary mode) via the X-modem protocol
Parameter Parameter R15 = Programmnummer-1 (0...7] R15 = program number 1 (0 .. 7]
Rückgabewerte Return Values
Register Register R20...R23,X,Y,Z R20 ... R23, X, Y, Z



Funktionsname Function Name api_psend api_psend
Aufruf ohne Makro Call without macro call api_psend call api_psend
Funktionsbeschreibung Function Description sendet ein Programm (im Binärmode) über das X-Modem Protokoll broadcasting a program (in binary mode) via the X-modem protocol
Parameter Parameter R15 = Programmnummer-1 (0...7] R15 = program number 1 (0 .. 7]
Rückgabewerte Return Values
Register Register R20...R23,X,Y,Z R20 ... R23, X, Y, Z


3.10 Audio 3:10 Audio

Funktionsname Function Name api_note api_note
Aufruf ohne Makro Call without macro call api_note call api_note
Funktionsbeschreibung Function Description Spielt eine Note mit der aktuellen Lautstärke Plays a note with the current volume
Parameter Parameter XL=Notenwert, entsprechend dem BASIC Befehl note XL = note value, according to the BASIC command note
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_setvolume api_setvolume
Aufruf ohne Makro Call without macro call api_setvolume call api_setvolume
Funktionsbeschreibung Function Description setzt die globale Lautstärke sets the global volume
Parameter Parameter XL=Lautstärkewert (0...15) XL = volume value (0 .. 15)
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_startseq api_startseq
Aufruf ohne Makro Call without macro call api_startseq call api_startseq
Funktionsbeschreibung Function Description startet den Sequenzer starts the sequencer
Parameter Parameter --- ---
Rückgabewerte Return Values Y=Startadresse (RAM), Z=Endadresse+1 (RAM), XL=Geschwindigkeit, XH=Zyklenanzahl Y = Start Address (RAM), Z = end address +1 (RAM), XL = speed, XH = number of cycles
Register Register --- ---



Funktionsname Function Name api_setseq api_setseq
Aufruf ohne Makro Call without macro call api_setseq call api_setseq
Funktionsbeschreibung Function Description setzt den Zyklenzaehler des Sequenzers sets the Zyklenzaehler the sequencer
Parameter Parameter XL = neuer Zyklus-Wert XL = new cycle value
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_getseq api_getseq
Aufruf ohne Makro Call without macro call api_getseq call api_getseq
Funktionsbeschreibung Function Description liest den Zyklenzaehler des Sequenzers reads the Zyklenzaehler the sequencer
Parameter Parameter XL = aktueller Zyklus-Wert XL = current cycle value
Rückgabewerte Return Values --- ---
Register Register --- ---


3.11 Zugriff auf das interne EEPROM 3.11 Access to the internal EEPROM

Die Funktionen für das interne EEPROM funktionieren nur mit den Speicherzellen 0...2047, befindet sich die Adresse (Y-Register) außerhalb dieses Bereiches, wird das Fehlerregister (R24) auf 34 gesetzt. The functions for the internal EEPROM can only work with the memory cells 0 .. 2047, the address (Y-register) is outside this range, the error register (R24) is set to 34. Da die Speicherzellen ab Adresse 2040 für Systemeinstellungen genutzt werden, sollten diese nach Möglichkeit nicht überschrieben werden. As the memory cells are used from address 2040 for system settings, this vehicle must not be overwritten.
Vor jedem Schreibvorgang wird die EEPROM-Zelle gelesen, falls Soll- und Istzustand bereits übereinstimmen wird der Schreibvorgang abgebrochen. Before each write the EEPROM cell is read if desired and actual state will already match the write operation is aborted.
Funktionsname Function Name api_eep_read api_eep_read
Aufruf ohne Makro Call without macro call api_eep_read call api_eep_read
Funktionsbeschreibung Function Description liest ein Byte aus dem internen EEPROM reads a byte from the internal EEPROM
Parameter Parameter Y=Adresse Y = Address
Rückgabewerte Return Values R20=Byte R20 = byte
Register Register Y=Y+1 Y = Y +1



Funktionsname Function Name api_eep_write api_eep_write
Aufruf ohne Makro Call without macro call api_eep_write call api_eep_write
Funktionsbeschreibung Function Description schreibt ein Byte in das interne EEPROM writes a byte to the internal EEPROM
Parameter Parameter Y=Adresse, R20=Byte Y = address, R20 = byte
Rückgabewerte Return Values --- ---
Register Register Y=Y+1 Y = Y +1


3.12 Funktionen für den I2C-Bus 3:12 functions for the I2C bus

Der I2C-Bus kann über die API-Funktionen nur als Master genutzt werden. The I2C bus can be used via the API functions as a master.
Funktionsname Function Name api_i2c_start api_i2c_start
Aufruf ohne Makro Call without macro call api_i2c_start call api_i2c_start
Funktionsbeschreibung Function Description erzeugt eine Start-Kondidion auf dem I2C-Bus generates a start Kondidion on the I2C-bus
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R20 R20



Funktionsname Function Name api_i2c_stop api_i2c_stop
Aufruf ohne Makro Call without macro call api_i2c_stop call api_i2c_stop
Funktionsbeschreibung Function Description erzeugt eine Stop-Kondidion auf dem I2C-Bus generates a Stop Kondidion on the I2C bus
Parameter Parameter --- ---
Rückgabewerte Return Values --- ---
Register Register R20 R20



Funktionsname Function Name api_i2c_rbyte api_i2c_rbyte
Aufruf ohne Makro Call without macro call api_i2c_rbyte call api_i2c_rbyte
Funktionsbeschreibung Function Description liest ein Byte vom I2C-Bus ein und sendet ein ACK reads a byte from the I2C bus, and sends an ACK
Parameter Parameter --- ---
Rückgabewerte Return Values R21=Byte, R22=I2C Status-Register R21 = byte, R22 = I2C status register
Register Register R20 R20



Funktionsname Function Name api_i2c_rbyten api_i2c_rbyten
Aufruf ohne Makro Call without macro call api_i2c_rbyten call api_i2c_rbyten
Funktionsbeschreibung Function Description liest ein Byte vom I2C-Bus ein ohne ein ACK zu senden to send reads a byte from the I2C bus without an ACK
Parameter Parameter --- ---
Rückgabewerte Return Values R21=Byte, R22=I2C Status-Register R21 = byte, R22 = I2C status register
Register Register R20 R20



Funktionsname Function Name api_i2c_wbyte api_i2c_wbyte
Aufruf ohne Makro Call without macro call api_i2c_wbyte call api_i2c_wbyte
Funktionsbeschreibung Function Description sendet ein Byte auf den I2C-Bus und wartet auf ACK/NAK sends a byte to the I2C bus and waits for ACK / NAK
Parameter Parameter R21=Byte R21 = byte
Rückgabewerte Return Values R22=I2C Status-Register R22 = I2C status register
Register Register R20 R20



Funktionsname Function Name api_i2c_read api_i2c_read
Aufruf ohne Makro Call without macro call api_i2c_read call api_i2c_read
Funktionsbeschreibung Function Description liest ein Datenbyte von einem externen EEPROM ein reads a byte of data from an external EEPROM
Parameter Parameter X=Speicheradresse im EEPROM, R23=EEPROM Adresse (0...7) X = memory address in EEPROM, R23 = EEPROM address (0 .. 7)
Rückgabewerte Return Values R21=Byte R24=Fehlerstatus R21 = R24 = byte error status
Register Register X=X+1, R20, R22 X = X +1, R20, R22



Funktionsname Function Name api_i2c_write api_i2c_write
Aufruf ohne Makro Call without macro call api_i2c_write call api_i2c_write
Funktionsbeschreibung Function Description schreibt ein Datenbyte in ein externes EEPROM writes a byte of data in an external EEPROM
Parameter Parameter R21=Byte X=Speicheradresse im EEPROM, R23=EEPROM Adresse (0...7) R21 = X = byte memory address in EEPROM, R23 = EEPROM address (0 .. 7)
Rückgabewerte Return Values R24=Fehlerstatus R24 = error status
Register Register X=X+1, R20, R22 X = X +1, R20, R22



Funktionsname Function Name api_i2c_rlm75 api_i2c_rlm75
Aufruf ohne Makro Call without macro call api_i2c_rlm75 call api_i2c_rlm75
Funktionsbeschreibung Function Description liest den Temperaturwert von einem angeschlossenen LM75 Temperatursensor ein reads the temperature value from a connected LM75 temperature sensor
Parameter Parameter R23=LM75 Adresse (0...7) R23 = LM75 address (0 .. 7)
Rückgabewerte Return Values R24=Fehlerstatus, X=Temperaturwert in 1/2 Grad R24 = error status, X = temperature in 1/2 degree
Register Register R20, R21, R22 R20, R21, R22


3.13 Alert- und Abfrageboxen 13.03 alert and query boxes

Funktionsname Function Name api_alert api_alert
Aufruf ohne Makro Call without macro call api_alert call api_alert
Funktionsbeschreibung Function Description gibt eine Alertbox aus, nach ENTER wird der Bildschirm restauriert issues an alert box, to ENTER the screen restored
Parameter Parameter Y zeigt auf Farbbyte (FG/HG) und nullterminierten Text im RAM Y shows color byte (FG / BG) and null-terminated text in RAM
Rückgabewerte Return Values --- ---
Register Register R20 R20



Funktionsname Function Name api_alert_nb api_alert_nb
Aufruf ohne Makro Call without macro call api_alert_nb call api_alert_nb
Funktionsbeschreibung Function Description gibt eine Alertbox aus, nach ENTER wird der Bildschirm NICHT restauriert issues an alert box, the screen will NOT ENTER after restoration
Parameter Parameter Y zeigt auf Farbbyte (FG/HG) und nullterminierten Text im RAM Y shows color byte (FG / BG) and null-terminated text in RAM
Rückgabewerte Return Values --- ---
Register Register R20 R20



Funktionsname Function Name api_alertthis api_alertthis
Aufruf ohne Makro Call without macro call api_alertthis call api_alertthis
Funktionsbeschreibung Function Description gibt eine Alertbox aus, nach ENTER wird der Bildschirm restauriert issues an alert box, to ENTER the screen restored
Parameter Parameter das Farbbyte und der Text liegen nullterminiert nach dem Aufruf the color byte and text are null-terminated after the call
Rückgabewerte Return Values --- ---
Register Register R20 R20



Funktionsname Function Name api_alertthis_nb api_alertthis_nb
Aufruf ohne Makro Call without macro call api_alertthis_nb call api_alertthis_nb
Funktionsbeschreibung Function Description gibt eine Alertbox aus, nach ENTER wird der Bildschirm NICHT restauriert issues an alert box, the screen will NOT ENTER after restoration
Parameter Parameter das Farbbyte und der Text liegen nullterminiert nach dem Aufruf the color byte and text are null-terminated after the call
Rückgabewerte Return Values --- ---
Register Register R20 R20



Funktionsname Function Name api_ask api_ask
Aufruf ohne Makro Call without macro call api_ask call api_ask
Funktionsbeschreibung Function Description gibt eine Fragebox aus, nach Y/N/ENTER/ESC wird der Bildschirm restauriert issues a query box, according to Y / N / ENTER / ESC the screen is restored
Parameter Parameter Y zeigt auf Farbbyte (FG/HG) und nullterminierten Text im RAM Y shows color byte (FG / BG) and null-terminated text in RAM
Rückgabewerte Return Values T-Flag ist gesetzt bei Y/ENTER T flag is set at Y / ENTER
Register Register R20 R20



Funktionsname Function Name api_ask_nb api_ask_nb
Aufruf ohne Makro Call without macro call api_ask_nb call api_ask_nb
Funktionsbeschreibung Function Description gibt eine Fragebox aus, nach Y/N/ENTER/ESC wird der Bildschirm NICHT restauriert issues a query box, according to Y / N / ENTER / ESC the screen is NOT restored
Parameter Parameter Y zeigt auf Farbbyte (FG/HG) und nullterminierten Text im RAM Y shows color byte (FG / BG) and null-terminated text in RAM
Rückgabewerte Return Values T-Flag ist gesetzt bei Y/ENTER T flag is set at Y / ENTER
Register Register R20 R20



Funktionsname Function Name api_askthis api_askthis
Aufruf ohne Makro Call without macro call api_askthis call api_askthis
Funktionsbeschreibung Function Description gibt eine Fragebox aus, nach Y/N/ENTER/ESC wird der Bildschirm restauriert issues a query box, according to Y / N / ENTER / ESC the screen is restored
Parameter Parameter das Farbbyte und der Text liegen nullterminiert nach dem Aufruf the color byte and text are null-terminated after the call
Rückgabewerte Return Values T-Flag ist gesetzt bei Y/ENTER T flag is set at Y / ENTER
Register Register R20 R20



Funktionsname Function Name api_askthis_nb api_askthis_nb
Aufruf ohne Makro Call without macro call api_askthis_nb call api_askthis_nb
Funktionsbeschreibung Function Description gibt eine Fragebox aus, nach Y/N/ENTER/ESC wird der Bildschirm NICHT restauriert issues a query box, according to Y / N / ENTER / ESC the screen is NOT restored
Parameter Parameter das Farbbyte und der Text liegen nullterminiert nach dem Aufruf the color byte and text are null-terminated after the call
Rückgabewerte Return Values T-Flag ist gesetzt bei Y/ENTER T flag is set at Y / ENTER
Register Register R20 R20


3.14 Zugriff auf das Dataflash-Dateisystem 14.3 Accessing the Data Flash File System

Funktionsname Function Name api_fs_size api_fs_size
Aufruf ohne Makro Call without macro call api_fs_size call api_fs_size
Funktionsbeschreibung Function Description bestimmt die Größe des angeschlossenen Dataflash-Moduls determines the size of the connected data flash module
Parameter Parameter --- ---
Rückgabewerte Return Values R20=(Anzahl der Sektoren / 256) oder 0 R20 = (number of sectors / 256) or 0
Register Register --- ---



Funktionsname Function Name api_fs_create api_fs_create
Aufruf ohne Makro Call without macro call api_fs_create call api_fs_create
Funktionsbeschreibung Function Description erzeugt eine Datei generates a file
Parameter Parameter R20=Dateinummer, R21=Anzahl Sektoren, R22=Dateityp R20 = file number, R21 = number of sectors, R22 = File Type
Rückgabewerte Return Values R24 (Fehlercode oder 0) R24 (error code or 0)
Register Register Array(512-767) Array (512-767)



Funktionsname Function Name api_fs_delete api_fs_delete
Aufruf ohne Makro Call without macro call api_fs_delete call api_fs_delete
Funktionsbeschreibung Function Description löscht eine Datei deletes a file
Parameter Parameter R20=Dateinummer R20 = file number
Rückgabewerte Return Values R24 (Fehlercode oder 0) R24 (error code or 0)
Register Register --- ---



Funktionsname Function Name api_fs_read api_fs_read
Aufruf ohne Makro Call without macro call api_fs_read call api_fs_read
Funktionsbeschreibung Function Description liest einen Dateisektor in einen Bereich des Arrays ein reads a file sector in an area of ​​the array
Parameter Parameter R20=Dateinummer, R21=Sektornummer, R22=Array-Drittel (0,1,2) R20 = file number, R21 = sector number, R22 = array-thirds (0,1,2)
Rückgabewerte Return Values R24 (Fehlercode oder 0) R24 (error code or 0)
Register Register --- ---



Funktionsname Function Name api_fs_write api_fs_write
Aufruf ohne Makro Call without macro call api_fs_write call api_fs_write
Funktionsbeschreibung Function Description schreibt einen Dateisektor aus einen Bereich des Arrays writes a file sector from a range of array
Parameter Parameter R20=Dateinummer, R21=Sektornummer, R22=Array-Drittel (0,1,2) R20 = file number, R21 = sector number, R22 = array-thirds (0,1,2)
Rückgabewerte Return Values R24 (Fehlercode oder 0) R24 (error code or 0)
Register Register --- ---



Funktionsname Function Name api_fs_cfree api_fs_cfree
Aufruf ohne Makro Call without macro call api_fs_cfree call api_fs_cfree
Funktionsbeschreibung Function Description Zählt die freien Programmplätze und Datensektoren Counts the free program slots and data sectors
Parameter Parameter --- ---
Rückgabewerte Return Values Z=freie Programmplätze, Y=freie Datensektoren Z = free memory locations, Y = free data sectors
Register Register --- ---



Funktionsname Function Name api_fs_checkf api_fs_checkf
Aufruf ohne Makro Call without macro call api_fs_checkf call api_fs_checkf
Funktionsbeschreibung Function Description ermittelt, ob das Dataflash-Modul formatiert ist determine whether the data is formatted flash module
Parameter Parameter --- ---
Rückgabewerte Return Values R20 (1=formatiert, sonst 0) R20 (1 = formatted, otherwise 0)
Register Register --- ---



Funktionsname Function Name api_fs_gettype api_fs_gettype
Aufruf ohne Makro Call without macro call api_fs_gettype call api_fs_gettype
Funktionsbeschreibung Function Description bestimmt den Dateityp einer Datei determines the file type of a file
Parameter Parameter R20=Dateinummer R20 = file number
Rückgabewerte Return Values R20=Dateityp-Code R20 = File Type Code
Register Register --- ---



Funktionsname Function Name api_fs_fsize api_fs_fsize
Aufruf ohne Makro Call without macro call api_fs_fsize call api_fs_fsize
Funktionsbeschreibung Function Description bestimmt die Größe einer Datei (in Pages) oder den freien Speicher auf dem Dataflash Modul determines the size of a file (in Pages) or the free space on the data flash module
Parameter Parameter X=Dateinummer oder -1 (freie Dateien) oder -2 (freie Pages) X = file number or -1 (free files) or -2 (Free Pages)
Rückgabewerte Return Values X=Anzahl der Pages/Dateien X = number of pages / files
Register Register Y, Z Y, Z



Funktionsname Function Name api_fs_ffind api_fs_ffind
Aufruf ohne Makro Call without macro call api_fs_ffind call api_fs_ffind
Funktionsbeschreibung Function Description sucht nach einer Datei looks for a file
Parameter Parameter X=Arrayposition (siehe FFIND Funktion) X = array position (see FFIND function)
Rückgabewerte Return Values X=Dateinummer oder -1 X = file number or -1
Register Register Y, Z Y, Z



Funktionsname Function Name api_fs_check api_fs_check
Aufruf ohne Makro Call without macro call api_fs_check call api_fs_check
Funktionsbeschreibung Function Description testet das Dataflash auf gültiges Dateisystem tests the DataFlash on valid file system
Parameter Parameter
Rückgabewerte Return Values
Register Register R20 R20


Diese Funktion dient zum Vorbereiten der Fileselectorbox und setzt die notwendigen internen Variablen. This function is used to prepare the Fileselectorbox and sets the required internal variables. Tritt ein fehler auf dann wird die Rücksprungadresse vom Stack entfernt und nach Anzeige einer entsprechenden Alertbox zu der Adresse des vorherigen Aufrufes zurückgesprungen. If an error then on the return address will be removed from the stack and jump back to display an alert box corresponding to the address of the previous call. Aus diesem Grunde ist es sinnvoll, zB Lade- und Speicherfunktionen samt der Fileselectorbox-Aufrufe in eine eigene Subroutine zu packen. For this reason it makes sense to pack as load and store functions, including the Fileselectorbox calls in a separate subroutine. Bei Fehlern wird diese dann einfach verlassen und in das übergeordnete Programm zurückgesprungen. For errors and will leave it simply jumps back to the parent program.


Funktionsname Function Name api_fs_fsel api_fs_fsel
Aufruf ohne Makro Call without macro call api_fs_fsel call api_fs_fsel
Funktionsbeschreibung Function Description ruft die Fileselectorbox auf (nur im Videomode 0) calls on the Fileselectorbox (only in video mode 0)
Parameter Parameter der Kopftext liegt nullterminiert nach dem Aufruf the header text is null terminated after the call
Rückgabewerte Return Values R23=Dateinummer, R20=Dateityp R23 = file number, file type = R20
Register Register --- ---


Wird die Dateiauswahl mittels ESC Taste abgebrochen, dann ist der in R20 zurückgegebene Dateityp 0xed. If the file selection using the ESC key aborted, then the value returned in R20 file type is 0xED.


Funktionsname Function Name api_fs_fsel_nb api_fs_fsel_nb
Aufruf ohne Makro Call without macro call api_fs_fsel_nb call api_fs_fsel_nb
Funktionsbeschreibung Function Description ruft die Fileselectorbox ohne Screen-Backup auf (nur im Videomode 0) calls the Fileselectorbox without screen on backup (only in video mode 0)
Parameter Parameter der Kopftext liegt nullterminiert nach dem Aufruf the header text is null terminated after the call
Rückgabewerte Return Values R23=Dateinummer, R20=Dateityp R23 = file number, file type = R20
Register Register --- ---


Wird die Dateiauswahl mittels ESC Taste abgebrochen, dann ist der in R20 zurückgegebene Dateityp 0xed. If the file selection using the ESC key aborted, then the value returned in R20 file type is 0xED.

3.15 Direktzugriff auf das Dataflash 3.15 Direct Access to the Data Flash

Funktionsname Function Name api_fs_rread api_fs_rread
Aufruf ohne Makro Call without macro call api_fs_rread call api_fs_rread
Funktionsbeschreibung Function Description liest einen Sektor aus dem Dataflash reads a sector from the DataFlash
Parameter Parameter X=Sektor-Nummer, Y=Adresse im RAM X = sector number, Y = address in RAM
Rückgabewerte Return Values R24 (Fehlercode oder 0) R24 (error code or 0)
Register Register Y=Y+256 Y = Y +256



Funktionsname Function Name api_fs_rwrite api_fs_rwrite
Aufruf ohne Makro Call without macro call api_fs_rwritw call api_fs_rwritw
Funktionsbeschreibung Function Description schreibt einen Sektor in das Dataflash writes one sector in the DataFlash
Parameter Parameter X=Sektor-Nummer, Y=Adresse im RAM X = sector number, Y = address in RAM
Rückgabewerte Return Values R24 (Fehlercode oder 0) R24 (error code or 0)
Register Register Y=Y+256 Y = Y +256


3.16 BASIC/SYSTEM-Funktionen 3.16 BASIC / SYSTEM Functions

Funktionsname Function Name api_lfind api_lfind
Aufruf ohne Makro Call without macro call api_lfind call api_lfind
Funktionsbeschreibung Function Description sucht im System nach einer Bibliothek investigated in the system for a library
Parameter Parameter X = Bibliothek code X = library code
Rückgabewerte Return Values R21 = Programmplatz (1...8) oder 0 für nicht gefunden R21 = program number (1 .. 8) or 0 not found
Register Register Z, R22-R23 Z, R22-R23



Funktionsname Function Name api_lcall api_lcall
Aufruf ohne Makro Call without macro call api_lcall call api_lcall
Funktionsbeschreibung Function Description Ruft eine Funktion in einer Libarary auf Calls a function in a Libarary
Parameter Parameter R20 = Bibliothek(1...8), R21 = Funktionsnummer R20 = Library (1 .. 8), R21 = function number
Rückgabewerte Return Values evtl. von aufgerufener Funktion possibly by in this function
Register Register Z, R0, R1 und Register des Funktionsaufrufes Z, R0, R1 and register the function call



Funktionsname Function Name api_token api_token
Aufruf ohne Makro Call without macro call api_token call api_token
Funktionsbeschreibung Function Description tokenisiert eine Zeile aus dem Source-Puffer in den Code-Puffer tokenized a row from the source buffer in the code buffer
Parameter Parameter Quelltext im Source-Puffer Source code in the source buffer
Rückgabewerte Return Values tokenisierte Zeile im Code-Puffer tokenized line of code buffer
Register Register X, Y, Z, R20-R23 X, Y, Z, R20-R23



Funktionsname Function Name api_untoken api_untoken
Aufruf ohne Makro Call without macro call api_untoken call api_untoken
Funktionsbeschreibung Function Description übersetzt eine tokenisierte Zeile zurück in den Sourcecode translates a tokenized line back into the source code
Parameter Parameter tokenisierte Zeile im Code-Puffer tokenized line of code buffer
Rückgabewerte Return Values Quelltext im Source-Puffer Source code in the source buffer
Register Register X, Y, Z, R20...R23 X, Y, Z, R20 ... R23



Funktionsname Function Name api_basrun api_basrun
Aufruf ohne Makro Call without macro call api_basrun call api_basrun
Funktionsbeschreibung Function Description führt die im Code-Puffer befindliche Zeile aus executes the code in its buffer line
Parameter Parameter R12=Zeilennummer, R13=erstes Statement, Zeile im Code-Puffer R12 = line number, R13 = first statement, line of code buffer
Rückgabewerte Return Values --- ---
Register Register X, Y, Z, R4...R7, R20...R23 X, Y, Z, R4 ... R7, R20 ... R23



Funktionsname Function Name api_exparser api_exparser
Aufruf ohne Makro Call without macro call api_exparser call api_exparser
Funktionsbeschreibung Function Description interpretiert eine Formel im Textformat interprets a formula in text format
Parameter Parameter Z = Zeiger auf Funktionstext Z = function pointer to text
Rückgabewerte Return Values X = Resultat (16 Bit signed) X = result (16 bit signed)
Register Register Y, Z, R4...R7, R20...R23 Y, Z, R4 ... R7, R20 ... R23



Funktionsname Function Name api_tparser api_tparser
Aufruf ohne Makro Call without macro call api_tparser call api_tparser
Funktionsbeschreibung Function Description stellt einen Tokenparser zur Verfügung provides a Tokenparser available
Parameter Parameter Z = Zeiger auf Tokentabelle im Flash, Y = Zeiger auf Text im RAM, R22 = Länge eines Eintrages in Bytes Z = pointer to token table in flash, Y = Pointer to text in RAM, R22 length of an entry in bytes
Rückgabewerte Return Values R20=gefundener Token oder 0 R20 = token found or 0
Register Register Y steht hinter dem gefundenen Text Y stands behind the found text


In der Tokentabelle stehen immer zuerst der Tokenwert und danach der Tokentext, wobei mit Punkten aufgefüllt wird. Always in the token table are the token value and then the token text is filled with with points. Als letztes sollte ein Eintrag nur aus Punkten stehen, dieser fängt dann ungültige Worte ab. Lastly, a record can only consist of points, then this starts from invalid words. Die Funktion kann auch mehrmals nacheinander aufgerufen werden, als Trennzeichen können der Leerraum und das Komma verwendet werden. The function can also be called multiple times in succession, as the separator can of white space and the comma.
Im folgenden Beispiel wäre die Länge eine Eintrages 6 Bytes (1 Byte Tokenwert und 5 Bytes Text): In the following example, the length would be an entry 6 bytes (1 byte token value and 5 bytes of text):
tokentab: tokentab:
 .db 0x01,"LOAD." . Db 0x01, "LOAD."
 .db 0x02,"ADD.." . Db 0x02, "ADD .."
 .db 0x03,"SUB.." . Db 0x03, "SUB .."
 .db 0x00,"....." . Db 0x00, "....."

Funktionsname Function Name api_arrview api_arrview
Aufruf ohne Makro Call without macro call api_arrview call api_arrview
Funktionsbeschreibung Function Description Array-Ansicht Array view
Parameter Parameter R23 = Anzeigeposition (*64) R23 = Ad Position (* 64)
Rückgabewerte Return Values --- ---
Register Register --- ---


Diese Funktion ist nur in Videomodus 0 sinnvoll. This function is only useful in video mode 0.

3.17 Nutzung des Videomode 0 3.17 Use of Video Mode 0

Die folgenden Funktionen dienen dazu, Programm-Routinen des Videomode 0 in eigenen Treibern zu verwenden. The following functions are used to program routines of the video mode 0 to use in their own drivers.


Funktionsname Function Name api_vm0cls api_vm0cls
Aufruf ohne Makro Call without macro jmp api_vm0cls jmp api_vm0cls
Funktionsbeschreibung Function Description springt zur CLS-Routine von Videomode 0 jumps to CLS routine of video mode 0
Parameter Parameter nur in Treibern nutzbar usable only in drivers
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_vm0char api_vm0char
Aufruf ohne Makro Call without macro jmp api_vm0char jmp api_vm0char
Funktionsbeschreibung Function Description springt zur Zeichenausgabe-Routine von Videomode 0 jumps of character output routine of video mode 0
Parameter Parameter nur in Treibern nutzbar usable only in drivers
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_vm0gotoxy api_vm0gotoxy
Aufruf ohne Makro Call without macro jmp api_vm0gotoxy jmp api_vm0gotoxy
Funktionsbeschreibung Function Description springt zur Positionierungs-Routine von Videomode 0 jump to the positioning of routine video mode 0
Parameter Parameter nur in Treibern nutzbar usable only in drivers
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_vm0plot api_vm0plot
Aufruf ohne Makro Call without macro jmp api_vm0plot jmp api_vm0plot
Funktionsbeschreibung Function Description springt zur Pixelsetz-Routine von Videomode 0 jumps to pixel setting routine of video mode 0
Parameter Parameter nur in Treibern nutzbar usable only in drivers
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_vm0line api_vm0line
Aufruf ohne Makro Call without macro jmp api_vm0line jmp api_vm0line
Funktionsbeschreibung Function Description gibt eine Pixelzeile im Videomode 0 aus prints a line of pixels in video mode 0
Parameter Parameter nur in Treibern nutzbar usable only in drivers
Rückgabewerte Return Values --- ---
Register Register --- ---



Funktionsname Function Name api_vm0newline api_vm0newline
Aufruf ohne Makro Call without macro jmp api_vm0newline jmp api_vm0newline
Funktionsbeschreibung Function Description gibt einen Zeilenvorschub im Videomode 0 aus. is a line feed from the video mode 0th
Parameter Parameter nur in Treibern nutzbar usable only in drivers
Rückgabewerte Return Values --- ---
Register Register --- ---


3.18 Array-Funktionen 3.18 Array Functions

Diese Funktionen können sowohl das interne Array als auch externen Speicher nutzen. These functions can use both the internal as well as external storage array. Lässt sich die entsprechende Arrayzelle nicht ansprechen, wird der Fehler 18 (OUT OF ARRAY) im Fehlerregister zurückgegeben. Can not address the corresponding cell array, the error 18 (OUT OF ARRAY) is returned in the error register.
Funktionsname Function Name api_aread api_aread
Aufruf ohne Makro Call without macro call api_aread call api_aread
Funktionsbeschreibung Function Description liest ein ByteWord vom Array reads an array of ByteWord
Parameter Parameter Y = Arraypointer Y = array pointer
Rückgabewerte Return Values XL/X = Inhalt der Arrayzelle XL / X = contents of cell array
Register Register R21 R21



Funktionsname Function Name api_awrite api_awrite
Aufruf ohne Makro Call without macro call api_awrite call api_awrite
Funktionsbeschreibung Function Description schreibt ein Byte/Word ins Array writes a byte / word into the array
Parameter Parameter Y = Arraypointer, XL/X = zu schreibender Wert Y = array pointer, XL / X = value to be written
Rückgabewerte Return Values --- ---
Register Register R21 R21



Funktionsname Function Name api_pageset api_pageset
Aufruf ohne Makro Call without macro call api_pageset call api_pageset
Funktionsbeschreibung Function Description setzt die Array-page für externen Speicher sets the page for external storage array
Parameter Parameter XL = neue Array-Page (nach Systemstart 0) XL = new Array Page (after startup 0)
Rückgabewerte Return Values --- ---
Register Register --- ---


created with latex2web.pl v0.62 © 2006-2011 Joerg Wolfram Created with latex2web.pl v0.62 © 2006-2011 Joerg tungsten