Micro-Abstract
The eCASM™ Developer Manual defines the full instruction-set semantics, operational schema, syntax patterns, and deterministic compilation flow for the CASM language family. It is designed as a precise, engineering-grade reference for students, researchers, and developers working in quantum-adjacent, symbolic logic, and experimental computing environments.
CASM stands for Concise Assembly System Model, and eCASM stands for Extended Concise Assembly System Model. These definitions provide the formal foundation of the instruction set and the compilation semantics used throughout this manual.
Table of Contents
- Introduction
- Access and Usage
- Language Design and Syntax Overview
- The eCASM Operational Schema (v1.0)
- Classical Interoperation
- Compiler Output and Emitter Behavior
- Error Handling and Debugging (Guide)
- Compilation Flow
- Advanced Usage and Roadmap
- Domain Examples
- Error Handling and Debugging (Reference)
- Troubleshooting Guide
- Licensing and Support
- Appendices (Glossary, Errors, Index)
📘 eCASM Foundations — Formal Algebra
The mathematical foundation of the eCASM instruction set is defined in the eCASM Algebra (Extended Edition v1). It introduces the structural semantics behind the four-opcode system and the principles that unify program formation and deterministic logic interpretation.
1 · Introduction
eCASM™ is a browser-based compiler that translates concise quantum-style assembly programs into executable, human-readable output. It provides researchers, students, and engineers with a minimal environment for exploring logic flow, instruction structure, and digital-state reasoning — all without simulation stacks or hardware dependencies.
Important: eCASM™ is not a quantum simulator. It does not model amplitudes, probabilities, coherence, or hardware effects. Instead, it verifies the structural correctness of programs: opcode sequencing, control flow, measurement placement, and semantic consistency.
CASM™ (“chasm”) stands for Concise Assembly System Model, a four-opcode instruction language designed for clarity, transparency, and deterministic verification.
Key Highlights
- Compact four-opcode instruction set
- Instant, in-browser compilation
- Deterministic logic verification
- Emitter panel for step-by-step execution
- Applicable across physics, economics, biology, robotics, and finance
2 · Access and Usage
Getting Started
- Visit the eCASM Compiler homepage
- Paste your CASM code into the editor
- Click Compile
- Review the Emitter Trace and Output Panels
License System
- Free users: five compiles per day
- Licensed users: unlimited compiles
- Keys delivered instantly via Square Checkout
Interface Overview
- Code Editor Panel — input CASM instructions
- Opcode Shortcuts — X, H, CX, MEASURE
- Emitter Output Panel — step-by-step execution
- Toolbar — Load Demo, Clear, Copy Output, Download
3 · Language Design and Syntax Overview
eCASM uses a compact assembly-like syntax: one operation per line.
Core Opcodes
X Bit flip H Superposition (Hadamard) CX Controlled operation MEASURE Observation into classical bit
Syntax Rules
- Qubits: Q0–Qn
- Classical bits: C0–Cn
- Opcodes uppercase only
- Comma-separated arguments
- Comments begin with
#
Example
H Q0 CX Q0, Q1 MEASURE Q1 -> C0
4 · The eCASM Operational Schema (v1.0)
4.1 · Opcodes (Four-Opcode Instruction Set)
Q0 — WORLD
Initializes or references a world container.
XQ0
Q1 — TRANSPORT
Moves or hands off symbolic values between world references.
ABC Q0 T Q1
Q2 — COMPARE
Binary comparison or interaction between world references.
cxz Q0, Q1
Q3 — TRANSFORM (Universal / T-Gate)
Applies a universal transformation to a world reference.
T Q1
4.2 · Symbols
- Identifiers: X, ABC, cxz
- World references: Q0, Q1
- Comma: separates arguments
- Whitespace: token delimiter
4.3 · Labels
Labels must be unique and declared using a colon-prefixed syntax.
:Lstart :Lend
- Illegal: redefining an existing label
- Required: referenced labels must exist
4.4 · Error Messages
Syntax Errors
- ERROR: Invalid opcode
- ERROR: Wrong number of arguments
- ERROR: Unexpected comma
- ERROR: Illegal character
Label Errors
- ERROR: Undefined label
- ERROR: Duplicate label
Semantic Errors
- ERROR: World mismatch (Q0/Q1 conflict)
- ERROR: Invalid compare signature
- ERROR: Illegal transform target
Emit Errors
- ERROR: Emit failure
- ERROR: Dangling reference
4.5 · Diagnostics
- WARNING: Unused label
- WARNING: Redundant instruction
- WARNING: No-op transform
4.6 · Program Shape (Canonical Form)
:Lstart XQ0 ABC Q0 cxz Q0, Q1 T Q1 :Lend
4.7 · Emit Format
- One output instruction per line
- Deterministic mapping from CASM instructions to machine code
- Optional metadata header
5 · Classical Interoperation
Conditional Flow
MEASURE Q0 -> C0 IF C0 == 1 GOTO END X Q1 LABEL END
Labels and Loops
LABEL START H Q0 MEASURE Q0 -> C0 IF C0 == 1 GOTO START
Hybrid Example
H Q0 MEASURE Q0 -> C0 IF C0 == 0 GOTO CONTINUE X Q1 LABEL CONTINUE MEASURE Q1 -> C1
6 · Compiler Output and Emitter Behavior
The compiler translates each instruction into a structured internal representation
and produces a human-readable .ecasm file.
Compilation Sequence
- Parse — validate syntax
- Execute — apply operations
- Emit — produce
.ecasmoutput
Example Compilation
Input: H Q0 CX Q0, Q1 MEASURE Q0 -> C0 Output Summary: Instruction Count: 3 1. H applied to Q0 2. CX applied to Q0, Q1 3. MEASURE stored Q0 → C0 Final Registers: Q0: |0⟩ Q1: |1⟩ C0: 1
Emitter Trace Example
[Emitter Trace] LINE 1 → H Q0 LINE 2 → CX Q0, Q1 LINE 3 → MEASURE Q0 → C0 [OK] Program completed successfully.
7 · Error Handling and Debugging (Guide)
Real-Time Checks
XQ0 → [Error] Missing space between opcode and register
Case Sensitivity
cx Q0, Q1 → [Error] Unknown opcode 'cx'
Label Validation
IF C0 == 1 GOTO LOOP → [Error] Undefined label: LOOP
Diagnostics
[Warning] Label 'END' declared but never used [Notice] No measurement instructions detected
8 · Compilation Flow
Stages
Parse → Execute → Emit
Flow Diagram
Source Code → Parser → Executor → Emitter → Output
Example Run
H Q0 CX Q0, Q1 MEASURE Q0 -> C0 → Parse ✓ Execute ✓ Emit ✓
Behind the Scenes
- Single-pass interpreter
- No intermediate files
- State resets per run
Emitter Internals
Line 1 → H Q0 Line 2 → CX Q0, Q1 Line 3 → MEASURE Q0 → C0 [OK] Program completed successfully
9 · Advanced Usage and Roadmap
9.1 · Macros and Reusable Blocks (planned)
DEFINE INIT_STATE H Q0 CX Q0, Q1 END CALL INIT_STATE MEASURE Q1 -> C0
9.2 · Conditional and Iterative Patterns
Future versions will add structured IF / ELSE and LOOP constructs while maintaining backward compatibility with the v1 instruction set.
9.3 · Extended Opcode Set (future)
RESET – Reinitialize a qubit or register RZ – Phase rotation CCX – Toffoli gate
9.4 · Licensing API and Automation
A planned secure endpoint will allow batch compilation for coursework, research labs, automated workflows, and enterprise automation.
9.5 · File and Session Persistence
Upcoming versions will include in-browser file storage and timestamped archives.
9.6 · Roadmap Summary
- Minimal but expressive opcode expansion
- Macro system with deterministic transformation
- API-level batch compilation
- Instructor dashboards for academic deployment
10 · Domain Examples
Cross-domain demonstrations of eCASM™ in physics, economics, biology, robotics, game theory, finance, and cryptography.
10.1 · Physics
H Q0 MEASURE Q0 → C0
Illustrates a basic quantum tunneling or bifurcation test.
H Q0 H Q1 CX Q0, Q1 MEASURE Q0 → C0 MEASURE Q1 → C1
Shows constructive/destructive interference patterns.
10.2 · Economics
H Q0 MEASURE Q0 → C0
Represents a binary market decision point.
H Q0 MEASURE Q0 → C0 IF C0 == 1 GOTO ADJUST X Q1 LABEL ADJUST MEASURE Q1 → C1
Demonstrates policy adjustment logic under uncertainty.
10.3 · Biology
X Q0 MEASURE Q0 → C0
Illustrates a gene activation toggle.
H Q0 MEASURE Q0 → C0 IF C0 == 0 GOTO SURVIVE X Q1 LABEL SURVIVE MEASURE Q1 → C1
Models a simple biological survival response.
10.4 · Robotics
H Q0 MEASURE Q0 → C0
Represents a probabilistic starting state.
H Q0 MEASURE Q0 → C0 IF C0 == 1 GOTO REVERSE X Q1 LABEL REVERSE MEASURE Q1 → C1
Implements a reversible sensor-triggered control loop.
10.5 · Game Theory
H Q0 MEASURE Q0 → C0
Coin-flip game or randomized strategy selection.
H Q0 CX Q0, Q1 MEASURE Q1 → C1
Illustrates strategic coupling between agents.
10.6 · Cryptography
X Q0 CX Q0, Q1 MEASURE Q1 → C1
Shared-bit generation mechanism.
10.7 · Finance
H Q0 MEASURE Q0 → C0
Illustrates option expiry or probabilistic market close.
11 · Error Handling and Debugging (Reference)
11.1 · Diagnostic Categories
- Errors: compilation stops; instruction stream invalid
- Warnings: potential issues; compilation proceeds
- Notices: informational output
11.2 · Errors (Fatal Conditions)
E001 — Malformed or Missing Spacing
Message: [Error] Missing space between opcode and register
XQ0
Fix: Insert a space → X Q0
E002 — Unknown Opcode
Message: [Error] Unknown opcode 'cx'
cx Q0, Q1
Fix: Use uppercase → CX Q0, Q1
E003 — Undefined Label
Message: [Error] Undefined label: LOOP
IF C0 == 1 GOTO LOOP
Fix: Declare the label → LABEL LOOP
11.3 · Warnings
W001 — Label Declared but Never Used
[Warning] Label 'END' declared but never used
11.4 · Notices
N001 — No Measurement Instructions
[Notice] No measurement instructions detected
11.5 · Summary Table
| Code | Type | Description |
|---|---|---|
| E001 | Error | Malformed spacing |
| E002 | Error | Unknown opcode |
| E003 | Error | Undefined label |
| W001 | Warning | Unused label |
| N001 | Notice | No measurement operations present |
12 · Troubleshooting Guide
Program Fails to Compile: Usually spacing or invalid opcode.
Opcode Not Recognized: Ensure uppercase.
GOTO Not Working: Referenced label missing or misspelled.
Label Never Used: Remove or correct.
No Classical Output: Add MEASURE instruction.
Daily Limit Reached: Free tier exceeded.
13 · Licensing and Support
13.1 · Free Trial
- Five compiles per day
- Full feature access
- Resets nightly at midnight ET
13.2 · Licensed Access
- Unlimited compiles
- 365-day validity
- Instant activation via Register License modal
13.3 · Billing Support Only
AAD Systems™ provides billing assistance only. No technical support.
13.4 · Contact
Email: info@aadsystems.com
Website: https://aadsystems.com
13.5 · Future Features
- Academic multi-seat licenses
- API automation
- Enterprise dashboards
Appendices
The following appendices provide reference material supporting the eCASM™ Compiler, including terminology definitions, consolidated diagnostics, and an index for quick navigation.
Appendix A · Glossary
A.1 · Core Language Concepts
This glossary defines terms as used specifically within the eCASM™ Compiler and its associated algebra. Definitions may differ from conventional usage in programming languages or quantum computing literature.
Opcode
A symbolic instruction representing a primitive operation in the eCASM instruction set
(e.g., X, H, CX, MEASURE).
Operand
An argument supplied to an opcode, identifying a target register or value
(e.g., Q0, C1).
Instruction
A single executable line consisting of an opcode and zero or more operands.
A.2 · Registers and Worlds
Quantum Register (Q)
A symbolic register representing a quantum state or control target within the eCASM execution model.
Classical Interoperation (C)
A symbolic register storing classical measurement outcomes.
World
A contextual execution domain distinguishing quantum and classical state spaces.
A.3 · Control Flow and Structure
Label
A symbolic marker defining a location within the instruction stream that may be referenced by control-flow instructions.
GOTO
A control instruction that transfers execution to a named label based on a conditional or unconditional jump.
Conditional Branch
A control structure that alters execution flow based on the value stored in a classical register.
Dangling Reference
A reference to a label or symbolic target that has not been defined within the program.
(See definitions in Section A below.)
Appendix B · Error and Warning Codes
This appendix consolidates all compiler diagnostics emitted by the eCASM™ Compiler. Each code corresponds to a deterministic validation or execution failure detected during the parse, execute, or emit stages.
B.1 · Errors (Fatal)
| Code | Description | Typical Cause |
|---|---|---|
| E001 | Invalid opcode | Opcode not in the supported instruction set |
| E002 | Wrong number of arguments | Opcode arity mismatch |
| E003 | Unexpected comma | Malformed argument separation |
| E004 | Illegal character | Non-ASCII or invalid token detected |
| E005 | Undefined label | Referenced label not declared |
| E006 | Duplicate label | Label redeclared in same program |
| E007 | World mismatch (Q0/Q1 conflict) | Illegal cross-world operation |
| E008 | Invalid compare signature | COMPARE opcode used with invalid operands |
| E009 | Illegal transform target | TRANSFORM applied to unsupported register |
| E010 | Emit failure | Internal emitter consistency violation |
| E011 | Dangling reference | Unresolved symbolic reference during emission |
B.2 · Warnings (Non-Fatal)
| Code | Description | Meaning |
|---|---|---|
| W001 | Unused label | Declared label never referenced |
| W002 | Redundant instruction | Instruction has no observable effect |
| W003 | No-op transform | Transform applied but state unchanged |
B.3 · Notes
- Errors halt compilation immediately
- Warnings allow compilation to proceed
- All diagnostics are deterministic and reproducible
(Consolidated diagnostic reference.)
Appendix C · Index
This index provides an alphabetical reference to key terms, concepts, and diagnostics defined throughout the eCASM™ Developer Manual.
C.1 · Alphabetical Index
- Classical Interoperation (C) — Appendix A.2 (definition), §5 (usage)
- COMPARE Opcode — §§ 3, 4.1
- Conditional Branch — Appendix A.3 (definition), §5 (usage)
- Dangling Reference — Appendix A.3, Appendix B (E011)
- Diagnostics — §§ 7, 11, Appendix B
- Emit Phase — §§ 6, 8
- Error Codes — § 11, Appendix B
- Emitter — §§ 6, 8
- GOTO — §§ 5, 7, Appendix A.3
- Instruction — §§ 3, Appendix A.1
- Label — §§ 4.3, 5, Appendix A.3
- MEASURE Opcode — §§ 3, 6
- No-op Transform — Appendix B (W003)
- Opcode — §§ 3, 4.1, Appendix A.1
- Operand — § 3, Appendix A.1
- Operational Schema — § 4
- Quantum Register (Q) — Appendix A.2
- Redundant Instruction — Appendix B (W002)
- Syntax Rules — § 3
- Warnings — §§ 7, 11, Appendix B
- World — §§ 4, Appendix A.2
Index entries refer to the primary section where the term is formally defined or most heavily discussed.
(Alphabetical index of terms and concepts.)
End of Manual