Command exec
Execute a compiled MBX1 BASIC program.
Synopsis
exec program.mbx
./program.mbxOrdinary invocation: foreground child, PID 3; the shell waits. Not an allowed pipe producer.
Parameters
| Parameter | Meaning |
|---|---|
program.mbx | Path 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.mbxLimits 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, 130. See the diagnostic reference.
See also
mbc · run · edit · Shell syntax