Robert's website


Example program

This loads the value 42 into the accumulator and saves it to the output register (255).

; Semi-colons start comments
AD fortytwo
; OR=output register=255
fortytwo: 0x2A

Standard ECAL instructions

caClear accumulator
slShift left
srShift right
noNo op
jc locationConditional jump (if value at location>0)
ju locationJump
se locationStore external
ss locationStart Subroutine (return address stored at location)
su locationSubtract value from accumulator
ad locationAdd value to accumulator
an locationBitwise AND with accumulator
sa locationStore accumulator contents

Unofficial ECAL instructions and supporting structures

These are:

ldint valueLoad integer into accumulator
addint valueAdd integer to accumulator
subint valueSubtract integer
ldr locationLoad contents of location into accumulator
write location valueWrite value into memory location
clone new_location old_locationCopy contents of one location to another
jnz locationJump if Non-Zero (compiles to JC)
add locationAdd value at location to accumulator
sub locationSubtract value at location
nopNo op

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.