CESIL
About CESIL
CESIL (Computer Education in Schools Instruction Language) was an early attempt by ICL to introduce children to software development. It was prevalent in the late 60's and throughout the 70's. Essentially a very basic Assembly Language, it was excellent for getting children to learn how to do a lot with a few instructions.
Any line in CESIL that starts with an asterisk is treated as a comment, as are any lines beginning with '('. A valid CESIL line of code is made up of an optional label, followed by a space (required), then followed by an instruction. There are 14 instructions in total that operate either on a single integer 'accumulator' or named stores (variables). Labels and stores must start with a letter and contain letters and digits only. After the last instruction there must be a '%' character on a new line which can then be followed by one or more new lines of space separated integer data values.
CESIL Instructions
IN | Read data item into accumulator. |
OUT | Print content of accumulator. |
LOAD VALUE | Load accumulator with an integer constant or from a named store. |
STORE VALUE | Store the integer in the accumulator into a named store. |
ADD VALUE | Add an integer constant or value in a named store to the accumulator. |
SUBTRACT VALUE | Subtract an integer constant or value in a named store from the accumulator. |
MULTIPLY VALUE | Multiply accumulator with an integer constant or value in a mamed store. |
DIVIDE VALUE | Divide accumulator with an integer constant or value in a mamed store and truncate to an integer. |
JUMP LABEL | Jump to the instruction at the label. |
JIZERO LABEL | Jump to the instruction at the label if the accumulator is 0. |
JINEG LABEL | Jump to the instruction at the label if the accumulator is negative. |
LINE | Print a new line. |
PRINT "string" | Print the string in quotes (use "" to include a quote in the string). |
HALT | Stop execution. |
Example CESIL program
** Squares
** Example Program
LOOP IN
JINEG END
OUT
STORE NUMBER
PRINT " squared is "
MULTIPLY NUMBER
OUT
LINE
JUMP LOOP
END HALT
%
5 72 111
67 -1
*
