User:Alidonis12/sandbox/casm
< User:Alidonis12 | sandbox
Jump to navigation
Jump to search
Casm (pronounced /ˈkæzəm/) is an esoteric programming language invented by Alidonis12 (talk) inspired by 6502 assembly and C.
Casm uses 16-bit addresses. Therefore, it is only be able to address up to '64K' (65535) bytes of contiguous memory. However, data values are only 8-bit.
Casm has 4 independently controlled registers in addition to the accumulator, labeled A through D.
There are 3 possible addressing mode: value, address and register. The first is written with #, the second with & and the third with A,B,C or D
Syntax
Each function must start with a function name
Statements
Memory addressing
Operation | Description |
---|---|
LDAC (value, address, register) | Load to accumulator. Doesn't have much use, because the accumulator is overridden frequently. |
STAC (address, register) | Store accumulator. Move the stored value of the accumulator to an address in memory or a register. |
LDA, LDB, LDC , LDD (value, address, register) | Load from memory to register A, B, C, or D respectively. |
STA, STB, STDC, STD (address, register) | Store register A, B, C, or D respectively into memory. |
Examples
Interpreters
A .NET IL compiler is currently under works