GC2Asm
GC2Asm is an assembly language for the GC2.
Assembly Elements
Comments
Comments begin with a double slash (//) and extend to the end of the line.
Labels
Labels must begin with a colon and only consist of upper and lower case letters and numbers. Labels are used to mark a place in the instruction stream, and are not included in the memory image, but are used to calculate addresses for the pseudo-instructions. Labels use the following syntax:
:Label
Identifiers
Identifiers are used to alias addresses for data. Identifiers are defined with the syntax:
#define IdentifierName address
Instructions
Valid instructions are those native to the GC2, and some additional pseudoinstructions. Operanded instructions must have one operand. Unoperanded instructions will ignore the operand. The addresses between 0x008 and 0x00F are not considered safe across psudoinstructions.
Pseudoinstructions
Pseudoinstructions include the following:
| instruction | function |
| BRCH address | branch to address if dest is zero |
| JMP address | unconditionally branch to address if dest is zero |
| BSL | bit shift left |
| BRL | bit rotate left |
| COMP | test op1 and op2 for equality--dest is zero if op1 = op2 |
| COMPZ | compare to zero--dest is zero if op1 = 0 |
![[Home]](/images/hat.png)
