mk90.basic

MBC-16 BASIC reference

The complete implemented integer dialect, without assuming factory-BASIC compatibility.

Compile and execute

mbc name.bas
exec name.mbx

Both the compiler and runtime execute on the MK90. The compiler produces MBX1 bytecode with resolved expressions and branches. The runtime is native PDP-11 code; it does not need the original source while running.

Language chapters

Statement summary

StatementSynopsisDescription
BEEPBEEPPlay the standard short buzzer tone.
CLOSECLOSEClose the currently open data file.
CLSCLSClear the complete LCD framebuffer and text console.
ENDENDTerminate the program and return to the shell.
FORFOR variable = start TO limit [STEP increment]Start a counted integer loop.
GETGET variableRead one byte from the open INPUT file.
GOSUBGOSUB line-numberCall a numbered subroutine.
GOTOGOTO line-numberContinue execution at a numbered source line.
IFIF expression THEN line-numberJump to a source line when a numeric condition is nonzero.
INPUTINPUT variableRead one signed decimal integer from the keyboard.
LET[LET] variable = expressionAssign an integer to one variable.
LINELINE x1, y1, x2, y2Draw a monochrome segment between two pixel coordinates.
LOCATELOCATE column, rowSet the text cursor position.
NEXTNEXT variableAdvance and test the innermost active FOR loop.
OPENOPEN "path",INPUTOpen the program’s one regular data file.
PRESETPRESET x, yTurn off one LCD pixel.
PRINTPRINT [item { separator item }] [separator]Print literal text and integer expressions.
PSETPSET x, yTurn on one LCD pixel.
PUTPUT expressionWrite one byte to the open OUTPUT file.
REMREM commentIgnore the rest of a physical source line.
RETURNRETURNResume after the most recent active GOSUB.
SOUNDSOUND divisor, cyclesDrive the buzzer with raw controller parameters.
STOPSTOPTerminate the program and return to the shell.
WAITWAIT ticksSleep cooperatively for an RTC-tick interval.

Expression-function summary

Function / valueSyntaxDescription
ABSABS(expression)Absolute value in signed 16-bit arithmetic.
EOFEOFTest the open INPUT data file for end-of-file.
HOURHOURRead the RTC hour component.
INKEYINKEYPoll one translated keyboard event.
MINUTEMINUTERead the RTC minute component.
RNDRND(limit)Return a bounded pseudorandom integer.
SECONDSECONDRead the RTC second component.
TICKSTICKSRead the OS RTC tick counter.

Dialect boundary

MBC-16 uses only signed 16-bit numeric variables and literal strings. It is not a complete or standard-certified BASIC implementation. Unsupported syntax is rejected rather than ignored. The factory FK table can insert words which this dialect does not implement.