Quick Jump

Introduction Access & Usage Syntax Overview Operational Schema Classical Interoperation Output & Emitter Error Guide Compilation Flow Advanced Usage Domain Examples Debug Reference Troubleshooting Licensing
Appendices Glossary Errors & Warnings Index

eCASM™ Developer Manual

Version 1.0 · AAD Systems™ · November 2025

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

  1. Introduction
  2. Access and Usage
  3. Language Design and Syntax Overview
  4. The eCASM Operational Schema (v1.0)
  5. Classical Interoperation
  6. Compiler Output and Emitter Behavior
  7. Error Handling and Debugging (Guide)
  8. Compilation Flow
  9. Advanced Usage and Roadmap
  10. Domain Examples
  11. Error Handling and Debugging (Reference)
  12. Troubleshooting Guide
  13. Licensing and Support
  14. 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.

➜ Download the eCASM Algebra (PDF)


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


2 · Access and Usage

Getting Started

  1. Visit the eCASM Compiler homepage
  2. Paste your CASM code into the editor
  3. Click Compile
  4. Review the Emitter Trace and Output Panels

License System

Interface Overview


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

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


4.3 · Labels

Labels must be unique and declared using a colon-prefixed syntax.

:Lstart
:Lend

4.4 · Error Messages

Syntax Errors

Label Errors

Semantic Errors

Emit Errors


4.5 · Diagnostics


4.6 · Program Shape (Canonical Form)

:Lstart
XQ0
ABC Q0
cxz Q0, Q1
T Q1
:Lend

4.7 · Emit Format


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

  1. Parse — validate syntax
  2. Execute — apply operations
  3. Emit — produce .ecasm output

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

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


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


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

13.2 · Licensed Access

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


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

(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


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