JSECAL help
Example program
This loads the value 42 into the accumulator and saves it to the output register (255).
; Semi-colons start comments CA AD fortytwo ; OR=output register=255 SA OR HT fortytwo: 0x2A
Standard ECAL instructions
Opcode | Desc. |
---|---|
ca | Clear accumulator |
sl | Shift left |
sr | Shift right |
no | No op |
ht | Halt |
jc location | Conditional jump (if value at location>0) |
ju location | Jump |
se location | Store external |
ss location | Start Subroutine (return address stored at location) |
su location | Subtract value from accumulator |
ad location | Add value to accumulator |
an location | Bitwise AND with accumulator |
sa location | Store accumulator contents |
Unofficial ECAL instructions and supporting structures
These are:
Opcode | Desc. |
---|---|
ldint value | Load integer into accumulator |
addint value | Add integer to accumulator |
subint value | Subtract integer |
ldr location | Load contents of location into accumulator |
write location value | Write value into memory location |
clone new_location old_location | Copy contents of one location to another |
jnz location | Jump if Non-Zero (compiles to JC) |
add location | Add value at location to accumulator |
sub location | Subtract value at location |
nop | No op |
hlt | Halt |
These instructions are simple macros for common tasks or alternative aliases for official opcodes. The official compiler, secal, will not recognize the new instructions, but the machine code output is 100% compatible with the vec command and the EL24 hardware.
Note: When ECAL extensions are enabled, a tmp register at location 254 is created, next to the output register. This will conflict with any definition of the tmp label elsewhere in your program.