This document summarizes the additions and differences between the original LCC instruction set and the LCC+ extension (see src/plus/ and plusdemos/ in repository at https://github.com/avidrucker/lccjs).
| Mnemonic | Binary Format | Flags Set | Description |
|---|---|---|---|
| rand | 1010 dr sr1 0 01110 | none | Generate pseudo-random number in range [dr, sr1] and store in dr |
The following TRAP instructions use trap vectors from 0x000F and up:
| Mnemonic | Trap Vector | Flags Set | Description |
|---|---|---|---|
| clear | 0x000F | none | Clears the terminal screen |
| sleep | 0x0010 | none | Pauses execution for r[dr] milliseconds |
| nbain | 0x0011 | none | Non-blocking ASCII input (returns ASCII code in dr, or 0 if no input available) |
| cursor | 0x0012 | none | Shows or hides cursor based on value in dr (0 = hide, else = show) |
| srand | 0x0013 | none | Seeds RNG using value in sr |
| millis | 0x0014 | none | Puts current system time milliseconds (0–999) into dr |
| resetc | 0x0015 | none | Resets cursor position to top-left of screen |
| Directive | Description |
|---|---|
.lccplus |
Marks the file as an LCC+ file. Required for LCC+ assembly. Triggers special output header format ('p'). |
-
File extensions: LCC+ source files must end in
.ap; compiled output will be.ep. -
Header Signature: LCC+
.epfiles must begin with'op'header (not'o'). -
Breakpoint (
bp): Trap vector0x000Eis supported as in LCC, but enhanced in LCC+ to allow "press any key to resume" functionality. -
rand instruction:
- Generates a number in an inclusive range between the values in
drandsr1. - Uses a pseudo-random number generator based on a seeded Linear Congruential Generator (LCG) + XOR shift.
- Generates a number in an inclusive range between the values in