You can use the SANDBOX to try the ugBASIC compiler, without download
anything. This tool has been designed to quickly test whether the code
you are writing compiles correctly and determines the desired results.
Since the source is compiled thanks to dedicated servers, separate from the
browser you are using, some commands are not available: for example, you
cannot load external files or resources by using the LOAD
command.
If you need to develop a program with a complete tool, we recommend installing the
command line executables (see below) or UGBASIC-IDE.
To write the source code you can use a simply text editor. You can save
the program in a text file and then to call the compiler, in order to convert it into an
form that your Dragon 64 will
be able to execute.
Otherwise you can download and use command line compilers. Here are the direct links to the
compilers for the various operating systems. Select the most suitable one for your configuration:
In addition to compiling with the IDE, if you are using Linux or the command line version for
Microsoft Windows, you can compile the BASIC source "source.bas" into an executable file using the following command:
ugbc.d64 -o executable.bin -O bin source.bas
It is therefore possible to run everything with an emulator,
such as
XRoar
,
or to create a phisical storage, as well.
A good starting point to learn ugBASIC
for the d64
platform is the examples page.
The examples provide insight into the syntax and usage of many of the commands
and statements available for the
language.
Since ugBASIC is an isomorphic language, which does not provide abstractions, it
is possible that not all examples work on all targets: those labeled d64 can
be compiled to generate executable files.
If you need help and support, the best place is the official forum, where you can
find answers to your questions and receive help.
SCREEN #
command, and used with graphics primitives. This is the value of the various constants in the various versions:MODE | DESCRIPTION | WIDTHxHEIGHTxCOLORS |
---|---|---|
0 | Alphanumeric Internal | 32x16x2 |
1 | Alphanumeric External | 32x16x2 |
2 | Semigraphics 4 | 64x32x8 |
3 | Semigraphics 6 | 64x48x4 |
7 | Color Graphics 1 | 64x64x4 |
8 | Resolution Graphics 1 | 128x64x2 |
9 | Color Graphics 2 | 128x64x4 |
10 | Resolution Graphics 2 | 128x96x2 |
11 | Color Graphics 3 | 128x96x4 |
12 | Resolution Graphics 3 | 128x192x2 |
13 | Color Graphics 6 | 128x192x4 |
14 | Resolution Graphics 6 | 256x192x2 |
With the d64
target you can include assembly code
for the Motorola 6809 processor. The code will be placed within the code bank.
The ugBASIC compiler supports NTSC
(working frequency: 60 Hz)
version, and automatically detects the working frequency to calibrate the
delays. In particular, it defines two constants with the same name, and
initializes the constant TICKS PER SECOND
.
This is the value of the various constants in the various versions:
VERSION | NTSC | PAL | TICKS PER SECOND |
---|---|---|---|
Dragon 64 (NTSC) | -1 (TRUE ) | 0 (FALSE ) | 60 |