mk90.basic
MBC-16 BASIC reference
The complete implemented integer dialect, without assuming factory-BASIC compatibility.
Compile and execute
mbc name.bas
exec name.mbxBoth 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
| Statement | Synopsis | Description |
|---|---|---|
| BEEP | BEEP | Play the standard short buzzer tone. |
| CLOSE | CLOSE | Close the currently open data file. |
| CLS | CLS | Clear the complete LCD framebuffer and text console. |
| END | END | Terminate the program and return to the shell. |
| FOR | FOR variable = start TO limit [STEP increment] | Start a counted integer loop. |
| GET | GET variable | Read one byte from the open INPUT file. |
| GOSUB | GOSUB line-number | Call a numbered subroutine. |
| GOTO | GOTO line-number | Continue execution at a numbered source line. |
| IF | IF expression THEN line-number | Jump to a source line when a numeric condition is nonzero. |
| INPUT | INPUT variable | Read one signed decimal integer from the keyboard. |
| LET | [LET] variable = expression | Assign an integer to one variable. |
| LINE | LINE x1, y1, x2, y2 | Draw a monochrome segment between two pixel coordinates. |
| LOCATE | LOCATE column, row | Set the text cursor position. |
| NEXT | NEXT variable | Advance and test the innermost active FOR loop. |
| OPEN | OPEN "path",INPUT | Open the program’s one regular data file. |
| PRESET | PRESET x, y | Turn off one LCD pixel. |
PRINT [item { separator item }] [separator] | Print literal text and integer expressions. | |
| PSET | PSET x, y | Turn on one LCD pixel. |
| PUT | PUT expression | Write one byte to the open OUTPUT file. |
| REM | REM comment | Ignore the rest of a physical source line. |
| RETURN | RETURN | Resume after the most recent active GOSUB. |
| SOUND | SOUND divisor, cycles | Drive the buzzer with raw controller parameters. |
| STOP | STOP | Terminate the program and return to the shell. |
| WAIT | WAIT ticks | Sleep cooperatively for an RTC-tick interval. |
Expression-function summary
| Function / value | Syntax | Description |
|---|---|---|
| ABS | ABS(expression) | Absolute value in signed 16-bit arithmetic. |
| EOF | EOF | Test the open INPUT data file for end-of-file. |
| HOUR | HOUR | Read the RTC hour component. |
| INKEY | INKEY | Poll one translated keyboard event. |
| MINUTE | MINUTE | Read the RTC minute component. |
| RND | RND(limit) | Return a bounded pseudorandom integer. |
| SECOND | SECOND | Read the RTC second component. |
| TICKS | TICKS | Read 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.