~rabbits/tiny-basic

Tiny BASIC, written in Tal
Added badge
Migrated to = rune
Minor opt

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~rabbits/tiny-basic
read/write
git@git.sr.ht:~rabbits/tiny-basic

You can also use your local clone with git send-email.

#TinyBASIC

TinyBASIC is a graphical BASIC interpreter, written in Uxntal.

#Build

You must have an Uxn assembler and emulator.

uxnasm src/basic.tal bin/basic.rom
uxnemu bin/basic.rom

If do not wish to assemble it yourself, you can download basic.rom.

builds.sr.ht status

#Commands

#Core

RUN Used to begin program execution at the lowest line number.

RUN

REM Permits to add remarks to a program source.

REM This is a comment.

LIST Causes part or all of the user program to be listed. If no parameters are given, the whole program is listed. A single expression parameter in evaluated to a line number which, if it exists, is listed.

LIST 200

CLEAR Formats the user program space, deleting any previous programs. If included in a program the program becomes suicidal when the statement is executed.

CLEAR

INPUT Halts evaluation, and assigns the result of expressions to each of the variables listed in the argument. Expressions are entered sequencially and separated by a line break, a list of two arguments, will expect two input lines.

INPUT X Y

LET Assigns the value of an expression to a variable.

LET A=123/2

IF If the result of the expression is not zero, the statement is executed; if False, the associated statement is skipped.

IF A>B-2 PRINT "A is greater."

PRINT Prints the values of the expressions and/or the contents of the strings in the console.

PRINT "The result is: " A+B

GOTO Changes the sequence of program execution.

GOTO 50+A>B

GOSUB Changes the sequence of program execution, and remembers the line number of the GOSUB statement, so that the next occurrence of a RETURN statement will result in execution proceeding from the statement following the GOSUB.

GOSUB 220

RETURN Transfers execution control to the line following the most recent unRETURNed GOSUB. If there is no matching GOSUB an error stop occurs.

RETURN

END Must be the last executable statement in a program. Failure to include an END statement will result in an error stop after the last line of the program is executed.

END

#Memory

COLOR Sets the interface RGB colors, see theme.

COLOR $50f2, $b0f9, $a0f8

CLS Clears the screen.

CLS

DRAW Sets position of drawing.

DRAW 100, 320

MODE Sets drawing mode, see varvara.

MODE 04

SPRITE Draws a sprite, uses MODE.

SPRITE $1c1c, $087f, $0814, $2241

PICT Draws a picture from a file, uses MODE.

PICT image10x10.icn

#Display

SAVE Exports your program to example.bas.

SAVE example.bas

LOAD Imports the example.bas program, replaces your current program.

LOAD example.bas

MAKE Exports your program as a Varvara rom.

MAKE game.rom

POKE Writes the value of expression B at address A in memory.

POKE A, B

#Support