Overview

MK90/Unix 0.7

User and system reference for the Elektronika MK90.

Overview

MK90/Unix is a compact operating system for a 16 KiB MK90, booted from a 32 KiB 27C256 cartridge. It provides a Unix-style command shell, MKS2 files and directories, a text editor, cooperative multiprogramming, a two-process pipe and the on-device MBC-16 BASIC compiler.

This is the reference for the distributed 0.7 binary. Command names and BASIC keywords are shown exactly as entered. Firmware messages, command guides and this reference are in English.

Reference packages

PackageContents
Getting startedInstall the ROM, mount a data cartridge, compile the included demonstration.
mk90.commandsAll 33 registered commands, parameters, examples, effects and diagnostics.
mk90.systemProcess slots, cooperative scheduling, stack ownership, IPC and memory.
mk90.basicMBC-16 syntax, statements, functions, compiler and runtime.
mk90.apiNative task, file, block-device and pipe calling contracts.
Alphabetical indexCommand, language and system entries, with offline search.

Quick start

With a writable, already formatted MKS2 data cartridge in SMP1:

mount /dev/smp1 /mnt/smp1
cp /mnt/smp0/demo.bas /mnt/smp1/demo.bas
cd /mnt/smp1
mbc demo.bas
./demo.mbx

For installation and first-time formatting, see Getting started.

Release scope

AreaImplemented in 0.7
Shell33 names; space-separated arguments; a single two-stage pipeline.
MultiprogrammingFour fixed context slots: shell, foreground child and two background slots; cooperative scheduling.
StorageSMP driver, fixed mountpoints and MKS2; one partition per supported-size volume.
BASICMBC-16 signed 16-bit integer subset, compiled to MBX1 bytecode.
ExpansionUART, floppy and CF drivers are not present.

The Unix-style interface does not imply Linux, POSIX, ELF or a general PDP-11 operating-system ABI. See Limits and compatibility.

Release and distribution

Official binaries are freeware; operating-system source code remains private. Copyright and distribution policy. The HTML manual works offline after extraction: open index.html. It uses local assets and does not need a server.

See the included validation report for this release’s CPU-model regression results. That model executes the generated PDP-11 instructions with 16 KiB RAM; it is not cycle-accurate and does not replace a test on the physical MK90.

mk90.commands

Command beep

Emit a short tone through the internal buzzer.

Synopsis

beep

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

This command has no documented parameters.

Description

Uses the kernel’s bounded shared-controller transaction and then releases the controller. It accepts no pitch or duration argument.

Examples

beep

Limits and side effects

  • For programmable raw sound parameters in a BASIC application, use SOUND. For periodic background beeps, use RUN PULSE.

Status and diagnostics

Success is status 0. No command-specific status is added; shared ROM/controller failures remain possible. See the diagnostic reference.

See also

run · uart · Shell syntax

mk90.commands

Command cat

Write file bytes to standard output.

Synopsis

cat file

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer. Also supported as a bare pipe consumer in PID 1 or 2.

Parameters

ParameterMeaning
fileRegular MKS2 file, /dev/null, or /dev/console in the standalone form.

Description

Streams regular files in 256-byte blocks and yields between blocks. Output goes to the LCD console, or to the pipe when CAT is the producer. CAT does not implement a pager; use LESS for reading long text.

cat /dev/null produces immediate end-of-file. Standalone cat /dev/console echoes keyboard input until SU, then D; BK is converted to a newline.

On the right of a pipe, bare cat is a separate consumer process reading the FIFO; it takes no file argument. File checksums are validated on reaching EOF, so earlier data may already have been displayed before an error is discovered.

Examples

cat /mnt/smp1/demo.bas
cat /mnt/smp1/demo.bas | less
cat /dev/null
cat /dev/console

Limits and side effects

  • One file per invocation; no concatenation of multiple filenames. A console source is not allowed in a pipe. Control bytes are interpreted by the console, not displayed as a hex dump.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 3, 4, 6, 8, 9, 14, 15, 18, 21. See the diagnostic reference.

See also

less · cp · pipe · Shell syntax

mk90.commands

Command cd

Change the shell’s current directory.

Synopsis

cd [directory]

Shell builtin, PID 0. Not an allowed pipe producer.

Parameters

ParameterMeaning
directoryOptional directory; omitting it selects the virtual root /, not a home directory.

Description

Resolves relative paths, absolute paths, ., .. and repeated slashes. Going above root stays at root.

CD is the one command marked as a shell builtin: it runs in PID 0 because its effect must remain in the parent shell. The prompt subsequently displays the normalized absolute directory.

Examples

cd /mnt/smp1
cd ..
cd /

Limits and side effects

  • No home directories, ~, cd - or environment variables. CD is not a pipe producer.

Status and diagnostics

Success is status 0. Relevant status codes: 3, 4, 6, 8, 10, 14. See the diagnostic reference.

See also

pwd · ls · mount · Shell syntax

mk90.commands

Command clear

Clear the text console and reset its cursor.

Synopsis

clear

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

This command has no documented parameters.

Description

Resets the 30×10 text buffer and places the cursor at its origin. Text changes reach the LCD through the normal incremental renderer.

Examples

clear

Limits and side effects

  • This is the shell’s text clear operation. BASIC CLS additionally clears every framebuffer pixel, including graphics outside text glyphs.

Status and diagnostics

Success is status 0. No command-specific status is added; shared ROM/controller failures remain possible. See the diagnostic reference.

See also

edit · exec · Shell syntax

mk90.commands

Command cp

Copy one regular file, including between volumes.

Synopsis

cp source destination

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
sourceRegular MKS2 file, or /dev/null for an empty source.
destinationFile path, existing destination directory, /dev/null, or /dev/console.

Description

An existing directory receives the source basename. A file destination is replaced on successful completion; there is no overwrite confirmation. Copying uses a reader and the single writer handle, with 256-byte transfers and yields between sectors.

The source checksum must pass before the destination is published. A read failure, write failure or failed commit aborts the pending destination and preserves any previous target.

/dev/null as destination discards bytes while still reading and checking the source. A console destination prints them. An empty null source can create or truncate a regular file to zero bytes.

Examples

cp /mnt/smp0/demo.bas /mnt/smp1/demo.bas
cp demo.bas work
cp demo.bas /dev/null
cp /dev/null empty.txt

Limits and side effects

  • No recursive directory copy, wildcards, append or interactive console-to-file capture. Files need contiguous free space, including space for an uncommitted replacement. CP is not a pipe producer.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 18. See the diagnostic reference.

See also

mv · cat · rm · Shell syntax

mk90.commands

Command date

Read the RTC date as YY-MM-DD.

Synopsis

date

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

This command has no documented parameters.

Description

Reads the year, month and day coherently and converts BCD/binary values for display. The two-digit year is the stored RTC value; no century interpretation is added.

Examples

date

Limits and side effects

  • Read-only; no calendar editing or date arithmetic.

Status and diagnostics

Success is status 0. Relevant status codes: 1. See the diagnostic reference.

See also

time · Shell syntax

mk90.commands

Command devices

List configured block-device slots and access flags.

Synopsis

devices

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

This command has no documented parameters.

Description

Lists /dev/smp0, /dev/smp1, /dev/fd0 and /dev/cf0 with RO, RW or OFF. The boot slot is RO; the other SMP slot has a writable driver; floppy and CF are OFF.

This is a driver-table report. RW means a writable driver is configured, not that a physical module has been detected, mounted or tested.

Examples

devices

Limits and side effects

  • Does not probe XP1, enumerate UART hardware or measure cartridge capacity.

Status and diagnostics

Success is status 0. No command-specific status is added; shared ROM/controller failures remain possible. See the diagnostic reference.

See also

mount · uart · romtest · Shell syntax

mk90.commands

Command echo

Write up to three argument tokens to standard output.

Synopsis

echo [word [word [word]]]

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

ParameterMeaning
wordOptional space-separated token; at most three arguments are retained by the shell.

Description

Writes each retained token followed by one space, then a newline. Consecutive spaces in input do not preserve their original spacing. With no words, prints a newline.

Quotes have no shell quoting semantics. For example, quote characters remain literal characters in the retained tokens.

Examples

echo Hello MK90
echo Hello MK90 | cat

Limits and side effects

  • The four-token shell limit includes the command name; later tokens are ignored. No escapes, variable expansion, -n, output redirection or file creation.

Status and diagnostics

Success is status 0. No command-specific status is added; shared ROM/controller failures remain possible. See the diagnostic reference.

See also

cat · pipe · Shell syntax

mk90.commands

Command edit

Open the text editor, with BASIC macros for .bas files.

Synopsis

edit [file]

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
fileOptional existing or new regular file path; the parent must exist.

Description

Loads a named file, or starts it empty if absent. The editor retains its absolute pathname for saving. With no path, opens an unnamed RAM buffer; saving then reports status 16 rather than asking for a filename.

The buffer holds at most 1,280 bytes. The status row shows the filename, * when changed, [A]/[a], and BAS/FK as applicable. Save is SU, then S; exit is SU, then Q. Unsaved changes require a YES confirmation before discarding.

A case-insensitive .bas suffix enables factory-style FK word insertion. The inserted word remains editable text; it is not executed.

Examples

edit /mnt/smp1/demo.bas
edit /mnt/smp1/notes.txt
edit

Limits and side effects

  • No save-as, undo, search/replace or syntax checking. Larger files are rejected rather than truncated. Opening a ROM file permits viewing/editing in RAM, but saving to ROM fails.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 2, 3, 4, 5, 7, 8, 9, 14, 15, 16, 20. See the diagnostic reference.

See also

mbc · less · cp · Shell syntax

mk90.commands

Command exec

Execute a compiled MBX1 BASIC program.

Synopsis

exec program.mbx
./program.mbx

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
program.mbxPath to an MBX1 file; the explicit EXEC form validates content, not merely its suffix.

Description

Verifies the entire file checksum and its 16-byte header before execution. Initializes the 26 variables to zero and the pseudorandom seed to 1, then executes in the foreground child, PID 3.

The file remains open to protect its sectors while the runtime fetches bytecode in 256-byte pages. One additional data file can be opened by the program. The source BAS file is not needed.

The runtime polls keyboard and yields every 32 bytecode instructions. SU+C interrupts even an infinite GOTO loop. END, STOP, errors or interruption return to the shell and release owned handles.

In the shell, a first token not found in the command registry is tried as an executable path. Thus ./program.mbx works; exec ./program.mbx is the unambiguous explicit form. EXEC does not replace the parent shell as POSIX exec would.

Examples

exec /mnt/smp1/demo.mbx
./demo.mbx

Limits and side effects

  • No native machine-code file loader, command-line arguments to BASIC, concurrent BASIC instances or BASIC pipes. Missing paths and malformed MBX files return errors.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 3, 4, 6, 8, 9, 14, 15, 35, 36, 37, 38, 39, 40, 130. See the diagnostic reference.

See also

mbc · run · edit · Shell syntax

mk90.commands

Command help

List command names or display the compact guide for one command.

Synopsis

help [command]

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

ParameterMeaning
commandOptional registered command name; case-insensitive.

Description

With no argument, prints the 33 registered names and the reminder help cmd. With one valid name, reads and verifies that command’s guide from the boot ROM.

HELP is dispatched as an ordinary foreground application, using the same registry as the other commands. Its on-device guide is deliberately short; this manual supplies the full reference.

Examples

help
help mbc
help ls

Limits and side effects

  • There is no on-device full-text search. A filename is not a help topic.

Status and diagnostics

Success is status 0. Relevant status codes: 8, 13, 19. See the diagnostic reference.

See also

pipe · mbc · Shell syntax

mk90.commands

Command kill

Mark background slot 1 or 2 as finished.

Synopsis

kill pid

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
pid1 or 2; the slot must have been allocated.

Description

Sets the slot state to DONE and its recorded exit code to 130. It is a cooperative job-control operation, not a POSIX signal. A subsequent RUN may reuse the slot.

Examples

run count
kill 1
wait 1

Limits and side effects

  • PID 0 and PID 3 are not valid targets. There are no signal numbers, process groups or asynchronous kill commands typed while the shell is blocked in a foreground application.

Status and diagnostics

Success is status 0. Relevant status codes: 8. See the diagnostic reference.

See also

run · ps · wait · Shell syntax

mk90.commands

Command less

View text one eight-row page at a time.

Synopsis

less file
producer | less

Ordinary invocation: foreground child, PID 3; the shell waits. Also has a dedicated pipe-consumer form.

Parameters

ParameterMeaning
fileOne regular MKS2 file in the standalone form.
producerAn allowed pipe producer; the right-hand LESS takes no arguments.

Description

Uses constant-size buffers rather than loading the entire file. BK or space advances, lowercase b goes back in a file, and lowercase q or SU+C exits. The final page is marked (END).

Backward file navigation closes and reopens the reader, then scans from the beginning to the requested display page. It can therefore be slow on long files.

A pipe is not seekable: b is ignored there. Closing the pipe reader early wakes a blocked producer and terminates its output. At EOF, advancing in pipe mode exits; in file mode it remains at the end until a valid back or quit action.

Examples

less /mnt/smp1/demo.bas
cat /mnt/smp1/demo.bas | less
help | less

Limits and side effects

  • No search, line-number jump or arbitrary terminal control sequences. Letter controls are case-sensitive; switch to lowercase with R/L if necessary. File checksum verification is complete only when reading reaches EOF.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 3, 4, 6, 8, 9, 14, 15, 18. See the diagnostic reference.

See also

cat · pipe · edit · Shell syntax

mk90.commands

Command ls

List a directory or describe one regular file.

Synopsis

ls [path]

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

ParameterMeaning
pathOptional absolute or relative path; default is the current directory.

Description

For a regular file, prints its name and length in bytes. For a directory, prints its immediate children: directories have a trailing slash; files have their byte length.

The virtual directories /, /dev and /mnt have fixed listings. A name in /dev or /mnt is not proof that its hardware is available.

Normal volume listings pause after each eight entries. The [BK] prompt accepts a key to continue. In a pipeline this internal pause is disabled; the consumer controls paging. Entries follow inode order, without sorting.

Examples

ls
ls /mnt/smp1
ls /mnt/smp1/demo.bas
ls /mnt/smp1 | less

Limits and side effects

  • No options, recursive listing, glob expansion, timestamps or permission columns. Use the documented single-path form.

Status and diagnostics

Success is status 0. Relevant status codes: 3, 4, 6, 8, 14, 18. See the diagnostic reference.

See also

cd · pwd · less · devices · Shell syntax

mk90.commands

Command mbc

Compile an MBC-16 BASIC source file on the MK90.

Synopsis

mbc source.bas

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
source.basRegular source file with case-insensitive .bas suffix, on a volume where the output can be created.

Description

Performs two passes: first validates and measures bytecode and records line targets; then emits the executable. The output path replaces the source suffix with lowercase .mbx in the same directory.

A successful run clears the text console and reports the output pathname and length followed by B OK. The output is MBX1 bytecode, executed by the native runtime, not PDP-11 machine code.

The source is read in blocks; it need not fit the editor buffer. There are at most 64 non-empty source lines. Compilation uses the shared console buffers as workspace and yields between source lines. The display is not a live progress indicator.

The previous executable is preserved on a failed compile or failed publication. Use the language reference for the exact integer dialect.

Examples

cp /mnt/smp0/demo.bas /mnt/smp1/demo.bas
cd /mnt/smp1
mbc demo.bas
./demo.mbx

Limits and side effects

  • Not a complete implementation of the original MK90 BASIC. No real numbers, string variables, arrays or general Linux executable output. No compiler options, separate output-path argument, pipe use or background compilation. Compilation does not poll SU+C.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 32, 33, 34. See the diagnostic reference.

See also

exec · edit · cp · Shell syntax

mk90.commands

Command mem

Display the configured RAM, ROM and editor limits.

Synopsis

mem

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

This command has no documented parameters.

Description

Reports RAM 16 KiB / ROM 32 KiB and EDITOR 1280 B / 16 INODE. These are build limits, not a live allocator or free-memory report.

The 32 KiB cartridge is serial storage; it does not add 32 KiB of directly addressable CPU RAM.

Examples

mem

Limits and side effects

  • No memory dump, allocation report or RAM expansion detection.

Status and diagnostics

Success is status 0. Relevant status codes: 13. See the diagnostic reference.

See also

uname · devices · Shell syntax

mk90.commands

Command mkdir

Create one directory on a mounted writable MKS2 volume.

Synopsis

mkdir path

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
pathNew directory path; its parent must already exist.

Description

Allocates one of the volume’s 16 shared file/directory inodes and records its parent. Directories use metadata only, without a data extent. A successful commit makes the new name visible.

Examples

mkdir /mnt/smp1/work
mkdir /mnt/smp1/work/src

Limits and side effects

  • No -p, recursive creation or permission argument. Virtual directories and the boot ROM cannot be extended. An existing target is an error.

Status and diagnostics

Success is status 0. Relevant status codes: 3, 4, 5, 7, 8, 9, 11, 14, 15, 18. See the diagnostic reference.

See also

rmdir · ls · cd · Shell syntax

mk90.commands

Command mkfs

Initialize one supported-size writable cartridge as MKS2.

Synopsis

mkfs device capacity

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
deviceRegistered writable block device; the boot device is protected.
capacityCapacity in KiB: exactly 8, 10, 16, 32 or 64.

Description

This is destructive formatting. The volume must be unmounted and not busy. After the prompt, enter YES and press BK; confirmation is case-insensitive. Any other answer cancels without formatting.

Checks for address aliasing between 2 KiB regions, creates the single-partition MKS2 layout, verifies writes, and writes the valid header last. A successful format also marks the volume mounted.

Use the actual hardware capacity. The parameter is not a partition size to apply arbitrarily to a smaller cartridge.

Examples

cd /
umount /mnt/smp1
mkfs /dev/smp1 10

Limits and side effects

  • The example is for a mounted 10 KiB cartridge whose existing content may be erased; skip UMOUNT if it is already unmounted. Formatting is unnecessary when upgrading an existing compatible MKS2 data cartridge. No EEPROM programming algorithm or BASIC-format conversion is supplied.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 2, 5, 8, 14, 15, 17. See the diagnostic reference.

See also

mount · umount · devices · Shell syntax

mk90.commands

Command mount

List mounted volumes or mount an MKS2 volume.

Synopsis

mount [device mountpoint]

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
deviceOne of the registered /dev block-device names.
mountpointThe fixed mountpoint paired with that device; both arguments are required together.

Description

Without arguments, lists mounted paths and their RO/RW state. With two arguments, explicitly reads and validates the MKS2 header and metadata and sets that device’s mount bit.

The boot cartridge is registered as mounted and read-only at startup, with its filesystem inside the final 8 KiB of the 32 KiB ROM. Its metadata is read when needed. SMP1 data is mounted explicitly.

The stock BASIC format is not MKS2. A readable stock cartridge can therefore fail MOUNT while passing bus or ROM-switching diagnostics. Mounting never formats or imports it.

Examples

mount
mount /dev/smp1 /mnt/smp1

Limits and side effects

  • Fixed pairs only: smp0→/mnt/smp0, smp1→/mnt/smp1, fd0→/mnt/fd0, cf0→/mnt/cf0. The last two drivers are absent. No mount options or arbitrary mountpoints.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 3, 4, 8, 14, 15, 17. See the diagnostic reference.

See also

umount · mkfs · devices · romtest · Shell syntax

mk90.commands

Command mv

Move or rename one regular file.

Synopsis

mv source destination

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
sourceExisting regular file on a writable volume.
destinationFile path or an existing directory.

Description

Within one volume, changes the name and parent of the source inode in one metadata commit. Its data extent and inode index remain the same. An existing target file is replaced; identical source and target resolve to a no-op.

Across volumes, completes a verified copy first, then deletes the source. If source deletion fails after the copy, both copies can remain. This is not an atomic operation across two devices.

Moving from the boot ROM is rejected because removal of the source is not allowed; use CP to extract ROM files.

Examples

mv draft.txt final.txt
mv final.txt work

Limits and side effects

  • Regular files only; no moving directory trees, wildcard moves or overwrite confirmation. On the standard ROM-plus-one-data-cartridge setup, only the data cartridge is writable.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 18. See the diagnostic reference.

See also

cp · rm · mkdir · Shell syntax

mk90.commands

Command pipe

Display the compact pipeline usage guide.

Synopsis

pipe

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

This command has no documented parameters.

Description

This registered command only prints a help resource. To create a pipe, use the | operator between two command expressions, such as ls /mnt/smp1 | less.

The operator connects two separately scheduled contexts through a blocking 256-byte FIFO in RAM. It does not create a temporary file.

Examples

pipe
ls /mnt/smp1 | less
echo Hello | cat

Limits and side effects

  • Exactly one producer and one bare CAT or LESS consumer. No chains, named pipes, shell redirection or BASIC pipelines. One background slot must be available.

Status and diagnostics

Success is status 0. Relevant status codes: 13. See the diagnostic reference.

See also

cat · less · ps · Shell syntax

mk90.commands

Command ps

Display task slots, states, names and application counters.

Synopsis

ps

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

This command has no documented parameters.

Description

Prints PID S NOME PASSI and one row for each non-free slot. NOME means “name”; PASSI means “steps”. The counter belongs to the application and is not CPU time.

While standalone PS runs, PID 0 normally appears as W (waiting for its child) and PID 3 as R with name ps. Finished background slots remain visible until reused. The scheduler also has I/O waiting states for pipe endpoints.

Examples

run count 5
ps
ps | less

Limits and side effects

  • No options or process tree. PID numbers are reusable slot indexes, not permanent job identities. For the full state table see the multiprogramming chapter.

Status and diagnostics

Success is status 0. Relevant status codes: 8. See the diagnostic reference.

See also

run · wait · kill · Shell syntax

mk90.commands

Command pwd

Print the normalized absolute current directory.

Synopsis

pwd

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

This command has no documented parameters.

Description

Writes the current working directory and a newline. It does not query or change the medium. Unlike CD, PWD runs in the foreground child, PID 3.

Examples

pwd
pwd | cat

Limits and side effects

  • No options.

Status and diagnostics

Success is status 0. No command-specific status is added; shared ROM/controller failures remain possible. See the diagnostic reference.

See also

cd · pipe · Shell syntax

mk90.commands

Command rm

Delete one regular file.

Synopsis

rm file

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
fileExisting regular file on a mounted writable volume.

Description

Removes the directory entry in a metadata commit. There is no extra confirmation. Data sectors can be reused when no metadata generation or open reader still references them.

Examples

rm /mnt/smp1/old.txt

Limits and side effects

  • No recursive deletion, wildcard expansion, trash or secure erasure. It does not remove directories.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 2, 3, 4, 5, 6, 8, 9, 14, 15, 18. See the diagnostic reference.

See also

rmdir · cp · Shell syntax

mk90.commands

Command rmdir

Remove an empty directory.

Synopsis

rmdir path

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
pathAn existing empty directory on a writable volume.

Description

Checks that the directory has no children, is not the current directory or one of its ancestors, and is not a volume root. Removes the inode in a metadata commit.

Examples

cd /
rmdir /mnt/smp1/work/src
rmdir /mnt/smp1/work

Limits and side effects

  • No recursive deletion and no confirmation prompt. Use RM for regular files.

Status and diagnostics

Success is status 0. Relevant status codes: 5, 6, 8, 10, 12, 14, 15, 18. See the diagnostic reference.

See also

mkdir · rm · cd · Shell syntax

mk90.commands

Command romtest

Check the full boot ROM and repeated cartridge switching.

Synopsis

romtest

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

This command has no documented parameters.

Description

First compares distinct 32-byte markers at byte offsets 0x3FE0, 0x5FE0 and 0x7FE0, reporting 16, 24 and 32 KiB milestones.

Then reads all 128 sectors of the 32 KiB boot ROM and checks the 16-bit word sum. Before each ROM sector it selects the other slot and reads its first byte, exercising slot switching. The final success text is ROM 32K + SWITCH OK.

The operation is read-only and yields between ROM sectors. Use it to diagnose addressing and switching on the already wired 27C256 setup.

Examples

romtest

Limits and side effects

  • A responsive cartridge in the other slot is required for the switching phase. This does not read all of SMP1, validate its filesystem, prove its capacity or certify electrical timing. Earlier milestone success does not replace the final whole-ROM result.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 13. See the diagnostic reference.

See also

mount · devices · Shell syntax

mk90.commands

Command run

Start one of the two built-in background worker types.

Synopsis

run count|pulse [count]

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
count|pulseCOUNT increments a counter; PULSE also beeps on each step. Names are case-insensitive.
countOptional number of steps, 1–9999. Omit it to run continuously.

Description

Allocates PID slot 1 or 2 and prints its number. Each worker first sleeps for 32 RTC ticks, increments its unsigned 16-bit counter, and, for PULSE, emits a beep. A finite worker exits with code zero after its requested steps.

One step is nominally one second, plus scheduling and work delay. It is not a precision stopwatch. A completed or faulted slot can be reused and its private data is cleared.

Examples

run count 10
run pulse 3
ps
wait 1

Limits and side effects

  • RUN does not launch arbitrary files, shell commands or BASIC programs in the background. At most two slots are available, and a pipeline consumes one. An explicit count of zero is invalid; omission selects continuous execution.

Status and diagnostics

Success is status 0. Relevant status codes: 8, 15. See the diagnostic reference.

See also

ps · kill · wait · sleep · exec · Shell syntax

mk90.commands

Command sleep

Suspend the foreground command while other tasks continue.

Synopsis

sleep seconds

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
secondsDecimal integer from 0 to 1023 inclusive.

Description

Converts whole seconds to 32 Hz RTC ticks and calls the cooperative sleep service. A value of zero yields without a timed delay.

The shell waits for this foreground child. Background workers still run, subject to cooperation. Waking occurs after the deadline when a runnable context can be selected.

Examples

run count 5
sleep 2
ps

Limits and side effects

  • No fractional durations. The sleep command does not poll for SU+C during its timed wait; it is not a general cancellable timer.

Status and diagnostics

Success is status 0. Relevant status codes: 1, 8. See the diagnostic reference.

See also

time · wait · run · Shell syntax

mk90.commands

Command time

Read the RTC time as HH:MM:SS.

Synopsis

time

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

This command has no documented parameters.

Description

Samples the clock around its update interval, retries an unstable read, and converts the configured binary/BCD and 12/24-hour representation to a 24-hour display.

The command reads the clock only. Set the clock through the original MK90 firmware.

Examples

time
time | cat

Limits and side effects

  • No time-setting, timezone or synchronization argument. The RTC does not supply timezone information.

Status and diagnostics

Success is status 0. Relevant status codes: 1. See the diagnostic reference.

See also

date · sleep · Shell syntax

mk90.commands

Command uart

Display the UART configuration placeholder.

Synopsis

uart

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

This command has no documented parameters.

Description

Prints XP1 UART NOT CONFIGURED (“XP1 UART not configured”). The command documents a future expansion point; it performs no UART register access.

Examples

uart

Limits and side effects

  • No serial driver, baud-rate setting, terminal, transmit/receive or automatic XP1 probing is implemented in 0.7.

Status and diagnostics

Success is status 0. Relevant status codes: 13. See the diagnostic reference.

See also

devices · Shell syntax

mk90.commands

Command umount

Clear a volume’s mounted state.

Synopsis

umount mountpoint

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
mountpointThe root of a mounted volume, such as /mnt/smp1.

Description

Refuses to unmount a volume containing the current directory or an open file handle. Change to / first. Successful unmount does not delete data.

Writes are verified and committed by their owning operation; UMOUNT is not a delayed-write flush command. Before changing a physical cartridge, leave it, unmount it, and explicitly mount the replacement.

Examples

cd /
umount /mnt/smp1

Limits and side effects

  • No force option. Keep the boot ROM physically installed: the OS continues to load code and resources from it.

Status and diagnostics

Success is status 0. Relevant status codes: 3, 4, 8, 14, 15, 18. See the diagnostic reference.

See also

mount · cd · Shell syntax

mk90.commands

Command uname

Display the operating-system name and version.

Synopsis

uname

Ordinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer.

Parameters

This command has no documented parameters.

Description

Prints the banner MK90/Unix 0.7 (C) 2026.

Examples

uname
uname | cat

Limits and side effects

  • No POSIX -a or machine-information options.

Status and diagnostics

Success is status 0. Relevant status codes: 13. See the diagnostic reference.

See also

mem · help · Shell syntax

mk90.commands

Command wait

Wait for one allocated background slot to finish.

Synopsis

wait pid

Ordinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.

Parameters

ParameterMeaning
pid1 or 2, including a slot already in DONE or FAULT state.

Description

Allows the scheduler to run until the target is DONE or FAULT, then prints its recorded exit code. The WAIT command itself returns success after printing that code.

SU, then C cancels this wait without killing the target. A cancelled wait does not print a final target code.

Examples

run count 3
wait 1
ps

Limits and side effects

  • Cannot wait for an arbitrary PID or collect several jobs at once. The result belongs to the current occupant of the slot. BASIC WAIT has a different meaning and uses ticks.

Status and diagnostics

Success is status 0. Relevant status codes: 8. See the diagnostic reference.

See also

run · kill · sleep · Shell syntax

mk90.commands

Command reference

All 33 registered shell commands in MK90/Unix 0.7.

Command summary

CommandSynopsisDescription
beepbeepEmit a short tone through the internal buzzer.
catcat fileWrite file bytes to standard output.
cdcd [directory]Change the shell’s current directory.
clearclearClear the text console and reset its cursor.
cpcp source destinationCopy one regular file, including between volumes.
datedateRead the RTC date as YY-MM-DD.
devicesdevicesList configured block-device slots and access flags.
echoecho [word [word [word]]]Write up to three argument tokens to standard output.
editedit [file]Open the text editor, with BASIC macros for .bas files.
execexec program.mbxExecute a compiled MBX1 BASIC program.
helphelp [command]List command names or display the compact guide for one command.
killkill pidMark background slot 1 or 2 as finished.
lessless fileView text one eight-row page at a time.
lsls [path]List a directory or describe one regular file.
mbcmbc source.basCompile an MBC-16 BASIC source file on the MK90.
memmemDisplay the configured RAM, ROM and editor limits.
mkdirmkdir pathCreate one directory on a mounted writable MKS2 volume.
mkfsmkfs device capacityInitialize one supported-size writable cartridge as MKS2.
mountmount [device mountpoint]List mounted volumes or mount an MKS2 volume.
mvmv source destinationMove or rename one regular file.
pipepipeDisplay the compact pipeline usage guide.
pspsDisplay task slots, states, names and application counters.
pwdpwdPrint the normalized absolute current directory.
rmrm fileDelete one regular file.
rmdirrmdir pathRemove an empty directory.
romtestromtestCheck the full boot ROM and repeated cartridge switching.
runrun count|pulse [count]Start one of the two built-in background worker types.
sleepsleep secondsSuspend the foreground command while other tasks continue.
timetimeRead the RTC time as HH:MM:SS.
uartuartDisplay the UART configuration placeholder.
umountumount mountpointClear a volume’s mounted state.
unameunameDisplay the operating-system name and version.
waitwait pidWait for one allocated background slot to finish.

Conventions

Square brackets mark optional arguments; they are not typed. Alternatives in a synopsis are choices, not a literal pipe character. In an actual command line, | creates a pipeline. Commands are case-insensitive; paths are case-sensitive. Read the shell grammar.

mk90.guide

Getting started

From the 27C256 image to your first compiled BASIC program.

Requirements

  • Elektronika MK90 with 16 KiB RAM and the cartridge wiring already validated for the 27C256.
  • The 32,768-byte mk90_unix_v0.7_27c256.bin image, normally installed in SMP0.
  • A writable supported SMP data cartridge in SMP1 for saving files and compiling BASIC. A stock 10 KiB module is supported at the storage-driver level; it must contain MKS2 to mount.

Install and boot

Program the whole binary starting at EPROM offset zero, then use the programmer’s verify operation. The image is one 32 KiB layout, not four duplicate 8 KiB images. Start the cartridge from the original MK90 startup menu.

After the banner, the prompt begins at the virtual root: / $ . The boot slot remains physically identified as SMP0 or SMP1; no DOS drive-letter renaming occurs.

The bootstrap loads 8,762 bytes of resident code into RAM. Other applications and resources are read from the boot cartridge when needed. Leave that cartridge installed while the OS runs.

Use an existing MKS2 cartridge

devices
mount /dev/smp1 /mnt/smp1
cd /mnt/smp1
ls

Do not format a compatible data cartridge just to update the ROM. The MKS2 layout in 0.7 is compatible with the previous 0.5 release.

Prepare a new data cartridge

For an unmounted 10 KiB data cartridge:

cd /
mkfs /dev/smp1 10

Confirm with YES, then BK. If the volume is already mounted, first run umount /mnt/smp1 while outside it. A successful MKFS also mounts the volume. Valid capacity arguments are 8, 10, 16, 32 and 64 KiB; use the module’s actual size.

Compile the supplied demonstration

cp /mnt/smp0/demo.bas /mnt/smp1/demo.bas
cd /mnt/smp1
mbc demo.bas
./demo.mbx

The demonstration clears the display, prints five numbered lines and beeps. The compiler creates demo.mbx next to its source. Compilation directly in the read-only boot volume cannot create that output.

To change the source, run edit demo.bas. Save with SU, then S; exit with SU, then Q; compile again. Editor guide.

Try cooperative jobs and a pipe

run count 10
ps
sleep 2
ps
ls /mnt/smp1 | less

RUN prints the allocated PID. A pipeline needs at least one free or finished background slot. In LESS, BK/space advances; lowercase q exits. Enter the pipe character with V/N, then backslash.

If the ROM does not run correctly

Run romtest with a responsive cartridge in the other SMP slot to check the ROM and slot switching. A successful ROM test does not imply that the data cartridge has an MKS2 filesystem. See Diagnostics for the exact messages.

mk90.guide

Shell syntax

The actual command-line parser and dispatch rules.

Prompt and input

The prompt is the normalized current directory followed by $ . It starts as / $ . BK submits a line, backspace removes the previous character, and SU+C cancels the pending line.

The command line holds at most 95 characters plus a terminator. There is no history, cursor editing, completion or shell scripting language. Use EDIT to change a file.

Grammar

command-line = command [ "|" consumer ]
command      = name [ " " argument ] ...
consumer     = "cat" | "less"

Spaces split tokens; repeated spaces are skipped. A maximum of four tokens, including the command name, is retained on the producer or ordinary-command side. Additional tokens are silently ignored by the parser. Follow each command’s documented arity rather than relying on ignored arguments.

The single pipe is recognized even without surrounding spaces. The consumer must be bare CAT or LESS, with optional surrounding spaces and no arguments. More than one pipe, or a missing side, is invalid.

Case and paths

Registered command names and HELP topics are case-insensitive. Paths are case-sensitive: Note.txt and note.txt are different names. Use ASCII letters, digits, dot, hyphen and underscore in a component; the maximum is 12 characters.

Absolute paths start with /. Relative paths start at the current directory. ., .. and repeated slashes are normalized. No ~, home directory, PATH search or drive-letter alias is implemented.

Command and executable dispatch

A registered name selects its command record. CD runs in the shell itself. Other normal commands execute as PID 3 while PID 0 waits.

If the first token is not a registered name, the shell tries that token as an MBX executable path. It does not search a list of directories or infer a file extension. Prefer exec path.mbx or ./name.mbx for clarity. Arguments on the implicit executable form are not passed into BASIC.

run is reserved for the built-in COUNT and PULSE background workers. It does not execute a BAS file or an arbitrary application.

Syntax not implemented

Syntax0.7 behavior
QuotesNo quoting or grouping; quote marks are ordinary token characters.
BackslashNo escape sequences; it is a keyboard character, with V/N producing |.
> or >>No file redirection; these are ordinary token characters, not operators.
&No background operator.
; or && or ||No command lists or conditional execution. More than one | is rejected.
* or ?No wildcard expansion.
$NAME or $(...)No variables or command substitution.

Control-code overlap

The input interface exposes a small translated code set. Up-arrow and SU+C both produce code 3; down-arrow and SU+D both produce code 4. Consequently up-arrow also cancels a shell input line or a BASIC run, while down-arrow terminates standalone CAT /dev/console. The editor interprets codes 3 and 4 as vertical movement. These are actual 0.7 mappings, not a full terminal key protocol.

mk90.guide

Text editor

Named and unnamed buffers, movement, saving and BASIC insertion.

Open a buffer

Use edit path to load an existing regular file or create a new empty buffer at a missing filename. The parent directory must exist. Files longer than 1,280 bytes produce status 20 and are not truncated.

edit without a path is an unnamed scratch buffer. SU+S reports status 16; there is no save-as prompt. For persistent work, open a pathname at the start.

Editor controls

Key sequenceAction
Left / RightMove one character within the buffer.
Up / DownMove vertically by displayed rows, following line wrapping.
BKInsert a line feed.
BackspaceDelete the character immediately before the cursor.
SU, then SSave the current named file; stay in the editor.
SU, then QExit; if changed, ask whether to discard.
R/LToggle lowercase/uppercase state.
FK, then a legend keyInsert its BASIC word in a .bas buffer.

Screen and status

The first row shows the basename, a star for unsaved changes, and case state [A] or [a]. BASIC buffers show BAS; an armed function-key prefix shows FK. An underscore marks the insertion position in the displayed text.

The body uses eight display rows and scrolls to keep the cursor visible. Long physical lines wrap to the 30-column console. Cursor motion follows this displayed layout.

Save and exit

Saving uses the transactional file writer. A successful save clears the changed flag. A failed save leaves the buffer available and does not publish a partial replacement.

SU+Q exits immediately if unchanged. Otherwise it asks SCARTARE? YES + BK (“Discard?”). YES, case-insensitive, discards; another answer returns to editing. A ROM file can be edited in RAM but cannot be saved in place.

BASIC mode

A .bas suffix, ignoring case, selects BASIC insertion. FK is a sequential prefix: press and release FK, then the desired legend key. Pressing FK again toggles the prefix off. An expansion inserts the whole word only if it fits; no partial keyword is inserted at the buffer limit.

For example, FK then R inserts RUN , and FK then P inserts PRINT . This is text entry, not command execution. Factory legends include words unsupported by MBC-16; see the full macro table.

The editor does not compile, execute, syntax-check, indent or colorize the buffer. Leave it, then use MBC and EXEC.

Limits

  • 1,280 bytes total, including line feeds and inserted macro text.
  • Printable single-byte text; no Unicode editing or tab expansion.
  • No undo, selection, clipboard, search/replace, save-as or multiple open buffers.
  • SU+C is not an editor exit command: code 3 is used for up-arrow movement.
mk90.guide

MKS2 filesystem

Volumes, directories, names, allocation and verified publication.

Namespace

PathMeaning
/Virtual root; contains dev/ and mnt/.
/devFixed device and stream names.
/mntFixed registered mountpoints.
/mnt/smp0SMP0 volume, or the boot ROM’s internal read-only volume when booting there.
/mnt/smp1SMP1 volume; normally the writable data cartridge.
/mnt/fd0 and /mnt/cf0Reserved mountpoints with no driver in 0.7.
/dev/consoleApplication-level keyboard/LCD stream supported by CAT/CP.
/dev/nullApplication-level empty source/discard sink supported by CAT/CP.

Names and directories

Names are case-sensitive, 1–12 ASCII characters from letters, digits, dot, hyphen and underscore. The normalized path is at most 95 bytes. . and .. have their usual path-navigation meaning.

Each volume has 16 inodes total, shared by files and directories across the entire tree. A directory stores a parent link, not an independently sized table of 16 children. The volume root is implicit and does not consume an inode.

Directory contents have no timestamps, owner, group, permission bits, hard links or symbolic links. Empty directories use no data sectors; even an empty regular file reserves one 256-byte sector.

Capacity and file sizes

Volume sizeLogical sectorsData-area upper bound
8 KiB326912 bytes
10 KiB408960 bytes
16 KiB6415104 bytes
32 KiB12831488 bytes
64 KiB25664256 bytes

Sectors are 256 bytes. Five sectors are reserved for the header and two metadata copies. A file uses one contiguous extent and can be at most 64,256 bytes, subject to volume capacity, other files, metadata generations and free contiguous space.

The editor’s 1,280-byte limit is an application limit. CAT, CP and LESS stream larger files. MBC reads source blocks but independently limits a program to 64 non-empty source lines.

Verified writes and replacement

The file writer knows the final length before writing. It reserves a new extent that does not overlap either valid metadata generation or the sectors of an open reader. Data is written, reread and compared. Only a successful close publishes the new inode in the inactive metadata copy.

An interrupted or incomplete output does not publish a partial new file. An earlier version remains referenced if it existed. Both generations and pinned readers can temporarily keep old extents unavailable, so replacement may require more free space than the final file length.

Only one writer can be open. There are two owned handles total, allowing two readers or one reader plus one writer. A writer blocks conflicting filesystem mutations. This is neither journaling nor a general multiwriter filesystem.

Reading and recovery

MOUNT validates the header and metadata copies, then chooses the newest valid generation with modular 16-bit comparison. If one copy is invalid, it can use the other. Both invalid copies cause failure.

A regular file has a byte-sum checksum in its inode. Reading through EOF verifies it; closing early does not force a complete scan. An application can display earlier bytes before discovering a later checksum failure. The system does not automatically substitute an old file version for damaged data.

The checks detect many ordinary corruption cases but are not a cryptographic integrity mechanism or a complete validator for deliberately hostile images.

Operations and compatibility

MKDIR/RMDIR manage directories; RM removes one file; CP copies and replaces; MV renames within a volume or copies then removes across volumes. Cross-volume MV has no atomic transaction spanning both devices.

MKS2 has a single partition per volume and its own on-media format. It is not FAT, ext2, a Linux filesystem or the original MK90 BASIC cartridge format. No conversion or repair command is supplied. On-media format reference.

mk90.guide

Devices and expansion

Physical slot identity and the boundary of current driver support.

Device map

IndexDeviceMountpointDriver and role
0/dev/smp0/mnt/smp0SMP block driver; normally the protected boot ROM.
1/dev/smp1/mnt/smp1SMP block driver; normally the writable data cartridge.
2/dev/fd0/mnt/fd0Reserved, OFF; no floppy driver.
3/dev/cf0/mnt/cf0Reserved, OFF; no CompactFlash/IDE driver.

Boot-device mapping

The boot slot is marked read-only independently of whether it is SMP0 or SMP1. Its filesystem device exposes 32 logical sectors starting at physical sector 96, corresponding to EPROM offsets 0x6000–0x7FFF. The rest of the ROM contains the bootstrap, kernel, modules and resources.

The other SMP driver can address up to 256 logical 256-byte sectors, or 64 KiB. This driver bound is not an automatic capacity measurement. The mounted MKS2 header specifies a supported size, and formatting performs alias checks.

Console and null

CAT and CP implement the /dev/console and /dev/null stream cases themselves. These are not ordinary MKS2 files and are not accepted by the native regular-file OPEN service or BASIC OPEN.

CAT can echo console input until SU+D. CP can send a file to the console or null; it cannot capture an unknown-length console stream into a file.

Future XP1 support

The device abstraction carries a driver callback, physical unit, flags, a 32-bit logical capacity and a base LBA. This leaves room for later drivers without renaming the two physical SMP slots.

Version 0.7 does not include a PC16550, 16450, 68B50 or other UART driver, nor an XP1 bus probe. The UART command reports this state. A future expansion needs agreed hardware decoding and an implemented driver; the presence of a reserved name is not working hardware support.

mk90.system

Multiprogramming

Four fixed context slots with cooperative scheduling and explicit ownership.

Execution model

MK90/Unix 0.7 has one CPU and four task-control blocks. At most one context executes at a time. Other active tasks make progress when the running context calls a yield or a blocking operation that yields. There is no timer-driven preemption.

This is real context switching: registers, stack pointer, return program counter and supported processor status are saved and restored. It is deliberately smaller than a general Unix process model: there is no fork, address-space duplication, memory protection, arbitrary background command execution or dynamically allocated process table.

Context slots and ownership

PIDRoleStackResources and lifetime
0Shell/parser/dispatcherShared 512-byte foreground stackWaits while PID 3 borrows the stack; CD runs here.
1Background worker or pipe consumer160 bytes, plus 32 private data bytesIndependent registers and stack; slot can be reused.
2Background worker or pipe consumer160 bytes, plus 32 private data bytesIndependent registers and stack; slot can be reused.
3One foreground childSame stack as PID 0Runs an ordinary command or the single BASIC instance; parent is suspended.

One simple foreground command can coexist with both background workers. A pipeline needs one of slots 1/2 for its consumer and can coexist with at most one other worker. PIDs identify slots, not permanent process histories.

Foreground command lifecycle

The shell resolves and loads a command before starting its child. It saves its continuation, marks PID 0 WAIT_CHILD, initializes PID 3 and calls the entry point on the existing foreground stack. PID 0 is not runnable while PID 3 uses that stack.

The child can yield to PID 1/2. Returning normally or through task_exit restores the saved parent continuation, records the child result and changes its state to DONE. The kernel closes the child’s pipe writer, releases its readers and aborts uncommitted file writers. PID 0 becomes READY again.

This mechanism neither forks the shell nor gives the child a second 512-byte stack. The parent’s suspended frames and the child’s frames share the one bounded region. The next command reuses PID 3.

Scheduler algorithm

task_yield saves the context while interrupts are masked, then scans cyclically from the following TCB. A sleeping task whose deadline is due becomes READY. READY contexts with valid stacks can be selected; FREE, DONE, FAULT and blocked contexts are skipped.

If no context is ready, the scheduler enables interrupts and executes WAIT, then scans again. RTC and keyboard interrupts can wake the CPU; their handlers do not select a different task themselves.

The selection order is round-robin among eligible slots at yield points. It is not a fixed time slice and does not promise equal CPU time. A task that does not cooperate can delay every other task, even while timer interrupts continue.

Yield is suppressed during a shared-controller transaction or when the saved interrupt priority masks interrupts. The sleep service rejects those conditions before marking a task asleep. Native blocking APIs must not be called from interrupt handlers.

Task states

ValuePS letterStateMeaning / transition
0–FREENot allocated; omitted from PS.
1RREADYEligible for selection; the current running task uses this state too.
2SSLEEPDeadline in RTC ticks; made READY by a later scheduler scan.
3DDONEFinished; exit result retained until the slot is reused.
4FFAULTStack check failed in a background slot; exit result 1.
5IWAIT_READPipe reader blocked until data or writer closure.
6OWAIT_WRITEPipe writer blocked until space or reader closure.
7WWAIT_CHILDShell cannot run while its foreground child borrows the stack.

RTC and timing

The kernel uses a nominal 32 Hz RTC tick, held in an unsigned 16-bit counter. The counter wraps every 65,536 ticks: 2,048 seconds. Deadlines are compared with modular signed differences, so a single sleep accepts at most 32,767 ticks.

The shell SLEEP command accepts 0–1023 whole seconds. BASIC WAIT accepts 0–32767 ticks. Zero means yield. Neither the conversion nor a deadline guarantees when a task actually resumes: controller work and other tasks can add latency.

COUNT and PULSE sleep for 32 ticks before each step, then do their work. Their counters are application progress, not elapsed-time measurements. PS does not show CPU percentages or accumulated CPU time.

Built-in background workers

RUN creates only COUNT or PULSE. An optional 1–9999 step limit gives a finite run; omission means continuous operation. PULSE calls the guarded buzzer API after incrementing its counter. On a tone I/O failure it exits with the returned error.

KILL accepts only PID 1 or 2 and marks the selected allocated slot DONE with result 130. It is not a signal facility. WAIT prints a target’s exit result when it becomes DONE/FAULT, or allows SU+C to abandon the wait without stopping the worker. A later RUN may overwrite the old slot history.

I/O and memory ownership

Only PID 0 and PID 3 may use the regular-file services; they never execute simultaneously. Background workers must use their own registers, stack and 32-byte data area and cannot touch shell buffers, load application modules or directly use filesystem, keyboard, LCD or shared-controller registers.

The registered pipe consumer is a controlled exception: its verified pager code remains loaded while it owns the keyboard/display, and it reads only the FIFO. It does not open files or overwrite a suspended producer’s sector buffer.

The application loader accepts the shell and the foreground child’s registered BASIC module family. It rejects ordinary background loads, and all replacement loads while a pipe is active. These restrictions preserve return addresses and code across yield points.

There is no MMU or protection boundary between native tasks. A trusted native task with an invalid pointer can still corrupt another subsystem. These contracts govern the built-in code; they are not a security sandbox.

Context frames and stack checks

A saved context, from its saved SP upward, contains R5, R4, R3, R2, R1, R0, PSW and PC. The supported PSW state is its low byte, including condition flags and interrupt priority. Trace mode and privileged modes of other PDP-11 models are not promised.

Each stack region has an A55A guard word. Checks require an aligned saved SP, at least 32 bytes above the lower bound, and room for the saved frame below the upper bound. The declared stack sizes include kernel and IRQ frames, not just application locals.

A bad background stack marks that slot FAULT. If it is the pipe consumer, its read endpoint closes and wakes the producer. A bad shared shell/foreground stack is fatal: the system displays a stack error and requires restart. Guard checks detect some corruption after it occurs; they do not prevent every invalid write.

BASIC participation

MBC compiles in PID 3 and yields between source lines. It reuses console text/shadow memory for the scanner and target table, so it does not render or poll keyboard during compilation. COUNT/PULSE remain compatible because they do not touch those buffers.

The MBX runtime also uses PID 3. Every 32 opcodes it calls the keyboard poll path, which renders, rescans input and yields. WAIT yields directly; keyboard input also cooperates. One BASIC instance may coexist with the native workers, but cannot be started with &, RUN or a pipe.

SU+C cancellation is checked at runtime polling/input points. A long WAIT or controller transaction must return before the next cancellation check; compilation has no SU+C polling loop.

Related reference

Native task API · Pipe lifecycle · Memory layout · ps

mk90.system

Pipes and interprocess communication

One blocking byte FIFO connecting two independently scheduled contexts.

Supported syntax

producer [arguments] | cat
producer [arguments] | less

Allowed producers are help, ls, pwd, cat, echo, uname, mem, time, date and ps. The consumer must be bare CAT or LESS. Case-insensitive command matching applies on both sides.

There is one pipe system-wide, with exactly two stages. A free or finished slot 1/2 must be available for the consumer. MBC, EXEC, EDIT and other unlisted commands are rejected as producers. The PIPE command itself displays usage; it is not the operator.

Startup and lifetime

StepDispatcher / process action
1PID 0 verifies the producer and loads the pager consumer module into its separate application window.
2The dispatcher validates syntax, activates the pipe and creates its consumer in slot 1 or 2.
3The consumer gets an initial yield to set up display state and wait for input.
4The producer starts as foreground PID 3; PID 0 waits for its child.
5Both endpoints run cooperatively. The consumer owns keyboard/display; the producer owns filesystem operations.
6Producer completion closes the write endpoint. The consumer drains bytes and receives EOF.
7PID 0 waits for consumer completion, clears the active pipe state, then resumes the prompt.

The native application windows stay loaded for the whole pipeline. While the active flag is set, the loader rejects replacement requests; a task cannot resume into overwritten code.

FIFO and blocking behavior

The ring buffer holds 256 bytes at RAM 0x0100–0x01FF, reusing bootstrap storage after the kernel has been loaded. Indices wrap modulo 256; an explicit count distinguishes a full ring from an empty one.

Writing to a full FIFO sets WAIT_WRITE and yields. Reading one byte makes room and wakes the writer. Reading an empty FIFO with an open writer sets WAIT_READ and yields. Writing a byte wakes the reader.

The producer’s normal putc/puts output is bound to the FIFO. The consumer receives bytes in order; no temporary file, batch spool or source-text substitution is involved. The ring operations themselves do not yield midway, and interrupt handlers do not modify it.

EOF, early close and errors

Closing the writer wakes a blocked reader. The reader receives all remaining bytes before EOF; EOF is a separate return value, not a reserved byte within the stream.

Closing the reader wakes a blocked writer with EPIPE, status 21. The producer’s output routine aborts its foreground command immediately, releases file handles and does not continue reading the rest of an unwanted file.

A normal early quit from LESS is treated as a successful user action: if the producer ended with EPIPE, the pipeline returns the consumer’s result. Other producer errors are reported after pipeline completion. On an ordinary non-EPIPE path, the returned pipeline status is the producer’s status, not a generalized combination of every process result.

Consumer task return closes its endpoint. A detected consumer stack fault also closes it and wakes the writer, preventing a producer from sleeping forever on a reader that can no longer run.

Paging and keyboard ownership

Piped LS suppresses its built-in eight-entry pause. The LESS consumer chooses when to stop for a page. BK or space advances; lowercase q or SU+C closes the consumer. There is no backward paging on a pipe. At the final page, an advance or quit action exits.

The CAT consumer simply forwards bytes to the console and yields frequently. A console-input CAT producer is disallowed, because the consumer owns keyboard/display during a pipeline.

Boundaries

  • One FIFO, one writer, one reader; no multi-stage chains or multiple simultaneous pipelines.
  • No named pipes, duplicated handles, stderr channel, tee, redirection to files, shell filters loaded from disk or arbitrary consumer arguments.
  • No fork, signals, process groups or detached pipelines. The foreground shell cannot accept a new command while the pipeline runs.
  • Other native workers can continue if a slot remains; there is no BASIC producer or consumer in this release.

Examples

ls /mnt/smp1 | less
cat /mnt/smp1/demo.bas | less
echo Hello MK90 | cat
help | less
ps | cat

Native pipe API · Scheduling and states.

mk90.system

Memory and application loading

Build-specific layout of the 16 KiB RAM and the 32 KiB cartridge.

Memory model

All addresses on this page are hexadecimal byte addresses; range ends are inclusive unless stated otherwise. The CPU executes native code from RAM. The SMP ROM is storage accessed through the controller, rather than an extra 32 KiB of CPU memory.

The kernel occupies 8,762 of the 8,768 bytes assigned to its resident area, leaving 6 bytes there. This is not 6 bytes of total system free RAM; the rest is assigned to fixed data, buffers, stacks and loadable module windows.

RAM layout

RangeUse
0000–00FFVectors; RTC at 0040, keyboard at 00C8.
0100–01FFBootstrap initially; then pipe FIFO or private MBC/EXEC scratch.
0200–05BF120×64 monochrome framebuffer, 960 bytes.
0600–069BKernel and controller globals.
06A0–06EFTwo 40-byte file descriptors.
06F0–06FFProcess/module-cache state.
0700–071FKeyboard queue storage.
0720–075FFour 16-byte block-device records.
0760–07AFFour 20-byte task-control blocks.
07B0–07EFBASIC compiler/runtime state.
07F0–07FFPipe control, eight words.
0800–2A3FResident kernel area.
2A40–2C3F512-byte active MKS2 metadata buffer.
2C40–2D3FTMP/COPYBUF, 256-byte data scratch buffer.
2D40–2E3FVERIFY; also runtime bytecode cache.
2E40–2F6BText console, 300 bytes.
2F6C–3097Text shadow, 300 bytes.
30A0–30FFNormalized path, 96 bytes.
3100–315FCurrent directory, 96 bytes.
3160–316FFilename scratch.
3180–319F / 31A0–323FPID 1 private data / 160-byte stack.
3240–325F / 3260–32FFPID 2 private data / 160-byte stack.
3300–37FFOrdinary lower application window, 1,280 bytes.
3800–3CFFPager module or 1,280-byte editor buffer.
3D00–3DFFShell input/arguments and application paths; reused by BASIC.
3E00–3FFF512-byte stack shared by PID 0 and PID 3.

BASIC overlays and workspace

In BASIC mode the application region is repartitioned: 3300–363F is an 832-byte lower phase, and 3640–3CFF is a 1,728-byte common module. These are alternate uses, not extra simultaneous windows.

During compilation, TEXT/SHADOW provide a 256-byte source cache and a 256-byte table of up to 64 line-number/offset pairs. The compiler restores the text console after releasing that workspace.

During execution, 3D00–3D33 holds A–Z, 3D40–3D9F holds a data pathname and 3DA0–3DDF holds eight FOR/GOSUB frames. The operand stack uses the foreground stack with an explicit limit of 16 values.

ROM layout

ROM byte range / offsetPurpose
0000–01FFBootstrap area.
0200 onwardResident image, 8,762 bytes.
2480 onward, below 3D00First region of verified native application modules.
3D00–3D7FAdditional EXEC help record.
3FDEWhole-ROM checksum word.
3FE0 / 5FE0 / 7FE0Distinct 32-byte addressing markers.
4000–4FFFFirst 32 compact help records.
5000–577FThirty 64-byte checksummed English message records.
5800–5FDFAdditional verified BASIC compiler/runtime stages; marker at 5FE0.
6000–7FFF8 KiB read-only MKS2 system volume; its data also contains module storage.
6500 onwardRemaining native modules in the system volume’s data area.
7D00–7EFFFK keyword dictionary.

Module loading rules

The loader validates the module ID, native module ABI 3, destination window, size, ROM bounds and checksum. PID 0 can request normal loads. PID 3 can request only its registered BASIC family. Background contexts cannot load arbitrary modules.

Compiler phase changes pass through the upper common module, which restores the lower caller before returning. The runtime keeps fetch, arithmetic and control flow in the upper module; lower device/graphics/file phases always return to the stable dispatcher before another phase can replace them.

A native pipeline uses the ordinary lower window for its producer and the pager window for its consumer. The active pipe prevents every replacement load until both contexts have finished.

mk90.system

MKS2 on-media format

The partition header, mirrored directory records and file extents.

Conventions

Offsets in format tables are byte offsets. Multi-byte fields are little-endian words unless a byte range is stated. Sectors are 256 bytes. Supported volumes have 32, 40, 64, 128 or 256 sectors. The first data sector is 5.

Volume header: sector 0

Byte offsetField
0–3ASCII MKS2.
4Version 2.
6Checksum word: sum of all 128 words in the sector is zero modulo 65536.
8Total sector count.
10Partition count, fixed at 1.
12First partition sector, fixed at 1.
14Partition length, total sectors minus 1.
16Partition type, fixed at 1.
18First data sector, fixed at 5.
20Sector size, fixed at 256.
22–255Reserved.

Metadata generations

Copy A occupies sectors 1–2; copy B occupies sectors 3–4. Each 512-byte copy begins with ASCII DIR2, generation at byte 4 and checksum at byte 6. Bytes 8–63 are reserved. Sixteen 28-byte inodes follow at byte 64.

The sum of the 256 words of each metadata copy is zero modulo 65536. The newer valid generation is selected using signed modular subtraction; equal generations prefer A. Consecutive generation wrap from 65535 to 0 is supported.

Inode record

Byte offsetField
0–13Zero-terminated name, maximum 12 characters; zero padding.
14Starting data sector; zero for a directory.
16Unsigned file length, 0–64256; zero for a directory.
18Sum of file bytes modulo 65536.
20Type: 0 free, 1 regular file, 2 directory.
22Parent: 0 for volume root, otherwise inode index 1–16.
24–27Reserved.

Extents and validation

A regular file uses max(1, ceil(length / 256)) contiguous sectors. Metadata validation checks types, bounds, extents and parent chains. Names are created under the public filename restrictions; MOUNT is not a complete hostile-image validator.

New allocations avoid both generations and open readers. Data writes are reread and verified before publishing the inactive metadata copy. The valid header is written last during formatting. This design does not provide secure deletion or an automatic repair command.

MBX executables are ordinary MKS2 files; their file checksum lives in this inode, not in a separate MBX checksum field. MBX1 format.

mk90.guide

Limits and compatibility

A compact boundary reference for release 0.7.

Numeric limits

ResourceLimit
CPU RAM / boot ROM16 KiB / 32 KiB.
Text / graphics30×10 characters / 120×64 monochrome pixels.
Command input95 characters; four retained tokens including command name.
Filename / normalized path12 / 95 characters.
Volume sizes8, 10, 16, 32, 64 KiB.
Inodes16 per volume, shared by files and directories.
Regular file64,256 bytes, subject to volume and contiguous-space limits.
File handlesTwo total; one writer at a time.
Editor1,280 bytes.
ContextsFour fixed slots; PID 0 and 3 share a stack.
Background slotsTwo; a pipeline uses one.
PipeOne FIFO, 256 bytes, two stages.
Shell SLEEP0–1023 seconds.
Native sleep / BASIC WAIT0–32767 nominal 32 Hz ticks.
BASIC scalars / arrays26 signed 16-bit scalars; 26 arrays sharing 76 elements.
BASIC source64 non-empty lines; literal strings up to 95 bytes.
BASIC parser / operands / controlDepth 12 / 16 values / eight shared FOR-GOSUB frames.
BASIC data filesOne in addition to the open executable.

Compatibility boundaries

  • Unix-style naming does not provide a POSIX shell, fork/exec ABI, Linux syscalls or Unix on-disk filesystem.
  • MBC-16 is our structured integer BASIC, distinct from factory BASIC.
  • No floating point, string variables, DEF FN, transcendental functions, inline THEN statements or universal BASIC file syntax.
  • No arbitrary native executable-file loading, dynamic linking, multiple concurrent BASIC instances or BASIC pipelines.
  • No UART, floppy, CF/IDE driver, external video/audio interface or PS/2 keyboard driver.

Validation scope

The 0.7 verification covers the existing OS, task, stream, process and BASIC checks plus new structured-control, array and DATA tests. They execute generated instructions in the supplied CPU model with a 16 KiB RAM limit. They are not a physical-board certification or exact timing simulation.

This manual identifies the shipped ROM by SHA-256:

2ad9b1f679011f0aea62e7852df5c2a87b06f21dd501d1f6cb909144d21f4f35
mk90.guide

Keyboard reference

Sequential prefixes, translated key codes and all FK expansions.

Prefix keys

KeyBehavior
SUToggle the control prefix; the next translated character is reduced to its control code.
V/NToggle a one-character shift prefix. Digits/punctuation select the implemented shifted symbols; backslash becomes |.
R/LToggle lowercase/uppercase; the editor displays [a]/[A].
FKIn a .bas editor buffer, arm/disarm one keyword insertion.

Use prefixes sequentially: press the prefix, then the next key. Repeated events of a held prefix are suppressed. Normal character repeats are supplied by RTC-paced controller rescanning, nominally up to eight per second; this is not a multi-key rollover or key-release API.

Context-specific controls

ContextKeys
Shell inputBK submits; backspace deletes; SU+C cancels the line.
EditorArrows move; BK inserts LF; SU+S saves; SU+Q exits.
LESSBK/space forward; lowercase b back only in a file; lowercase q or SU+C exits.
CAT /dev/consoleSU+D terminates input.
BASIC runtimeSU+C interrupts; INPUT uses BK to accept a number.
WAIT commandSU+C cancels the wait without killing its target.

Translated control codes

ValueKeys / event
0No event returned by nonblocking INKEY.
1Left arrow; also SU+A.
2Right arrow; also SU+B.
3Up arrow; also SU+C.
4Down arrow; also SU+D.
8Backspace (physical raw DBh).
9Tab key; not a tab-expansion feature in the editor.
13BK / Enter.
17SU+Q.
19SU+S.
30FK event (physical raw DFh).

The runtime’s periodic cancellation poll consumes a key and only acts on code 3. It can therefore consume an ordinary key before a later INKEY expression observes it. INKEY is event polling, not a reliable held-key matrix or queued-message contract for every physical key.

Because arrow and SU codes overlap, up-arrow can cancel outside the editor and down-arrow can end console CAT. The table describes the actual translated API in this release.

Entering punctuation

V/N followed by backslash gives |; V/N followed by 2 gives a double quote; V/N followed by 8 gives (; V/N followed by 9 gives ); V/N followed by colon gives *; V/N followed by semicolon gives +.

V/N followed by comma gives <, minus gives =, period gives >, and slash gives ?. These combinations allow assignments and comparisons to be entered directly from the physical keyboard.

Complete FK expansion table

In the table, “key” is the normal 0.7 Latin-map character or control, and raw is the physical key byte in hexadecimal. Every word except a function ending in ( receives a trailing space. The factory-style table has 51 entries.

Insertion availability does not imply compiler support. In particular RUN, SAVE, LOAD, PLAY and the other unimplemented factory words are not silently accepted by MBC. They remain ordinary text in the editor.

RawKeyInserted textMBC-16 status
0BAAUTO Factory legend; not an MBC-16 feature
0FIINPUT Implemented
13RRUN Factory legend; not an MBC-16 feature
17[RETURN Implemented
231SIN(Factory legend; not an MBC-16 feature
276COS(Factory legend; not an MBC-16 feature
2BBDRAW Factory legend; not an MBC-16 feature
2FJINIT Factory legend; not an MBC-16 feature
33SSTEP Syntax keyword
37]RESTORE Implemented
3BUp arrowDIS Factory legend; not an MBC-16 feature
3FDown arrowGOSUB Implemented
432EXP(Factory legend; not an MBC-16 feature
477LOG(Factory legend; not an MBC-16 feature
4BWWAIT Implemented
4FKKILL Factory legend; not an MBC-16 feature
53TSAVE Factory legend; not an MBC-16 feature
57XREM Implemented
5BLeft arrowDEV Factory legend; not an MBC-16 feature
633ABS(Implemented
678SGN(Factory legend; not an MBC-16 feature
6BGGOTO Implemented
6FLLET Implemented
73USTOP Implemented
77YREAD Implemented
7B,DEF FN Factory legend; not an MBC-16 feature
834SQR(Factory legend; not an MBC-16 feature
879ATN(Factory legend; not an MBC-16 feature
8BDDATA Implemented
8FMLIST Factory legend; not an MBC-16 feature
93FFOR Implemented
97_RANDOMIZE Implemented
9B.DIM Implemented
A35INT(Factory legend; not an MBC-16 feature
A70RND(Implemented
ABEEND Implemented
AFNNEXT Implemented
B3HHELP Factory legend; not an MBC-16 feature
B7\FILES Factory legend; not an MBC-16 feature
BBRight arrowDELETE Factory legend; not an MBC-16 feature
C3:LLIST Factory legend; not an MBC-16 feature
C7/LFILES Factory legend; not an MBC-16 feature
CBVEDIT Factory legend; not an MBC-16 feature
CFONAME Factory legend; not an MBC-16 feature
D3CCLS Implemented
D7@LOAD Factory legend; not an MBC-16 feature
E3;LPRINT Factory legend; not an MBC-16 feature
EBZTHEN Syntax keyword
EFPPRINT Implemented
F3^PLAY Factory legend; not an MBC-16 feature
F7QLOCATE Implemented
mk90.guide

Diagnostics and status codes

Exact message text, return codes and practical interpretation.

Reading diagnostics

Shell diagnostics are in English. The table preserves the displayed strings and explains their meaning. BASIC normally reports BASIC @ line code; its line value is the BASIC line number, including automatically assigned numbers, not necessarily the physical file line.

The shell has no $? variable. WAIT prints a worker’s stored exit result; most commands print only an error message when needed. A missing unregistered command token is tried as an executable path, so a typo can produce NOT FOUND rather than UNKNOWN COMMAND.

BASIC runtime cancellation returns code 130 without the usual BASIC error banner. Some low-level errors, including a rejected WAIT, use the shared status values below.

Status summary

CodeDisplayed text / formMeaning
0—Success.
1I/O ERRORController/transfer error; also an incomplete writer close or rejected native sleep.
2WRITE VERIFICATION FAILEDA write could not be verified by rereading.
3VOLUME UNFORMATTED/ABSENTNo valid supported MKS2 header; absent/unformatted or incompatible volume.
4CORRUPT FILESYSTEM/DATAInvalid metadata or a file-data checksum failure.
5READ ONLYThe target device is read-only or protected.
6NOT FOUNDThe requested file, directory or path was not found.
7NO SPACE OR FREE INODESNo suitable free extent or inode.
8INVALID ARGUMENTS/NAMEInvalid argument, filename, handle or PID.
9IS A DIRECTORYA directory was supplied where a regular file was required.
10NOT A DIRECTORYA path component is not a directory.
11ALREADY EXISTSThe target already exists for an operation requiring a new name.
12DIRECTORY NOT EMPTYRMDIR target contains children.
13ROM ERR @ ROM resource/module/addressing validation failed; a location may follow.
14DEVICE ABSENT/NOT MOUNTEDDevice has no driver or volume is not mounted.
15PATH BUSYBusy resource, disallowed owner, protected current path or no free task slot.
16SAVE: OPEN EDIT WITH A PATHUnnamed editor buffer: reopen EDIT with a pathname to save.
17LBA OUTSIDE DEVICELogical block address is outside device bounds.
18NOT A REGULAR FILEUnsupported special path or non-regular-file operation.
19UNKNOWN COMMANDUnknown registered command, for example an invalid HELP topic.
20FILE TOO LARGE FOR EDITThe file exceeds the 1,280-byte editor limit.
21BROKEN PIPEEPIPE: the pipe reader has closed.
22PIPE: INVALID SYNTAX/COMMANDInvalid pipeline syntax, producer or consumer.
32BASIC @ line 32Syntax error, unsupported word, duplicate/non-increasing line number or NUL in source.
33BASIC @ line 33Compiler limit exceeded: literal, line table, expression depth, code length or related bound.
34BASIC @ line 34GOTO/GOSUB/THEN destination line is absent.
35BASIC @ line 35Invalid MBX header, opcode, variable index, fetch/branch bound or device argument.
36BASIC @ line 36Invalid or exhausted operand/control stack; mismatched NEXT/RETURN.
37BASIC @ line 37Division by zero, STEP 0 or invalid mathematical argument.
38BASIC @ line 38Data-file state error or GET beyond EOF.
39BASIC @ line 39Array not dimensioned, repeated DIM, invalid bound/index or exhausted array capacity.
40BASIC @ line 40READ exhausted the numeric DATA stream.
130—Cancellation/termination: SU+C in BASIC or KILL result for a worker.

Status 0

Success.

Status 1

I/O ERROR: Controller/transfer error; also an incomplete writer close or rejected native sleep.

Status 2

WRITE VERIFICATION FAILED: A write could not be verified by rereading.

Status 3

VOLUME UNFORMATTED/ABSENT: No valid supported MKS2 header; absent/unformatted or incompatible volume.

Status 4

CORRUPT FILESYSTEM/DATA: Invalid metadata or a file-data checksum failure.

Status 5

READ ONLY: The target device is read-only or protected.

Status 6

NOT FOUND: The requested file, directory or path was not found.

Status 7

NO SPACE OR FREE INODES: No suitable free extent or inode.

Status 8

INVALID ARGUMENTS/NAME: Invalid argument, filename, handle or PID.

Status 9

IS A DIRECTORY: A directory was supplied where a regular file was required.

Status 10

NOT A DIRECTORY: A path component is not a directory.

Status 11

ALREADY EXISTS: The target already exists for an operation requiring a new name.

Status 12

DIRECTORY NOT EMPTY: RMDIR target contains children.

Status 13

ROM ERR @ : ROM resource/module/addressing validation failed; a location may follow.

Status 14

DEVICE ABSENT/NOT MOUNTED: Device has no driver or volume is not mounted.

Status 15

PATH BUSY: Busy resource, disallowed owner, protected current path or no free task slot.

Status 16

SAVE: OPEN EDIT WITH A PATH: Unnamed editor buffer: reopen EDIT with a pathname to save.

Status 17

LBA OUTSIDE DEVICE: Logical block address is outside device bounds.

Status 18

NOT A REGULAR FILE: Unsupported special path or non-regular-file operation.

Status 19

UNKNOWN COMMAND: Unknown registered command, for example an invalid HELP topic.

Status 20

FILE TOO LARGE FOR EDIT: The file exceeds the 1,280-byte editor limit.

Status 21

BROKEN PIPE: EPIPE: the pipe reader has closed.

Status 22

PIPE: INVALID SYNTAX/COMMAND: Invalid pipeline syntax, producer or consumer.

Status 32

BASIC @ line 32: Syntax error, unsupported word, duplicate/non-increasing line number or NUL in source.

Status 33

BASIC @ line 33: Compiler limit exceeded: literal, line table, expression depth, code length or related bound.

Status 34

BASIC @ line 34: GOTO/GOSUB/THEN destination line is absent.

Status 35

BASIC @ line 35: Invalid MBX header, opcode, variable index, fetch/branch bound or device argument.

Status 36

BASIC @ line 36: Invalid or exhausted operand/control stack; mismatched NEXT/RETURN.

Status 37

BASIC @ line 37: Division by zero, STEP 0 or invalid mathematical argument.

Status 38

BASIC @ line 38: Data-file state error or GET beyond EOF.

Status 39

BASIC @ line 39: Array not dimensioned, repeated DIM, invalid bound/index or exhausted array capacity.

Status 40

BASIC @ line 40: READ exhausted the numeric DATA stream.

Status 130

Cancellation/termination: SU+C in BASIC or KILL result for a worker.

Boot and fatal messages

MessageInterpretation
ROM ERR >8KExtended resident load/check failed. The recovery path in the verified prefix stops; check the programmed image and cartridge addressing.
KEYBOARD BUS ERROR / RESTART MK90Keyboard/shared-controller failure; the system has stopped and requests restart.
STACK ERR / RESTARTShared shell/foreground stack check failed; the system has stopped.
RTC UNAVAILABLERTC sampling failed to obtain a stable value within its bounded retry loop.

Diagnostic cases

ObservationWhat to check
ROMTEST milestones pass but MOUNT failsROM addressing is separate from data format. Is the data cartridge MKS2, with a valid header and metadata?
DEVICES shows RW but access failsRW describes the driver flags. It does not prove presence or capacity of the cartridge.
CP/MBC reports space exhausted despite a small outputReplacement uses a new contiguous extent; both metadata generations and open readers can retain older sectors.
Pipeline reports busyOne of background slots 1/2 is required by its consumer. Check PS and stop or wait for a worker.
FK inserts a word which MBC rejectsThe editor includes factory legends; only the documented MBC-16 subset compiles.
RND restarts with the same sequenceThe runtime deliberately starts its pseudorandom seed at 1 each execution.
Long WAIT does not stop immediately on SU+CCancellation is checked at runtime polling/input points, not within the sleep deadline wait.
mk90.api

Native API reference

Calling contracts for the services used by built-in native applications.

Version and calling convention

The native file/task/pipe API has build version 2. Native ROM modules use module ABI 3. These are not POSIX interfaces or stable numeric addresses across releases. This reference applies to the specific 0.7 image identified on the validation page.

Calls use PDP-11 JSR PC,@#entry and RTS PC. This public contract describes services; it does not publish the operating-system implementation or supply a loader for external native machine-code files. Built-in native extensions require integration into a new private firmware build.

Routine summary

RoutineGroup0.7 entry address
block_ioblocks0x0FE0
file_abortfiles0x190C
file_closefiles0x191C
file_openfiles0x162E
file_readfiles0x17EC
file_writefiles0x1876
pipe_close_readpipes0x250C
pipe_close_writepipes0x2534
pipe_readpipes0x24A4
pipe_writepipes0x243A
task_beeptasks0x2386
task_datatasks0x232E
task_exittasks0x22FE
task_selftasks0x2328
task_sleeptasks0x21FA
task_spawntasks0x2238
task_yieldtasks0x20C4

Ownership and pointers

Only shell/foreground owners use regular-file services. A task calling native routines must supply valid RAM pointers and preserve its own state across yields. There is no MMU to protect invalid caller buffers. Native blocking routines are not ISR-safe.

mk90.api

Task services

Cooperative task routines for resident workers and the registered pipe consumer.

Routine summary

RoutineInputResult
task_spawnR0 = resident entry; R1 = initial argumentR0 = PID 1/2, or 0 on rejection/full; R1–R5 preserved.
task_yieldNo argumentsR0–R5, SP, PC and supported PSW state restored on resumption.
task_sleepR0 = 0–32767 ticksR0 = 0 after the wait; 1 for an invalid duration or critical-section call. R1–R5 preserved.
task_selfNo argumentsR0 = address of the current task-control block.
task_dataNo argumentsR0 = private data address; R1 = 32. Both zero for PID 0/3.
task_beepNo argumentsR0 = 0 success or 1 I/O error; R1–R5 preserved.
task_exitR0 = final resultTerminates PID 1/2 or restores the parent of PID 3; PID 0 receives error 1.

task_spawn

task_spawn
R0 = resident entry; R1 = initial argument
ContractValue
Entry address0x2238
ReturnsR0 = PID 1/2, or 0 on rejection/full; R1–R5 preserved.

Allocates and initializes a background slot. Entry must be aligned and in the resident range, except the registered, verified pipe consumer while the pipe is active. Starts with R0 set to the argument, R1–R5 zero and interrupts enabled. Clears the slot’s private data; installs a return trampoline. FREE, DONE and FAULT slots may be reused. It is not a native-file loader.

task_yield

task_yield
No arguments
ContractValue
Entry address0x20C4
ReturnsR0–R5, SP, PC and supported PSW state restored on resumption.

Saves the calling context, checks stacks and selects the next READY context. In a busy controller transaction or with masked interrupt priority, returns without switching. The call is cooperative and must not be made from an ISR.

task_sleep

task_sleep
R0 = 0–32767 ticks
ContractValue
Entry address0x21FA
ReturnsR0 = 0 after the wait; 1 for an invalid duration or critical-section call. R1–R5 preserved.

Zero yields. Positive durations set a modular 16-bit deadline and put the caller in SLEEP before yielding. The scheduler makes it READY after the deadline; actual resumption depends on other tasks yielding.

task_self

task_self
No arguments
ContractValue
Entry address0x2328
ReturnsR0 = address of the current task-control block.

Returns a descriptor pointer, not a numeric PID. The descriptor is internal; applications should not rewrite its scheduling fields.

task_data

task_data
No arguments
ContractValue
Entry address0x232E
ReturnsR0 = private data address; R1 = 32. Both zero for PID 0/3.

Returns the fixed private area of a background slot. Its contents survive yields and are zeroed when the slot is reused. There is no heap allocation.

task_beep

task_beep
No arguments
ContractValue
Entry address0x2386
ReturnsR0 = 0 success or 1 I/O error; R1–R5 preserved.

Provides the permitted buzzer path for background workers. It preserves the foreground controller-error state around the guarded tone transaction.

task_exit

task_exit
R0 = final result
ContractValue
Entry address0x22FE
ReturnsTerminates PID 1/2 or restores the parent of PID 3; PID 0 receives error 1.

Closes an owned pipe read endpoint, records the final result and yields permanently for a worker. A normal RTS from a spawned worker reaches a trampoline that calls this routine. For PID 3, foreground cleanup restores the saved shell continuation.

Task-control block

Four 20-byte TCBs begin at 0x0760. Offsets are byte offsets; fields are little-endian words.

OffsetField
0State; see multiprogramming state table.
2Saved stack pointer.
4RTC wake deadline modulo 65536.
6 / 8Stack lower / upper-exclusive bounds.
10Pointer to resident ASCIIZ name.
12Application counter, unsigned 16-bit.
14COUNT/PULSE limit; zero means continuous.
16Final result.
18Scheduler-selection count, unsigned 16-bit with wrap.

Execution, stack and scheduling rules.

mk90.api

File services

Owned, sector-oriented access to regular MKS2 files.

Routine summary

RoutineInputResult
file_openR0 = ASCIIZ path; R1 = 1 read / 2 replace; R2 = final length for replacementR0 = status; R1 = handle 0/1 or FFFF on failure. R2–R5 preserved.
file_readR0 = handle; R1 = RAM buffer of at least 256 bytesR0 = status; R1 = valid bytes 0–256. R2–R5 preserved.
file_writeR0 = handle; R1 = buffer; R2 = byte countR0 = status; R1 = bytes accepted. R2–R5 preserved.
file_closeR0 = handleR0 = status; R1–R5 preserved.
file_abortR0 = handleR0 = status; R1–R5 preserved.

file_open

file_open
R0 = ASCIIZ path; R1 = 1 read / 2 replace; R2 = final length for replacement
ContractValue
Entry address0x162E
ReturnsR0 = status; R1 = handle 0/1 or FFFF on failure. R2–R5 preserved.

Only PID 0/3 may open regular MKS2 files. Paths are at most 95 bytes, components at most 12. Length is 0–64256 bytes subject to space. Two handles exist; only one writer may be open. A replacement reserves a new extent and does not publish the file until successful close.

file_read

file_read
R0 = handle; R1 = RAM buffer of at least 256 bytes
ContractValue
Entry address0x17EC
ReturnsR0 = status; R1 = valid bytes 0–256. R2–R5 preserved.

Reads the next sector; zero bytes means EOF on success. The full buffer capacity is required even for a short final sector. The running checksum counts only valid file bytes. At EOF a checksum mismatch returns status 4 and zero bytes; earlier bytes may already have reached the caller.

file_write

file_write
R0 = handle; R1 = buffer; R2 = byte count
ContractValue
Entry address0x1876
ReturnsR0 = status; R1 = bytes accepted. R2–R5 preserved.

The count must be exactly min(256, remaining declared length), or zero after the length has been reached. The last sector is zero-padded outside its valid data; every write is reread and compared. There is no seek, append, arbitrary chunk-size API or implicit growth.

file_close

file_close
R0 = handle
ContractValue
Entry address0x191C
ReturnsR0 = status; R1–R5 preserved.

Closes a valid handle even if commit fails. A complete, error-free writer publishes to the inactive metadata generation; an incomplete writer fails and preserves the former file. Closing a reader before EOF does not force checksum validation of unread content. A reader at EOF includes validation of the empty-file case.

file_abort

file_abort
R0 = handle
ContractValue
Entry address0x190C
ReturnsR0 = status; R1–R5 preserved.

Releases an owned handle without publishing data or metadata. Use it for failed or interrupted output. Unpublished extents become allocatable when no generation or reader references them.

Ownership, buffer lifetime and publication

All operations check handle ownership; opens reject background PID 1/2. The file routines do not yield internally. A caller may yield between sectors, while retaining its pathname, handle and application-local state.

The shared TMP/COPYBUF for this build is 0x2C40–0x2D3F. Do not keep sector contents there across other calls that read metadata, paths or ROM resources. FILE_WRITE supports this scratch buffer as its source by preserving valid bytes before padding.

Both valid metadata generations and open readers protect referenced extents from allocation. Only close publishes a complete writer. A writer blocks other mutations; formatting/unmounting a volume with open handles is rejected. Preserve the original failure code while aborting other handles.

File descriptor

Two 40-byte records begin at 0x06A0 and 0x06C8. This internal layout is not an independently stable ABI.

OffsetField
0Mode: 0 free, 1 reader, 2 writer.
2Owner TCB pointer.
4Device index.
6Byte position.
8Persistent transfer error.
10Running byte checksum modulo 65536.
12–39Private 28-byte inode copy: name, extent, length, checksum, type and parent.
mk90.api

Pipe services

Dispatcher-bound endpoints of the single RAM byte FIFO.

Routine summary

RoutineInputResult
pipe_writeR0 = byte; current task owns writer endpointR0 = 0 success, 15 wrong owner or 21 reader closed. R1–R5 preserved.
pipe_readCurrent task owns reader endpointR0 = 0 success / 15 wrong owner; R1 = byte 0–255 or FFFF for EOF. R2–R5 preserved.
pipe_close_readCurrent task owns reader endpointRegisters preserved; non-owner close has no effect.
pipe_close_writeCurrent task owns writer endpointRegisters preserved; non-owner close has no effect.

pipe_write

pipe_write
R0 = byte; current task owns writer endpoint
ContractValue
Entry address0x243A
ReturnsR0 = 0 success, 15 wrong owner or 21 reader closed. R1–R5 preserved.

Blocks in WAIT_WRITE while the FIFO is full. A read wakes the writer. Closing the reader wakes it with EPIPE. There is no caller-supplied descriptor or independently creatable pipe.

pipe_read

pipe_read
Current task owns reader endpoint
ContractValue
Entry address0x24A4
ReturnsR0 = 0 success / 15 wrong owner; R1 = byte 0–255 or FFFF for EOF. R2–R5 preserved.

Blocks in WAIT_READ while the FIFO is empty and the writer remains open. Drains buffered data before returning EOF after writer closure.

pipe_close_read

pipe_close_read
Current task owns reader endpoint
ContractValue
Entry address0x250C
ReturnsRegisters preserved; non-owner close has no effect.

Clears the read endpoint and wakes a writer blocked for space. It is also called by task-return cleanup and by consumer stack-fault recovery.

pipe_close_write

pipe_close_write
Current task owns writer endpoint
ContractValue
Entry address0x2534
ReturnsRegisters preserved; non-owner close has no effect.

Clears the write endpoint and wakes an empty-buffer reader. Remaining data stays available to read before EOF.

Pipe control

The 256-byte FIFO is at 0x0100; its 16-byte control record is at 0x07F0. The dispatcher creates and binds endpoints; applications do not modify this record directly.

OffsetField
0Write index, 0–255.
2Read index, 0–255.
4Byte count, 0–256.
6Reader TCB pointer; zero when closed.
8Writer TCB pointer; zero when closed.
10Active flag / module-lifetime lock.
12Consumer TCB retained for completion wait.
14Reserved.

Pipe lifecycle and error propagation.

mk90.api

Block-device service

The build-specific interface between storage and registered device drivers.

Routine summary

RoutineInputResult
block_ioR0:R1 = LBA low:high; R2 = 256-byte buffer; R3 = 0 read / 1 write; R4 = device indexR0 = status; R1–R5 preserved.

block_io

block_io
R0:R1 = LBA low:high; R2 = 256-byte buffer; R3 = 0 read / 1 write; R4 = device index
ContractValue
Entry address0x0FE0
ReturnsR0 = status; R1–R5 preserved.

Checks driver presence, read-only flags, logical bounds and volume-base addition, then calls the registered driver with R5 pointing to its descriptor. The SMP driver restricts the physical byte-address space to 64 KiB. A 32-bit LBA interface does not imply 32-bit MKS2 file sizes or working external drivers.

Device descriptor

Four 16-byte records start at 0x0720. A zero callback means OFF.

OffsetField
0Driver callback.
2Physical unit.
4Physical sector-size descriptor field; SMP is 256.
6Flags; bit 0 marks read-only.
8 / 10Logical capacity, low / high word.
12 / 14Volume base LBA, low / high word.

The block API transfer remains 256 bytes in this release. Reserved floppy/CF records do not provide a sector-size conversion driver. Device support.

mk90.basic.statements

Statement LET

Assign an integer to one variable.

Syntax

[LET] variable = expression

Parameters

ParameterMeaning
variableOne letter A–Z, optionally followed by an array index in parentheses; case-insensitive.
expressionA numeric expression; stored as a signed 16-bit bit pattern.

Behavior

LET is optional. All 26 scalar variables start at zero on each execution. Array elements start at zero after DIM; a scalar and array of the same letter are independent. An indexed assignment evaluates the index before the right-hand side, then stores the result.

Example

10 A=2+3*4
20 LET B=A-1
30 PRINT A;",";B

Limits and diagnostics

Scalar names are single letters. DIM declares arrays; string variables and multi-letter names are outside this dialect.

Status-code reference.

See also

PRINT · FOR · Language syntax

mk90.basic.statements

Statement PRINT

Print literal text and integer expressions.

Syntax

PRINT [item { separator item }] [separator]

Parameters

ParameterMeaning
itemA double-quoted literal or a numeric expression.
separatorSemicolon concatenates; comma emits one space.

Behavior

Without a final separator, PRINT appends a newline. A trailing semicolon or comma suppresses the newline; a trailing comma still emits its one space.

Numbers are signed decimal values. An empty PRINT on its own physical line prints a blank line. This dialect has no tab zones or automatic spacing between items separated by semicolons.

Example

10 A=12
20 PRINT "VALUE=";A
30 PRINT "LEFT","RIGHT"
40 PRINT
50 PRINT "SAME ";
60 PRINT "LINE"

Limits and diagnostics

Only literal strings are accepted. No PRINT USING, PRINT #file, TAB or SPC. A bare PRINT, including before a colon, emits a newline.

Status-code reference.

See also

LOCATE · INPUT · CLS · Language syntax

mk90.basic.statements

Statement INPUT

Read one signed decimal integer from the keyboard.

Syntax

INPUT variable

Parameters

ParameterMeaning
variableDestination A–Z.

Behavior

Shows a question-mark prompt. Enter digits, optionally preceded by a minus sign, and confirm with BK. At least one digit is required; a bare BK does not complete input.

Accepted values range from −32767 to 32767. A digit which would overflow that range is ignored. Unsupported characters are ignored; a leading plus is not required. Keyboard waiting cooperates with native background tasks. SU+C cancels the program.

Example

10 INPUT A
20 PRINT "ENTERED ";A
30 END

Limits and diagnostics

One numeric variable only. No string input, prompt-list syntax, comma-separated input list or INPUT #file. Numeric backspace is not implemented; cancel and restart to correct a mistaken number.

Status-code reference.

See also

PRINT · END · Language syntax

mk90.basic.statements

Statement IF

Select a numbered destination or a structured block.

Syntax

IF expression THEN line-number
IF expression THEN
  statements
[ELSE
  statements]
ENDIF

Parameters

ParameterMeaning
expressionZero is false; every nonzero value is true.

Behavior

The numbered form remains compatible with earlier listings. The multiline form nests with loops and other IF blocks. THEN ends the header line; ELSE and ENDIF occupy separate lines. The compiler validates matching delimiters before publishing the executable.

Example

A=2
IF A THEN
PRINT "TRUE"
ELSE
PRINT "FALSE"
ENDIF

Limits and diagnostics

No inline THEN statement, ELSEIF, END IF spelling or implicit closing at EOF.

Status-code reference.

See also

ELSE · ENDIF · WHILE · Language syntax

mk90.basic.statements

Statement GOTO

Continue execution at a numbered source line.

Syntax

GOTO line-number

Parameters

ParameterMeaning
line-numberA literal destination present in the source.

Behavior

The compiler replaces the source line number with an executable byte offset. An absent target is compilation error 34. Runtime branch bounds are checked.

A GOTO does not unwind FOR or GOSUB frames. Avoid jumping into or out of active structured loops or subroutines in a way that leaves unmatched control frames.

Example

10 PRINT "AGAIN"
20 WAIT 32
30 GOTO 10

Limits and diagnostics

No computed GOTO, ON ... GOTO or labels made of names. SU+C stops an infinite loop at a runtime cancellation poll.

Status-code reference.

See also

IF · GOSUB · WAIT · Language syntax

mk90.basic.statements

Statement GOSUB

Call a numbered subroutine.

Syntax

GOSUB line-number

Parameters

ParameterMeaning
line-numberLiteral destination present in the source.

Behavior

Pushes a return frame and jumps to the target. RETURN resumes at the following instruction, which may be after a colon on the caller’s line.

GOSUB and FOR share eight last-in, first-out control frames. Calls can nest within that combined limit. Variables are global; there are no parameters or automatic local variables.

Example

10 A=4
20 GOSUB 50
30 PRINT A
40 END
50 A=A+1
60 RETURN

Limits and diagnostics

No named subroutines or functions defined by the program. Finish nested FOR frames before returning from a subroutine.

Status-code reference.

See also

RETURN · FOR · Language syntax

mk90.basic.statements

Statement RETURN

Resume after the most recent active GOSUB.

Syntax

RETURN

Parameters

No parameters.

Behavior

The top control frame must be a GOSUB return frame. It is popped and execution resumes at its saved byte offset. An empty stack or a FOR frame at the top causes status 36.

Example

100 A=A+1
110 RETURN

Limits and diagnostics

No RETURN expression or return-line argument. This fragment must be entered through GOSUB.

Status-code reference.

See also

GOSUB · NEXT · Language syntax

mk90.basic.statements

Statement FOR

Start a counted integer loop.

Syntax

FOR variable = start TO limit [STEP increment]

Parameters

ParameterMeaning
variableLoop variable A–Z.
startInitial expression assigned to the variable.
limitFinal expression, evaluated at loop entry.
incrementStep expression, evaluated at entry; default 1, zero is an error.

Behavior

The loop includes the limit when the step reaches it exactly. Positive steps continue while the variable is at most the limit; negative steps continue while it is at least the limit.

If the initial range is empty, the runtime skips to the corresponding NEXT, including nested FOR/NEXT pairs, without executing the body. Otherwise a frame stores the loop variable, body location, limit and step.

At NEXT the variable is incremented and compared again. Signed overflow of that increment ends the loop. FOR and GOSUB share a maximum of eight active frames.

Example

10 FOR I=3 TO 1 STEP -1
20 PRINT I
30 NEXT I
40 END

Limits and diagnostics

NEXT must name the matching variable, and active loops must close in stack order. No variable lists, EXIT FOR or implicit stack unwinding on GOTO.

Status-code reference.

See also

NEXT · GOSUB · LET · Language syntax

mk90.basic.statements

Statement NEXT

Advance and test the innermost active FOR loop.

Syntax

NEXT variable

Parameters

ParameterMeaning
variableMust match the top FOR frame.

Behavior

Adds the saved step. If the signed loop bound is still satisfied, resumes the loop body; otherwise pops the frame. A mismatched variable or wrong frame type is status 36.

After normal termination the variable contains its incremented value, typically one step beyond the bound. A signed-overflow exit retains the wrapped bit pattern.

Example

10 FOR I=1 TO 3
20 PRINT I
30 NEXT I
40 PRINT I

Limits and diagnostics

The variable is mandatory. NEXT I,J and an unnamed NEXT are not supported.

Status-code reference.

See also

FOR · RETURN · Language syntax

mk90.basic.statements

Statement REM

Ignore the rest of a physical source line.

Syntax

REM comment

Parameters

ParameterMeaning
commentAny remaining text through the next LF or EOF.

Behavior

A colon inside the comment remains part of the comment. REM is a statement token, so separate it from following word text with whitespace. Comment-only lines count toward the 64 non-empty-line limit.

Example

10 REM This is a comment: still a comment
20 PRINT "HELLO"
30 END

Limits and diagnostics

No apostrophe-comment shorthand is implemented.

Status-code reference.

See also

END · Language syntax

mk90.basic.statements

Statement END

Terminate the program and return to the shell.

Syntax

END

Parameters

No parameters.

Behavior

Closes the one data file if open, releases the executable reader and returns control to the shell. A complete output is committed; an incomplete output produces an error and preserves the older file.

END and STOP have the same behavior; STOP does not retain a resumable program state. An END opcode is also appended by the compiler at end of source.

Example

10 PRINT "DONE"
20 END

Limits and diagnostics

No CONT or resume command. Completed earlier file closes remain persistent; errors and SU+C abort writers which have not been published.

Status-code reference.

See also

CLOSE · PRINT · Language syntax

mk90.basic.statements

Statement STOP

Terminate the program and return to the shell.

Syntax

STOP

Parameters

No parameters.

Behavior

Closes the one data file if open, releases the executable reader and returns control to the shell. A complete output is committed; an incomplete output produces an error and preserves the older file.

END and STOP have the same behavior; STOP does not retain a resumable program state. An END opcode is also appended by the compiler at end of source.

Example

10 PRINT "DONE"
20 STOP

Limits and diagnostics

No CONT or resume command. Completed earlier file closes remain persistent; errors and SU+C abort writers which have not been published.

Status-code reference.

See also

CLOSE · PRINT · Language syntax

mk90.basic.statements

Statement CLS

Clear the complete LCD framebuffer and text console.

Syntax

CLS

Parameters

No parameters.

Behavior

Zeros all 960 framebuffer bytes, resets the 30×10 text buffer and invalidates the text shadow. Text output resumes at column 0, row 0. Unlike the shell’s text CLEAR, this includes pixels between glyph rows and the bottom graphics rows.

Example

10 CLS
20 PRINT "NEW SCREEN"
30 END

Limits and diagnostics

The common MBC-16 program and stack limits apply.

Status-code reference.

See also

LOCATE · PSET · PRESET · LINE · Language syntax

mk90.basic.statements

Statement LOCATE

Set the text cursor position.

Syntax

LOCATE column, row

Parameters

ParameterMeaning
columnExpression in the inclusive range 0–29.
rowExpression in the inclusive range 0–9.

Behavior

Coordinates are zero-based character cells; the first parameter is the column. Text can wrap and scroll the console as usual after this position. Out-of-range values cause runtime status 35.

Example

10 CLS
20 LOCATE 4,2
30 PRINT "MK90"
40 END

Limits and diagnostics

These are text coordinates, not the 120×64 pixel coordinates used by drawing statements.

Status-code reference.

See also

PRINT · CLS · PSET · Language syntax

mk90.basic.statements

Statement PSET

Turn on one LCD pixel.

Syntax

PSET x, y

Parameters

ParameterMeaning
xExpression, 0–119 inclusive.
yExpression, 0–63 inclusive.

Behavior

Changes the addressed pixel through the framebuffer mapping, retaining other bits in its byte. The pixel operation does not redraw the entire display. Coordinates are bounded; invalid values give status 35.

Example

10 CLS
20 PSET 60,32
30 WAIT 32
40 END

Limits and diagnostics

Monochrome set operation; no color or drawing-mode argument. Text rendered over graphics may replace pixels in its glyph area.

Status-code reference.

See also

PRESET · LINE · CLS · Language syntax

mk90.basic.statements

Statement PRESET

Turn off one LCD pixel.

Syntax

PRESET x, y

Parameters

ParameterMeaning
xExpression, 0–119 inclusive.
yExpression, 0–63 inclusive.

Behavior

Clears only the addressed pixel. Coordinate checks and framebuffer mapping are the same as PSET.

Example

10 PSET 60,32
20 WAIT 16
30 PRESET 60,32
40 END

Limits and diagnostics

No color or mode argument.

Status-code reference.

See also

PSET · LINE · CLS · Language syntax

mk90.basic.statements

Statement LINE

Draw a monochrome segment between two pixel coordinates.

Syntax

LINE x1, y1, x2, y2

Parameters

ParameterMeaning
x1, x2Expressions, 0–119 inclusive.
y1, y2Expressions, 0–63 inclusive.

Behavior

Validates both endpoints and draws an inclusive integer segment using incremental pixel operations. The line is set, not erased. No full framebuffer copy is needed for each pixel.

Example

10 CLS
20 LINE 0,0,119,63
30 LINE 0,63,119,0
40 END

Limits and diagnostics

No parentheses-pair syntax, color, box option, filled rectangle, clipping of off-screen endpoints or relative-coordinate mode.

Status-code reference.

See also

PSET · PRESET · CLS · Language syntax

mk90.basic.statements

Statement BEEP

Play the standard short buzzer tone.

Syntax

BEEP

Parameters

No parameters.

Behavior

Invokes the kernel’s existing short-tone driver through its shared-controller transaction. This statement accepts no arguments.

Example

10 BEEP
20 WAIT 8
30 BEEP
40 END

Limits and diagnostics

The tone is a device operation, not a scheduler timer.

Status-code reference.

See also

SOUND · WAIT · Language syntax

mk90.basic.statements

Statement SOUND

Drive the buzzer with raw controller parameters.

Syntax

SOUND divisor, cycles

Parameters

ParameterMeaning
divisorExpression interpreted as an unsigned 16-bit value, 1–65535.
cyclesExpression in the inclusive range 0–256.

Behavior

The first value is a raw controller divisor. The second controls the driver’s bounded transfer loop. Zero cycles performs no waveform-data iterations and is not interpreted as an infinite duration.

The transaction releases the shared controller afterwards. Values outside the accepted bounds cause status 35.

Example

10 SOUND 800,8
20 WAIT 8
30 SOUND 600,8
40 END

Limits and diagnostics

The arguments are not frequency in hertz and duration in milliseconds. No music-string PLAY command or calibrated pitch/duration API is implemented. Use RTC waits for nominal timing between operations.

Status-code reference.

See also

BEEP · WAIT · Language syntax

mk90.basic.statements

Statement WAIT

Sleep cooperatively for an RTC-tick interval.

Syntax

WAIT ticks

Parameters

ParameterMeaning
ticksExpression whose signed result is 0–32767.

Behavior

At the nominal 32 Hz rate, WAIT 32 requests one second. WAIT 0 yields without a timed wait. Other runnable native contexts may continue.

The deadline is modular and resumption depends on the scheduler. SU+C is checked after returning to a runtime polling point, not continuously inside this timed sleep.

Example

10 FOR I=1 TO 3
20 PRINT I
30 WAIT 32
40 NEXT I
50 END

Limits and diagnostics

This is a timer extension, not a port-mask WAIT statement found in some BASICs. The shell WAIT command waits for a PID and is different.

Status-code reference.

See also

FOR · BEEP · Language syntax

mk90.basic.statements

Statement OPEN

Open the program’s one regular data file.

Syntax

OPEN "path",INPUT
OPEN "path",OUTPUT,length

Parameters

ParameterMeaning
pathLiteral MKS2 pathname; relative to the shell directory in which the program runs.
INPUT / OUTPUTBinary read or exact-length replacement; no AS clause.
lengthOutput length expression interpreted as unsigned, 0–64256, subject to volume space.

Behavior

The executable already holds one of the two file handles, leaving one data handle. Close it before opening another file. INPUT requires an existing regular file; OUTPUT creates or replaces using a new extent.

OUTPUT does not publish until a successful CLOSE or END after exactly the declared length has been supplied. Every sector is verified. Failure preserves the former destination.

The pathname is a literal, not a string expression. File names and components preserve case. Controller and filesystem errors use the ordinary OS status codes.

Example

10 OPEN "bytes",OUTPUT,2
20 PUT 65
30 PUT 66
40 CLOSE
50 END

Limits and diagnostics

This comma-based syntax is an MBC-16 extension. No handles or #file numbers in BASIC, simultaneous data files, append, seek, text-file INPUT#/PRINT#, /dev/null or /dev/console.

Status-code reference.

See also

GET · PUT · CLOSE · END · Language syntax

mk90.basic.statements

Statement GET

Read one byte from the open INPUT file.

Syntax

GET variable

Parameters

ParameterMeaning
variableDestination A–Z; receives 0–255.

Behavior

Uses a 256-byte internal cache. Reading past EOF produces status 38; check the EOF expression before the next GET. The underlying file reader checks data integrity as it reaches EOF.

Example

10 OPEN "bytes",INPUT
20 IF EOF THEN 60
30 GET A
40 PRINT A
50 GOTO 20
60 CLOSE
70 END

Limits and diagnostics

Requires an INPUT data file. There is no file-number argument or string GET.

Status-code reference.

See also

OPEN · CLOSE · PRINT · Language syntax

mk90.basic.statements

Statement PUT

Write one byte to the open OUTPUT file.

Syntax

PUT expression

Parameters

ParameterMeaning
expressionInteger in the inclusive range 0–255.

Behavior

Accumulates bytes in a 256-byte buffer. Full sectors are sent to the verified writer; CLOSE or END flushes the final partial sector. The total supplied bytes must match the length declared in OPEN.

An out-of-range byte produces status 35. Too little or too much output prevents successful publication; previously committed file versions are preserved.

Example

10 OPEN "digits",OUTPUT,3
20 PUT 49:PUT 50:PUT 51
30 CLOSE
40 END

Limits and diagnostics

Requires an OUTPUT data file. This writes binary bytes, not decimal formatting or automatic line endings.

Status-code reference.

See also

OPEN · CLOSE · GET · Language syntax

mk90.basic.statements

Statement CLOSE

Close the currently open data file.

Syntax

CLOSE

Parameters

No parameters.

Behavior

For OUTPUT, flushes pending bytes and commits only a complete, verified file. For INPUT, closes the reader. The executable’s own reader remains open until the program exits.

Calling CLOSE without an open data file is status 38. END/STOP automatically closes a data file; SU+C or errors abort unpublished output.

Example

10 OPEN "empty",OUTPUT,0
20 CLOSE
30 END

Limits and diagnostics

No handle argument or CLOSE ALL form.

Status-code reference.

See also

OPEN · GET · PUT · END · Language syntax

mk90.basic.statements

Statement ELSE

Begin the alternative branch of a structured IF.

Syntax

ELSE

Parameters

No parameters.

Behavior

At most one ELSE is allowed per IF. It must match the innermost open IF.

Example

IF 0 THEN
PRINT "NO"
ELSE
PRINT "YES"
ENDIF

Limits and diagnostics

A standalone line; not valid for the numbered IF form.

Status-code reference.

See also

IF · ENDIF · Language syntax

mk90.basic.statements

Statement ENDIF

Close the innermost structured IF.

Syntax

ENDIF

Parameters

No parameters.

Behavior

Required even if the IF has no ELSE. Mismatched or missing closure is a compile-time syntax error.

Example

IF 1 THEN
PRINT "YES"
ENDIF

Limits and diagnostics

A standalone line.

Status-code reference.

See also

IF · ELSE · Language syntax

mk90.basic.statements

Statement WHILE

Repeat while a condition is nonzero.

Syntax

WHILE expression
  statements
WEND

Parameters

ParameterMeaning
expressionReevaluated before each iteration.

Behavior

A false initial condition skips the body. Blocks can nest; the compiler resolves backward and forward destinations in two passes.

Example

A=0
WHILE A<3
PRINT A
A=A+1
WEND

Limits and diagnostics

No BREAK or CONTINUE statement; use a condition variable.

Status-code reference.

See also

WEND · REPEAT · IF · Language syntax

mk90.basic.statements

Statement WEND

Close the innermost WHILE loop.

Syntax

WEND

Parameters

No parameters.

Behavior

Transfers control back to the WHILE condition. A mismatched WEND is rejected.

Example

WHILE 0
PRINT "SKIPPED"
WEND

Limits and diagnostics

A standalone line.

Status-code reference.

See also

WHILE · Language syntax

mk90.basic.statements

Statement REPEAT

Start a loop whose body executes at least once.

Syntax

REPEAT
  statements
UNTIL expression

Parameters

No parameters.

Behavior

The terminating condition is evaluated after the body. UNTIL exits when nonzero.

Example

A=0
REPEAT
A=A+1
UNTIL A=3

Limits and diagnostics

REPEAT is a standalone line. Nesting shares the 16-block compiler limit.

Status-code reference.

See also

UNTIL · WHILE · Language syntax

mk90.basic.statements

Statement UNTIL

Close a REPEAT loop and test its exit condition.

Syntax

UNTIL expression

Parameters

ParameterMeaning
expressionNonzero exits; zero repeats.

Behavior

Must match the innermost open REPEAT.

Example

REPEAT
A=INKEY
UNTIL A

Limits and diagnostics

The condition ends the physical source line.

Status-code reference.

See also

REPEAT · Language syntax

mk90.basic.statements

Statement DIM

Allocate a zero-based integer array.

Syntax

DIM array(upper-bound)

Parameters

ParameterMeaning
arrayOne letter A–Z; independent from its scalar.
upper-boundRuntime integer 0–75, subject to remaining total capacity.

Behavior

DIM A(9) allocates ten zeroed words, indexed 0 through 9. All arrays share 76 elements. An array may be dimensioned once per execution. Out-of-range access, missing DIM, repeated DIM or insufficient capacity returns status 39.

Example

DIM A(3)
FOR I=0 TO 3
A(I)=I*I
NEXT I
PRINT A(3)

Limits and diagnostics

One dimension and one declaration per statement. No REDIM, arrays of strings or implicit allocation.

Status-code reference.

See also

LET · READ · Language syntax

mk90.basic.statements

Statement RANDOMIZE

Set the pseudo-random generator seed.

Syntax

RANDOMIZE expression

Parameters

ParameterMeaning
expression16-bit seed; zero is normalized to one.

Behavior

Repeating the same seed and sequence of RND calls reproduces the same results.

Example

RANDOMIZE 123
PRINT RND(100)
RANDOMIZE 123
PRINT RND(100)

Limits and diagnostics

The expression is mandatory. RANDOMIZE TICKS uses the current OS tick counter.

Status-code reference.

See also

· Language syntax

mk90.basic.statements

Statement DATA

Embed numeric constants for sequential READ.

Syntax

DATA signed-integer [, signed-integer ...]

Parameters

ParameterMeaning
signed-integerA decimal literal with an optional + or - sign.

Behavior

Data is stored inline in the executable. Execution skips it. READ finds DATA in physical source order regardless of branches, including DATA after END.

Example

READ A,B
PRINT A;B
END
DATA -7,42

Limits and diagnostics

Numeric literals only; no expressions, quoted data or empty fields.

Status-code reference.

See also

READ · RESTORE · Language syntax

mk90.basic.statements

Statement READ

Read the next numeric DATA items.

Syntax

READ destination [, destination ...]

Parameters

ParameterMeaning
destinationA scalar or indexed array element.

Behavior

Each destination consumes one item. The data cursor is independent of the execution PC. Exhaustion returns status 40; previously assigned destinations remain assigned.

Example

DIM A(1)
READ A(0),A(1)
PRINT A(1)
END
DATA 12,34

Limits and diagnostics

Arrays must already be dimensioned. This is separate from file GET.

Status-code reference.

See also

DATA · RESTORE · GET · Language syntax

mk90.basic.statements

Statement RESTORE

Rewind READ to the first DATA item.

Syntax

RESTORE

Parameters

No parameters.

Behavior

Does not change variables, arrays or the execution position.

Example

READ A
RESTORE
READ B
END
DATA 7

Limits and diagnostics

No line-number argument in this dialect.

Status-code reference.

See also

DATA · READ · Language syntax

mk90.basic.functions

Function ABS

Absolute value in signed 16-bit arithmetic.

Syntax

ABS(expression)

Returns

Absolute integer value, within the 16-bit representation.

Behavior

Negative values are negated; nonnegative values are retained. The exceptional value −32768 has no positive signed 16-bit representation and remains the bit pattern 8000h (displayed as −32768).

Example

10 PRINT ABS(-7)
20 PRINT ABS(-32768)
30 END

Limits and diagnostics

Standard MBC-16 expression limits apply.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function RND

Return a bounded pseudorandom integer.

Syntax

RND(limit)

Returns

An integer from 0 to limit−1; limit must be 1–32767.

Behavior

The runtime starts from seed 1 for each program invocation. A nonzero 16-bit shift/XOR state is advanced and reduced modulo the positive limit. Re-running a program gives the same sequence.

This is not a real-valued RND function or a cryptographic generator. The range is bounded but no statistical uniformity guarantee is given.

Example

10 FOR I=1 TO 5
20 PRINT RND(6)+1
30 NEXT I
40 END

Limits and diagnostics

RANDOMIZE expression sets the seed reproducibly; seed zero is normalized to one. Nonpositive limits cause status 37.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function TICKS

Read the OS RTC tick counter.

Syntax

TICKS

Returns

The 16-bit tick pattern, displayed as a signed integer when printed.

Behavior

Advances at a nominal 32 ticks per second and wraps modulo 65536. Printed values become negative after bit 15 is set. Modular differences are useful over intervals shorter than 32768 ticks.

Example

10 A=TICKS
20 WAIT 32
30 PRINT TICKS-A
40 END

Limits and diagnostics

No parentheses. This counter is relative to OS initialization, not a date/time epoch or CPU-cycle counter.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function INKEY

Poll one translated keyboard event.

Syntax

INKEY

Returns

Translated character/control code, or 0 when no event is available.

Behavior

Uses the OS nonblocking keyboard path, which also cooperates with the scheduler and display. It exposes events and repeats rather than a matrix of simultaneously held keys.

The runtime separately polls for cancellation every 32 opcodes. Those polls can consume ordinary events before INKEY sees them. Code 3 is also returned by up-arrow and used to cancel the runtime.

Example

10 A=INKEY
20 IF A=0 THEN 10
30 PRINT A
40 END

Limits and diagnostics

No trailing $ and no parentheses. It is not the string-valued INKEY$ found in other BASICs.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function HOUR

Read the RTC hour component.

Syntax

HOUR

Returns

0–23 on a correctly configured RTC.

Behavior

Reads the selected RTC component with bounded update checks and converts its configured BCD/binary representation. HOUR also converts 12-hour mode to 24-hour form.

Separate expressions are separate samples: HOUR, MINUTE and SECOND in one PRINT are not a guaranteed atomic timestamp across a rollover.

Example

10 PRINT HOUR
20 END

Limits and diagnostics

No parentheses or write form. RTC failure returns an OS I/O error.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function MINUTE

Read the RTC minute component.

Syntax

MINUTE

Returns

0–59 on a correctly configured RTC.

Behavior

Reads the selected RTC component with bounded update checks and converts its configured BCD/binary representation. HOUR also converts 12-hour mode to 24-hour form.

Separate expressions are separate samples: HOUR, MINUTE and SECOND in one PRINT are not a guaranteed atomic timestamp across a rollover.

Example

10 PRINT MINUTE
20 END

Limits and diagnostics

No parentheses or write form. RTC failure returns an OS I/O error.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function SECOND

Read the RTC second component.

Syntax

SECOND

Returns

0–59 on a correctly configured RTC.

Behavior

Reads the selected RTC component with bounded update checks and converts its configured BCD/binary representation. HOUR also converts 12-hour mode to 24-hour form.

Separate expressions are separate samples: HOUR, MINUTE and SECOND in one PRINT are not a guaranteed atomic timestamp across a rollover.

Example

10 PRINT SECOND
20 END

Limits and diagnostics

No parentheses or write form. RTC failure returns an OS I/O error.

Status-code reference.

See also

Expressions and precedence · Runtime

mk90.basic.functions

Function EOF

Test the open INPUT data file for end-of-file.

Syntax

EOF

Returns

−1 after its final byte has been consumed, otherwise 0.

Behavior

Considers both unread bytes in the internal cache and the underlying file position. An empty input file reports EOF immediately. EOF does not consume a byte.

It requires a valid INPUT data handle. Use it before GET to avoid reading past the end.

Example

10 OPEN "bytes",INPUT
20 IF EOF THEN 60
30 GET A
40 PRINT A
50 GOTO 20
60 CLOSE
70 END

Limits and diagnostics

No file-number argument or parentheses. An invalid file state gives a data-file or handle error.

Status-code reference.

See also

Expressions and precedence · Runtime

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.
DATADATA signed-integer [, signed-integer ...]Embed numeric constants for sequential READ.
DIMDIM array(upper-bound)Allocate a zero-based integer array.
ELSEELSEBegin the alternative branch of a structured IF.
ENDENDTerminate the program and return to the shell.
ENDIFENDIFClose the innermost structured IF.
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-numberSelect a numbered destination or a structured block.
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.
RANDOMIZERANDOMIZE expressionSet the pseudo-random generator seed.
READREAD destination [, destination ...]Read the next numeric DATA items.
REMREM commentIgnore the rest of a physical source line.
REPEATREPEATStart a loop whose body executes at least once.
RESTORERESTORERewind READ to the first DATA item.
RETURNRETURNResume after the most recent active GOSUB.
SOUNDSOUND divisor, cyclesDrive the buzzer with raw controller parameters.
STOPSTOPTerminate the program and return to the shell.
UNTILUNTIL expressionClose a REPEAT loop and test its exit condition.
WAITWAIT ticksSleep cooperatively for an RTC-tick interval.
WENDWENDClose the innermost WHILE loop.
WHILEWHILE expressionRepeat while a condition is nonzero.

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 is our structured integer BASIC dialect. It provides signed 16-bit scalars and arrays, literal strings, nested control blocks and inline numeric data. It does not claim compatibility with the factory BASIC or a standard BASIC certification. Unsupported syntax is rejected rather than ignored. The factory FK table can insert words which this dialect does not implement.

mk90.basic

Language syntax and expressions

Exact MBC-16 grammar, integer arithmetic and source limits.

Source files and line numbers

A source is a regular file whose suffix is .bas, ignoring case. Use single-byte ASCII syntax with LF or CRLF line endings. CR and tab are skipped as lexical whitespace; CR-only files do not provide statement-line boundaries. An embedded NUL is an error.

A non-empty line may begin with a decimal number from 1 to 65535. Numbers must be strictly increasing in physical source order; the compiler does not sort them. An unnumbered non-empty line receives the preceding number plus one, starting at 1. Empty lines do not consume a line-table entry.

At most 64 non-empty lines, including comment-only lines, can be compiled. Several statements can share a physical line using colons. Branches still target the start of a numbered line.

Core grammar

program       = { source-line LF } [ source-line ]
source-line   = [ line-number ] [ statement { ":" statement } ]
assignment    = [ "LET" ] variable "=" expression
variable      = letter [ "(" expression ")" ]
letter        = "A" | "B" | ... | "Z"
line-number   = decimal-integer       ; 1..65535
string        = DQUOTE { literal-byte } DQUOTE
DQUOTE        = ASCII character 34
primary       = decimal-integer | variable | "(" expression ")"
              | "ABS(" expression ")" | "RND(" expression ")"
              | TICKS | INKEY | HOUR | MINUTE | SECOND | EOF
unary         = primary | ( "+" | "-" | "NOT" ) unary
expression    = unary { binary-operator unary }

This grammar summarizes the common forms; the precedence table and individual statement pages provide the remaining rules. Keywords and A–Z are case-insensitive. Literal strings and pathnames retain their case. No implicit keyword concatenation or multi-letter variable names. IF/ELSE/ENDIF, WHILE/WEND and REPEAT/UNTIL provide multiline structured control; their delimiter rules are on the individual statement pages.

Numeric representation

Variables hold signed 16-bit values, −32768 through 32767, and initialize to zero on every run. Decimal literals may encode 0 through 65535; values with bit 15 set are interpreted as negative when used or printed. A leading sign is a unary operator.

Addition, subtraction and multiplication wrap modulo 65536. Division truncates toward zero. MOD has the dividend’s sign. For example -17/5 is −3 and -17 MOD 5 is −2. Division by zero is status 37.

Comparisons return −1 for true and 0 for false. IF tests any nonzero value as true. AND, OR and NOT are bitwise operators, without short-circuit evaluation. There is no floating point, exponent notation, hexadecimal-literal notation or string arithmetic.

Operator precedence

Binding, high to lowOperatorsNotes
Primary(expression), ABS(expression), RND(expression), valuesParentheses control grouping.
6Unary +, unary -, NOTNOT binds tightly in this dialect; parenthesize a comparison when negating its result.
5* / MODLeft-associative.
4+ -Left-associative.
3= <> < <= > >=Same precedence; evaluated left-associatively.
2ANDBitwise.
1ORBitwise.

Use NOT (A=0) to negate a comparison. NOT A=0 means (NOT A)=0. Chained comparisons are arithmetic combinations of −1/0 results, not mathematical chained inequalities.

Literal strings

Only double-quoted literal strings are available, up to 95 bytes per literal. Empty literals are accepted. There is no escape convention for an embedded quote, no string variable and no concatenation operator; PRINT can place several literals or numeric expressions next to one another.

OPEN requires a literal pathname. Assignment and comparison symbols are available through the V/N prefix; see keyboard punctuation before attempting to type a new listing from scratch.

Control flow details

  • IF supports either THEN followed by a literal line number or a multiline THEN/ELSE/ENDIF block; inline THEN statements are not supported.
  • For legacy IF ... THEN number, following colon statements remain independent. Structured block delimiters occupy their own physical source lines.
  • GOTO/GOSUB targets must exist; destination offsets are resolved at compile time.
  • FOR/NEXT and GOSUB/RETURN share eight LIFO control frames. GOTO does not clean them up.
  • END and STOP both terminate; no resumable stop state exists.
  • A bare PRINT followed by a colon emits a newline.

Compiler and runtime limits

ResourceBound
Scalars26, A–Z.
Arrays26 independent names; 76 signed-word elements in total; zero-based bounds.
Structured nesting16 active blocks.
Forward branches64 per program; ELSE uses an additional slot.
Non-empty source lines64.
Line-number literals1–65535, strictly increasing.
Literal integer0–65535 before unary sign.
Literal string95 bytes.
Expression parser depth12; operators and nesting both contribute.
Operand stack16 values.
FOR/GOSUB stackEight shared frames.
Source editor1,280 bytes; the streaming compiler has a separate line limit.
Data filesOne open in addition to the executable.

Reserved and unsupported forms

Recognized language words are: LET, PRINT, IF, THEN, GOTO, GOSUB, RETURN, FOR, TO, STEP, NEXT, INPUT, END, STOP, REM, CLS, BEEP, WAIT, LOCATE, PSET, PRESET, LINE, SOUND, TICKS, INKEY, ABS, RND, MOD, AND, OR, NOT, OPEN, AS, LEN, GET, PUT, CLOSE, EOF, HOUR, MINUTE, SECOND, PATH, OUTPUT, ELSE, ENDIF, WHILE, WEND, REPEAT, UNTIL, DIM, RANDOMIZE, DATA, READ, RESTORE. Recognition in the scanner does not make every word a usable statement. AS, LEN and PATH are reserved/internal tokens without a supported source form in 0.7.

Outside this dialect: string variables, real numbers, DEF FN, transcendental functions, RUN/LIST/SAVE/LOAD/PLAY as BASIC statements, file-number syntax, append/seek, named procedures and inline IF statements. Use the OS commands to edit, compile and launch files. DATA is numeric; READ accepts scalar or indexed destinations; RESTORE rewinds to the first datum.

mk90.basic

MBC compiler

Two-pass compilation on the MK90 and transactional executable creation.

Invocation and output

mbc program.bas

Takes exactly one pathname, which must end in .bas case-insensitively. Replaces the suffix with lowercase .mbx in the same directory. There is no output-name option. The output component must still fit the filesystem’s 12-character limit.

Copy a ROM source to a writable volume first. Successful compilation reports the output path and executable size, ending with B OK.

Passes

PhaseWork
Pass 1Stream the source; tokenize; parse statements and expressions; count bytes; build up to 64 line-number/offset pairs.
Pass 2Reopen the source; resolve numeric branch targets; emit the 16-byte MBX1 header and bytecode into the exact-length writer.
PublicationValidate source reads, flush output and close the writer. Only a successful close makes the new executable visible.

Expressions become stack operations; branch targets become byte offsets. The result is compiled bytecode, not the original source renamed with another extension.

Workspace and cooperation

The source is buffered in 256-byte blocks. The console TEXT/SHADOW area is temporarily used for scanner data and the target table. The compiler does not render a live screen or poll for keyboard cancellation while those buffers are in use.

It yields between source lines so compatible native workers can run. Parser/common services stay in an upper module while lower compiler phases are exchanged through a stable call gate. PID 0 remains suspended during the command.

Errors and preservation

Syntax and resource errors report BASIC @ line code. Status 32 is syntax, 33 a compiler limit, and 34 a missing branch target. File or ROM failures retain their OS code. On failure, handles are aborted and the console is restored.

The previous executable is preserved when a compile or publication fails. There is no partly compiled executable published under its name. Compilation still needs free contiguous space for the proposed output alongside protected older extents.

Workflow

edit /mnt/smp1/app.bas
mbc /mnt/smp1/app.bas
exec /mnt/smp1/app.mbx

Leave EDIT after saving before entering the compiler command. Compiler input is the saved file, not the editor’s unsaved buffer. Exact syntax · MBX1 format.

mk90.basic

BASIC runtime

Verified executable loading, bounded VM state and system I/O.

Load and initialization

EXEC opens the file, validates the 16-byte MBX1 header, checks its declared length, and reads the complete file through EOF to verify its inode checksum. Only then does it begin bytecode execution.

A–Z are zeroed, control/operand counts reset, and the pseudorandom seed set to 1. The executable reader remains open to keep its extent allocated. Source text is not retained or reparsed.

Bytecode execution

The VM fetches through a 256-byte cache. It checks fetch bounds, opcode range, variable indexes, branch bounds, operands and control stack. Multi-byte bytecode operands are decoded bytewise, so unaligned byte offsets are allowed.

The upper native module contains dispatch, fetch, arithmetic and control flow. Lower phases implement devices, graphics and files. Every phase completes in the upper dispatcher before a replacement module is loaded. Native dispatch pointers are part of the verified firmware, not supplied by the MBX program.

These are bounded runtime checks, not complete static proof of arbitrary bytecode. Branch range checking does not prove that a manually crafted target is an instruction boundary. Use executables produced by the matching compiler.

Scheduling and cancellation

The VM is the foreground PID 3. It checks keyboard and yields every 32 opcodes; WAIT and INPUT also cooperate. Native COUNT/PULSE workers can continue. The shell does not accept another command until the VM ends.

SU+C ends a loop at the next cancellation check, recording result 130 without printing a normal BASIC error banner. Up-arrow has the same translated code. A long WAIT or bounded I/O operation can delay the next check. The cancellation poll may consume other keys, so INKEY should not be treated as a lossless event queue.

Display, sound and RTC

PRINT/LOCATE use the text console. PSET/PRESET/LINE update individual framebuffer bits; CLS clears all pixels and the text state. Text rendering can subsequently replace graphics in its glyph area.

BEEP uses the standard tone; SOUND supplies raw divisor/cycle values. WAIT and TICKS use nominal RTC ticks, not emulator instruction counts. HOUR/MINUTE/SECOND read RTC components independently. No UART is exposed to BASIC.

Files and cache ownership

One data handle is available in addition to the executable reader. OPEN resolves ordinary MKS2 paths; GET/PUT buffer individual bytes into sector operations. Output has a declared final length and is published only on successful CLOSE or END.

The VM’s bytecode cache uses VERIFY. File calls which can change that scratch buffer invalidate the cache before another instruction fetch. TMP remains available to the data file. Device reads use the registered block abstraction with the executable’s pinned extent; BASIC has no raw sector-write instruction.

End and cleanup

END/STOP closes the data handle, committing only complete output. Runtime errors and SU+C abort an unpublished writer, release handles and restore the shell continuation. Files already closed successfully remain saved. An incomplete automatic close is reported as a failure, not silent success.

There is only one VM instance, no BASIC background launch, no pipe integration and no shared variable state between executions.

mk90.basic

MBX1 executable format

The file header and opcode encoding for bytecode ABI 2, with ABI 1 execution support.

Header

Byte offsetLengthValue
04ASCII MBX1.
42Bytecode ABI: 2 for new output; EXEC also accepts 1.
62Flags, 0.
82Total file size, including header.
102Variable count, 26.
122Operand-stack limit, 16.
142Reserved, 0.

Words are little-endian. The minimum accepted executable length is 17 bytes: the header and at least an instruction byte. The file-data checksum is the MKS2 inode checksum, not a field in this header. The entire file is checked before execution.

Encoding

Each opcode is one byte. Variable operands are zero-based, A=0 through Z=25. Immediate word operands and branch offsets are little-endian. Branch offsets count from the start of the file, so executable targets must be at least 16 and less than the total size.

LINE is an internal source-line marker used for error reporting; the source-language drawing LINE compiles to DRAW. KEY implements INKEY. STRING and PATH carry a length byte followed by data. All other opcodes have no inline operand unless listed below; their arguments come from the operand stack.

Opcode index

DecimalHexMnemonicInline operand
000ENDNone
101LINEu16 source-line marker
202CONSTu16 bit pattern
303LOADu8 variable index
404STOREu8 variable index
505ADDNone
606SUBNone
707MULNone
808DIVNone
909MODNone
100ANEGNone
110BEQNone
120CNENone
130DLTNone
140ELENone
150FGTNone
1610GENone
1711ANDNone
1812ORNone
1913NOTNone
2014PRINTNone
2115STRINGu8 length, then literal bytes
2216NLNone
2317JMPu16 byte offset
2418JNZu16 byte offset
2519CALLu16 byte offset
261ARETNone
271BFORu8 variable index
281CNEXTu8 variable index
291DINPUTu8 variable index
301ECLSNone
311FBEEPNone
3220WAITNone
3321LOCATENone
3422PSETNone
3523PRESETNone
3624DRAWNone
3725SOUNDNone
3826TICKSNone
3927KEYNone
4028ABSNone
4129RNDNone
422AOPENRNone
432BOPENWNone
442CGETu8 variable index
452DPUTNone
462ECLOSENone
472FEOFNone
4830HOURNone
4931MINUTENone
5032SECONDNone
5133PATHu8 length, then pathname bytes
5234AINITNone
5335DIMu8 array index
5436ALOADu8 array index
5537ASTOREu8 array index
5638RANDOMIZENone
5739DATUMu16 literal bit pattern
583AREADNone
593BRESTORENone

Compatibility

MBX1 is a format for this VM. It is not ELF, PDP-11 a.out, a native instruction stream or a tokenized factory-BASIC cartridge. Header and bounds validation do not establish full semantic validity for manually edited bytecode. New MBC output uses ABI 2 and begins with AINIT. Opcodes 0–51 retain their ABI 1 numbers; the new opcodes are appended. The older EXEC cannot run ABI 2. Another device must implement all opcode and device semantics it advertises. Use MBC from the matching release.

mk90.basic

Example programs

Complete listings for arithmetic, control flow, files, display and timing.

Using the examples

The HTML package includes eight complete ASCII BAS files under examples/. They illustrate the supported dialect and may be compiled once present on a writable MKS2 volume. The manual archive itself is not an SMP filesystem image.

The boot ROM includes its own demo.bas, so the first trial needs no file-transfer utility. For entering operators directly on the MK90, see keyboard punctuation. This release does not have a UART transfer command.

Count and beep

Download hello.bas

10 CLS
20 FOR I=1 TO 5
30 PRINT "MK90 ";I
40 BEEP
50 WAIT 8
60 NEXT I
70 END

Arithmetic and a subroutine

Download math.bas

10 A=2+3*4
20 B=-17/5
30 C=-17 MOD 5
40 PRINT A;",";B;",";C
50 GOSUB 80
60 PRINT A
70 END
80 A=A+1
90 RETURN

Write and read three bytes

Download files.bas

10 OPEN "letters",OUTPUT,3
20 PUT 65:PUT 66:PUT 67
30 CLOSE
40 OPEN "letters",INPUT
50 IF EOF THEN 90
60 GET A
70 PRINT A
80 GOTO 50
90 CLOSE
100 END

Graphics and the RTC

Download screen.bas

10 CLS
20 LINE 0,12,119,12
30 LOCATE 0,0
40 PRINT "TIME ";HOUR;":";MINUTE;":";SECOND
50 PSET 60,40
60 WAIT 16
70 PRESET 60,40
80 BEEP
90 END

Nested loops and conditional branching

Download loops.bas

10 A=0
20 FOR I=1 TO 3
30 FOR J=2 TO 1 STEP -1
40 A=A+I*J
50 NEXT J
60 NEXT I
70 IF A=18 THEN 100
80 PRINT "UNEXPECTED"
90 END
100 PRINT "TOTAL ";A
110 END

Structured selection and loops

Download blocks.bas

A=0
B=0
WHILE A<5
A=A+1
IF A MOD 2 THEN
B=B+A
ELSE
B=B+10
ENDIF
WEND
PRINT "TOTAL ";B
END

Array input from DATA

Download arrays.bas

DIM A(2)
READ A(0),A(1),A(2)
B=0
FOR I=0 TO 2
B=B+A(I)
NEXT I
PRINT "SUM ";B
END
DATA 10,20,30

Post-test loop and repeatable random numbers

Download repeat.bas

A=0
REPEAT
A=A+1
UNTIL A=3
RANDOMIZE 123
B=RND(100)
RANDOMIZE 123
C=RND(100)
IF B=C THEN
PRINT "REPEATABLE ";A
ENDIF
END

Expected results

ExampleResult
blocks.basPrints TOTAL 29.
arrays.basPrints SUM 60.
repeat.basPrints REPEATABLE 3.
hello.basFive MK90 lines and five short beeps.
math.bas14,-3,-2 followed by 15.
files.basCreates/replaces letters with bytes 65, 66, 67; reads and prints them.
screen.basDraws a line, displays RTC components, briefly lights a pixel and beeps.
loops.basPrints TOTAL 18.
mk90.guide

User guide

Installation, everyday operation, storage, keyboard and diagnostics.

Guide chapters

ChapterDescription
Devices and expansionPhysical slot identity and the boundary of current driver support.
Diagnostics and status codesExact message text, return codes and practical interpretation.
Text editorNamed and unnamed buffers, movement, saving and BASIC insertion.
MKS2 filesystemVolumes, directories, names, allocation and verified publication.
Getting startedFrom the 27C256 image to your first compiled BASIC program.
Keyboard referenceSequential prefixes, translated key codes and all FK expansions.
Limits and compatibilityA compact boundary reference for release 0.7.
Shell syntaxThe actual command-line parser and dispatch rules.
mk90.system

System reference

The implemented execution, IPC, storage and memory architecture.

System chapters

ChapterDescription
MKS2 on-media formatThe partition header, mirrored directory records and file extents.
Memory and application loadingBuild-specific layout of the 16 KiB RAM and the 32 KiB cartridge.
MultiprogrammingFour fixed context slots with cooperative scheduling and explicit ownership.
Pipes and interprocess communicationOne blocking byte FIFO connecting two independently scheduled contexts.
Index

All commands

Every registered command in alphabetical order.

Commands

NameDescription
beepEmit a short tone through the internal buzzer.
catWrite file bytes to standard output.
cdChange the shell’s current directory.
clearClear the text console and reset its cursor.
cpCopy one regular file, including between volumes.
dateRead the RTC date as YY-MM-DD.
devicesList configured block-device slots and access flags.
echoWrite up to three argument tokens to standard output.
editOpen the text editor, with BASIC macros for .bas files.
execExecute a compiled MBX1 BASIC program.
helpList command names or display the compact guide for one command.
killMark background slot 1 or 2 as finished.
lessView text one eight-row page at a time.
lsList a directory or describe one regular file.
mbcCompile an MBC-16 BASIC source file on the MK90.
memDisplay the configured RAM, ROM and editor limits.
mkdirCreate one directory on a mounted writable MKS2 volume.
mkfsInitialize one supported-size writable cartridge as MKS2.
mountList mounted volumes or mount an MKS2 volume.
mvMove or rename one regular file.
pipeDisplay the compact pipeline usage guide.
psDisplay task slots, states, names and application counters.
pwdPrint the normalized absolute current directory.
rmDelete one regular file.
rmdirRemove an empty directory.
romtestCheck the full boot ROM and repeated cartridge switching.
runStart one of the two built-in background worker types.
sleepSuspend the foreground command while other tasks continue.
timeRead the RTC time as HH:MM:SS.
uartDisplay the UART configuration placeholder.
umountClear a volume’s mounted state.
unameDisplay the operating-system name and version.
waitWait for one allocated background slot to finish.
Index

Documentation hierarchy

Packages and pages in the linked HTML reference.

Hierarchy

Help

How to use this manual

Navigation, search, syntax conventions and offline use.

Navigation

The top bar switches between the overview, commands, system chapters, BASIC and native API. The left pane groups reference pages by package. The right pane lists sections on the current page. Previous/next links step through the reference pages.

The hierarchy shows all packages; the alphabetical index includes pages and native API routine names. Every command and BASIC statement has its own linked reference page, following a Javadoc-style organization.

The search field searches page titles, summaries, keywords, sections and native API routine entries. Press the slash key to focus it, or Escape to dismiss its results. Results are links; the page remains usable if JavaScript is disabled.

Search is local to this manual. It does not contact a service or search files on the MK90.

Notation

NotationMeaning
[argument]Optional syntax; do not type the brackets.
count|pulse in a synopsisAlternatives: select one. An actual | in a shell command line is the pipeline operator.
expressionAn MBC-16 integer expression, not a literal word to type.
SU, then SSequential key presses.
0x1234 or memory-map rangesHexadecimal byte addresses. Other numeric limits are decimal unless marked.
Status code linksJump to the shared diagnostic explanation.

Offline use and printing

Extract the HTML archive while retaining its directory structure and open index.html in a browser. All styles, scripts and search records are local; no web server, Java installation or internet connection is required.

Print any page with the browser’s print command. Navigation and search controls are omitted from print. The optional single-file edition contains the same reference text with internal links and embedded assets.

Documentation version

This manual describes the 0.7 binary identified by its SHA-256 on the validation page. It documents implemented behavior rather than proposed future capabilities. Copyright and release policy.

Index

Alphabetical index

Commands, BASIC syntax, system topics and native API routines.

Letters

A · B · C · D · E · F · G · H · I · K · L · M · N · O · P · R · S · T · U · W

A

EntryReference
Function ABSAbsolute value in signed 16-bit arithmetic.

B

EntryReference
BASIC runtimeVerified executable loading, bounded VM state and system I/O.
Command beepEmit a short tone through the internal buzzer.
Statement BEEPPlay the standard short buzzer tone.
Block-device serviceThe build-specific interface between storage and registered device drivers.
block_ioNative service · Block-device service

C

EntryReference
Command catWrite file bytes to standard output.
Command cdChange the shell’s current directory.
Command clearClear the text console and reset its cursor.
Statement CLOSEClose the currently open data file.
Statement CLSClear the complete LCD framebuffer and text console.
Copyright and distributionProprietary freeware binaries; private operating-system source code.
Command cpCopy one regular file, including between volumes.

D

EntryReference
Statement DATAEmbed numeric constants for sequential READ.
Command dateRead the RTC date as YY-MM-DD.
Command devicesList configured block-device slots and access flags.
Devices and expansionPhysical slot identity and the boundary of current driver support.
Diagnostics and status codesExact message text, return codes and practical interpretation.
Statement DIMAllocate a zero-based integer array.

E

EntryReference
Command echoWrite up to three argument tokens to standard output.
Command editOpen the text editor, with BASIC macros for .bas files.
Statement ELSEBegin the alternative branch of a structured IF.
Statement ENDTerminate the program and return to the shell.
Statement ENDIFClose the innermost structured IF.
Function EOFTest the open INPUT data file for end-of-file.
Example programsComplete listings for arithmetic, control flow, files, display and timing.
Command execExecute a compiled MBX1 BASIC program.

F

EntryReference
File servicesOwned, sector-oriented access to regular MKS2 files.
file_abortNative service · File services
file_closeNative service · File services
file_openNative service · File services
file_readNative service · File services
file_writeNative service · File services
Statement FORStart a counted integer loop.

G

EntryReference
Statement GETRead one byte from the open INPUT file.
Getting startedFrom the 27C256 image to your first compiled BASIC program.
Statement GOSUBCall a numbered subroutine.
Statement GOTOContinue execution at a numbered source line.

H

EntryReference
Command helpList command names or display the compact guide for one command.
Function HOURRead the RTC hour component.

I

EntryReference
Statement IFSelect a numbered destination or a structured block.
Function INKEYPoll one translated keyboard event.
Statement INPUTRead one signed decimal integer from the keyboard.

K

EntryReference
Keyboard referenceSequential prefixes, translated key codes and all FK expansions.
Command killMark background slot 1 or 2 as finished.

L

EntryReference
Language syntax and expressionsExact MBC-16 grammar, integer arithmetic and source limits.
Command lessView text one eight-row page at a time.
Statement LETAssign an integer to one variable.
Limits and compatibilityA compact boundary reference for release 0.7.
Statement LINEDraw a monochrome segment between two pixel coordinates.
Statement LOCATESet the text cursor position.
Command lsList a directory or describe one regular file.

M

EntryReference
Command mbcCompile an MBC-16 BASIC source file on the MK90.
MBC compilerTwo-pass compilation on the MK90 and transactional executable creation.
MBC-16 BASIC referenceThe complete implemented integer dialect, without assuming factory-BASIC compatibility.
MBX1 executable formatThe file header and opcode encoding for bytecode ABI 2, with ABI 1 execution support.
Command memDisplay the configured RAM, ROM and editor limits.
Memory and application loadingBuild-specific layout of the 16 KiB RAM and the 32 KiB cartridge.
Function MINUTERead the RTC minute component.
MK90/Unix 0.7User and system reference for the Elektronika MK90.
Command mkdirCreate one directory on a mounted writable MKS2 volume.
Command mkfsInitialize one supported-size writable cartridge as MKS2.
MKS2 filesystemVolumes, directories, names, allocation and verified publication.
MKS2 on-media formatThe partition header, mirrored directory records and file extents.
Command mountList mounted volumes or mount an MKS2 volume.
MultiprogrammingFour fixed context slots with cooperative scheduling and explicit ownership.
Command mvMove or rename one regular file.

N

EntryReference
Native API referenceCalling contracts for the services used by built-in native applications.
Statement NEXTAdvance and test the innermost active FOR loop.

O

EntryReference
Statement OPENOpen the program’s one regular data file.

P

EntryReference
Command pipeDisplay the compact pipeline usage guide.
Pipe servicesDispatcher-bound endpoints of the single RAM byte FIFO.
pipe_close_readNative service · Pipe services
pipe_close_writeNative service · Pipe services
pipe_readNative service · Pipe services
pipe_writeNative service · Pipe services
Pipes and interprocess communicationOne blocking byte FIFO connecting two independently scheduled contexts.
Statement PRESETTurn off one LCD pixel.
Statement PRINTPrint literal text and integer expressions.
Command psDisplay task slots, states, names and application counters.
Statement PSETTurn on one LCD pixel.
Statement PUTWrite one byte to the open OUTPUT file.
Command pwdPrint the normalized absolute current directory.

R

EntryReference
Statement RANDOMIZESet the pseudo-random generator seed.
Statement READRead the next numeric DATA items.
Command referenceAll 33 registered shell commands in MK90/Unix 0.7.
Statement REMIgnore the rest of a physical source line.
Statement REPEATStart a loop whose body executes at least once.
Statement RESTORERewind READ to the first DATA item.
Statement RETURNResume after the most recent active GOSUB.
Command rmDelete one regular file.
Command rmdirRemove an empty directory.
Function RNDReturn a bounded pseudorandom integer.
Command romtestCheck the full boot ROM and repeated cartridge switching.
Command runStart one of the two built-in background worker types.

S

EntryReference
Function SECONDRead the RTC second component.
Shell syntaxThe actual command-line parser and dispatch rules.
Command sleepSuspend the foreground command while other tasks continue.
Statement SOUNDDrive the buzzer with raw controller parameters.
Statement STOPTerminate the program and return to the shell.
System referenceThe implemented execution, IPC, storage and memory architecture.

T

EntryReference
Task servicesCooperative task routines for resident workers and the registered pipe consumer.
task_beepNative service · Task services
task_dataNative service · Task services
task_exitNative service · Task services
task_selfNative service · Task services
task_sleepNative service · Task services
task_spawnNative service · Task services
task_yieldNative service · Task services
Text editorNamed and unnamed buffers, movement, saving and BASIC insertion.
Function TICKSRead the OS RTC tick counter.
Command timeRead the RTC time as HH:MM:SS.

U

EntryReference
Command uartDisplay the UART configuration placeholder.
Command umountClear a volume’s mounted state.
Command unameDisplay the operating-system name and version.
Statement UNTILClose a REPEAT loop and test its exit condition.
User guideInstallation, everyday operation, storage, keyboard and diagnostics.

W

EntryReference
Command waitWait for one allocated background slot to finish.
Statement WAITSleep cooperatively for an RTC-tick interval.
Statement WENDClose the innermost WHILE loop.
Statement WHILERepeat while a condition is nonzero.