This small example explains how to invoke Commodore 128 system functionalities. Please note that this is only an example, and that you need to have a good understanding of how the KERNAL and BASIC works in order to use this functionality. In order for this example to work, it needs access to the import file invoked in the first line (IMPORT DECLARES). The file is located in the "/imports" folder, and is downloaded automatically by the IDE from version 1.14.1 onwards.
source
compile
sandbox
issues?
back to examples
IMPORT DECLARES CLS PRINT "---------------------------------------" PRINT "--- ugBASIC : SYS EXAMPLE C128" PRINT "---------------------------------------" PRINT "This example will work only " PRINT " under Commodore 128" PROCEDURE example ON C128 PRINT "Press any key..." DO scnkey[] c = getin[] IF c <> 0 THEN PRINT "(key pressed!)" ENDIF LOOP END PROC example[] ON C128
The instructions here refer to compiling the example from the command line. For Microsoft Windows
users we suggest using UGBASIC-IDE, which allows
you to download and compile each single example with just one click.
Are instructions for your specific home computer / console missing? First of all, check if your computer
is supported by clicking here. If so, since ugBASIC is a language which does not provide abstractions, it is possible
that this example will not work on your target. If you think this is an issue, please click here.
In order to compile the example, type this command on the command line:
Linux
ugbc.c128 -O prg -o sys_example_c128.prg sys_example_c128.bas
Windows
ugbc.c128.exe -O prg -o sys_example_c128.prg sys_example_c128.bas
For Microsoft Windows users we suggest using UGBASIC-IDE, which allows
you to download and compile this example with just one click.
If you have found a problem trying to run this example, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO EXAMPLES