inline_basic_assembler
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
inline_basic_assembler [2025/06/19 14:53] – [Reserving Memory] reggie | inline_basic_assembler [2025/06/20 10:17] (current) – [Dragon Basic Inline Assembler] reggie | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Dragon Basic Inline Assembler ====== | ====== Dragon Basic Inline Assembler ====== | ||
- | This utility (GTAsm) is intended for small 6809 machine language | + | This utility (GTAsm) is intended for developing |
- | [[https:// | + | [[https:// |
==== Reserving Memory ==== | ==== Reserving Memory ==== | ||
Line 20: | Line 20: | ||
540 'END | 540 'END | ||
| | ||
- | The PCLEAR statement clears an extra 3 graphics pages, or 4.5K of RAM. This should be enough for short routines, and leaves the first 4 pages untouched so hi-res modes (PCLEAR3,1 etc.) work as normal. The CLEAR statement sets the last byte of Basic RAM, so our machine code program can start at &H7000. | + | The PCLEAR statement clears an extra 3 graphics pages, or 4.5K of RAM. This should be enough for short routines, and leaves the first 4 pages untouched so hi-res modes (PMODE3,1 etc.) work as normal. The CLEAR statement sets the last byte of Basic RAM, so our machine code program can start at &H7000. |
Run the Basic program. Now load GTAsm and execute it with: | Run the Basic program. Now load GTAsm and execute it with: | ||
Line 38: | Line 38: | ||
Or, since we used the DEFUSR1 directive: | Or, since we used the DEFUSR1 directive: | ||
- | A=USR1(0) | + | A=USR01(0) |
| | ||
EXEC remembers its last address, so as long as we don't use it (or DEFUSR0) for something else we can type plain EXEC to re-run the assembler. | EXEC remembers its last address, so as long as we don't use it (or DEFUSR0) for something else we can type plain EXEC to re-run the assembler. | ||
Line 51: | Line 51: | ||
TFR (use TRF instead - this is a simple error) | TFR (use TRF instead - this is a simple error) | ||
+ | | ||
+ | === Addressing === | ||
+ | |||
+ | Use standard brackets rather than square to specify indirect addressing. Use the "<" | ||
+ | |||
+ | JSR (, | ||
+ | LDA (CURSPOS) | ||
+ | LDB > | ||
+ | CLR < | ||
| | ||
=== Directives === | === Directives === | ||
Line 80: | Line 89: | ||
A comment can be added after any valid statement without preceding it with any special character. | A comment can be added after any valid statement without preceding it with any special character. | ||
- | When assembly fails there are a number of useful error messages. Beware that some errors can be missed; sometimes you can write garbage | + | When assembly fails there are a number of useful error messages. Beware that some errors can be missed; sometimes you can write garbage |
Keep lines to a reasonable length to avoid a bug in Basic. Entering a line of the maximum length then trying to edit it can cause a system crash. This appears to be due to the single-quote being stored as a two-byte token. | Keep lines to a reasonable length to avoid a bug in Basic. Entering a line of the maximum length then trying to edit it can cause a system crash. This appears to be due to the single-quote being stored as a two-byte token. | ||
Line 132: | Line 141: | ||
RUN | RUN | ||
| | ||
- | The program will quit with an ?FC error because the USR routine hasn't been defined yet. Rewind the tape and load the assembler into graphics page 5 (we'll be using the others) and execute it with: | + | The program will quit with an ?FC error because the USR routine hasn't been defined yet; we ran it simply for the memory reserving statements. Rewind the tape and load the assembler into graphics page 5 (we'll be drawing on the others) and execute it with: |
CLOADM" | CLOADM" | ||
EXEC | EXEC | ||
| | ||
- | Note that there are two versions of the assembler on the tape, identical except for the load address (which is included in the file name). Also note that there is no machine code listing | + | Note that there are two versions of the assembler on the tape, identical except for the load address (which is included in the file name). Also note that there is no machine code listing |
After a delay of a few seconds the OK prompt should reappear. Now again type RUN. You should see some simple smooth-moving space game graphics. All you can do is use the up and down arrows; your spaceship stays still while the background (just that pair of mines at the sides) moves. Soft reset to quit. Now experiment with debugging the program to remove the trails that the mines leave behind. | After a delay of a few seconds the OK prompt should reappear. Now again type RUN. You should see some simple smooth-moving space game graphics. All you can do is use the up and down arrows; your spaceship stays still while the background (just that pair of mines at the sides) moves. Soft reset to quit. Now experiment with debugging the program to remove the trails that the mines leave behind. | ||
Line 143: | Line 152: | ||
| | ||
- | ==== About ==== | + | ==== Credits |
GTAsm was hand written in machine code by Gwilym Thomas and is copyright © 1985. It probably hasn't been debugged since then so don't expect it to be free of errors. But do feel free to have fun with it developing 6809 assembly language programs for your Dragon 32. | GTAsm was hand written in machine code by Gwilym Thomas and is copyright © 1985. It probably hasn't been debugged since then so don't expect it to be free of errors. But do feel free to have fun with it developing 6809 assembly language programs for your Dragon 32. | ||
inline_basic_assembler.1750344798.txt.gz · Last modified: 2025/06/19 14:53 by reggie