LGP-21 DevKitVS Code language extension for the LGP-21 drum-memory computer (1963). Provides a full language server for FeaturesSyntax HighlightingTokens are coloured by category: instructions, directives, labels, addresses, string literals, comments, and numeric literals DiagnosticsReal-time error detection for:
Hover DocumentationHover over any token for inline documentation:
Navigation
Document OutlineOpen the Outline panel to see all labels in the file as a navigable symbol tree Auto format source codeAuto foramtting is enabled for lgp21 files. The formatter align labels, instructions and comments for readibility Commands
Language Reference
String Escapes (inside
|
| Escape | Meaning |
|---|---|
{tf} |
Feed the paper tape without input |
{uc} |
Shift to upper case |
{lc} |
Shift to lower case |
{cs} |
Color shift between black and red ribbon |
{cr} |
Carriage return |
{bs} |
Backspace |
{tb} |
Tab |
Compiler
Compile the active .lgp21 file.
The compiler validates the source and, if there are no errors, writes four output files alongside the source:
| File | Contents |
|---|---|
.bin |
Raw binary image as 32-bit big-endian words |
.hex |
LGP-21 hex notation (digits 0–9 F G J K Q W), 8 words per line |
.json |
Memory file for use with Paul Kimpel's emulator |
.info |
Human-readable assembly report: symbol table, numeric literal analysis, and a per-track memory map |
The compiler provides warnings and errors the way as the real-time diagnostic does.
Features
- While programmer can use explicit {uc}/{lc} escapes the compiler will automatically apply them based on the character to print, if none provided
- Build command (default to Ctrl+Shift+B) is active only if lgp21 file is opened, but that case it is the default - no task selection needed
- Numeric literals will accept a q value in the form of @q at the end of the literal (for convenience default q value can be set using .Q directive). About the q value read more in the Programming Manual
- Code can add literal index to labels in the form of array like syntax - label[4]
Requirements
VS Code 1.120 or later.