CESIL

Source: Wikipedia, the free encyclopedia.

CESIL, or Computer Education in Schools Instruction Language,

instructions
.

Background

paper tape.[4] Typically, this would be sent to run on a mainframe computer, with the output from a line printer being returned later.[5]

Structure

Because CESIL was not designed as an interactive language, there is no facility to input data in real time. Instead, numeric data is included as a separate section at the end of the program.[6]

The fundamental principle of CESIL is the use of a single

arrays, nor for string handling, though string constants can be output by means of the PRINT instruction.[4]

Jumps and loops can be conditional or non-conditional, and transfer operation of the program to a line with a specific label, which is identified in the first column of a coding sheet.[9] The instruction or operation is stated in the second column, and the operand in the third column.[10] On some coding sheets, comments and the text of the PRINT instruction would be written in a fourth column.[11]

Instructions

Instructions, or operations, are written in upper case and may have a single operand, which can be a store location, constant integer value or line label. Store locations and line labels are alphanumeric, up to six characters, and begin with a letter.[12] Numeric integer constants must be signed + or −, with zero being denoted as +0.[13][a]

Input and output

  • IN – reads the next value from the data, and stores it in the accumulator.[4] The error message *** PROGRAM REQUIRES MORE DATA *** is printed if the program tries to read beyond the end of the data provided.[14]
  • OUT – prints the current value of the accumulator. No carriage return is printed.[15]
  • PRINT "text in quotes" – prints the given text. No carriage return is printed.[15]
  • LINE – prints a carriage return, thus starting a new line.[16]

Memory storage

  • LOAD location or LOAD constant – copies the value of the given location or constant to the accumulator.[17]
  • STORE location – copies the contents of the accumulator to the given location.[10]

Mathematical instructions

  • ADD location or ADD constant – adds the value of the given location or constant to the accumulator.[18]
  • SUBTRACT location or SUBTRACT constant – subtracts the value of the given location or constant from the accumulator.[19]
  • MULTIPLY location or MULTIPLY constant – multiplies the accumulator by the value of the given location or constant.[20]
  • DIVIDE location or DIVIDE constant – divides the accumulator by the value of the given location or constant.[21] The result is rounded down if the result is positive, and up if the result is negative.[8] A *** DIVISION BY ZERO *** error message is printed if the divisor is zero.[22]

In each case, the result of the operation is stored in the accumulator, replacing the previous value.

Program control

  • JUMP label – unconditionally transfers control to location labelled.[23]
  • JINEG label (Jump If NEGative) – transfers control to location labelled if the accumulator contains a negative value.[24]
  • JIZERO label (Jump If ZERO) – transfers control to location labelled if the accumulator contains zero.[9]
  • HALT – terminates the program.[15]

Other symbols

Three special symbols are used in CESIL at the beginnings of lines.

  • % is used to mark the end of the program and the start of data.[11]
  • * is used to mark the end of the data.[25]
  • ( is used at the start of a line to indicate a comment.[26][b]

CESIL programming tools

An emulator for CESIL, designed to run on Windows and called Visual CESIL, is available as freeware.[27]

An interpreter for CESIL, designed to run on the Android platform and called Wyrm CESIL, is available as free to install.[28]

Example

The following totals the integers in the runtime data section until it encounters a negative value and prints the total.

        LOAD    +0
LOOP    STORE   TOTAL
        IN
        JINEG   DONE
        ADD     TOTAL
        JUMP    LOOP

DONE    PRINT   "The total is: "
        LOAD    TOTAL
        OUT
        LINE
        HALT

%
1
2
3
-1
*

The output of the above program would be:

The total is: 6

See also

Bibliography

Monsoon, Colin C; Sewell, Ian R; Frances P, Vickers (1978). Computer Studies. Vol. Book 1.

.

Notes

  1. ^ Visual CESIL does not require non-negative constants to be signed.
  2. ^ Not supported in Visual CESIL. * is used instead.

References

  1. ^ Computer Studies, page 71
  2. ^ "ICL–CES: Computer Education in Schools". Archived from the original on 19 June 2021. Retrieved 16 June 2021.
  3. The Royal Society. p. 120. Archived
    (PDF) from the original on 2021-05-06. Retrieved 20 June 2021.
  4. ^ a b c d Computer Studies, page 72
  5. ^ "My First Program". Archived from the original on 24 June 2021. Retrieved 16 June 2021.
  6. ^ Computer Studies, page 82
  7. ^ Computer Studies, page 76
  8. ^ a b Computer Studies, pages 93–94
  9. ^ a b Computer Studies, page 148
  10. ^ a b Computer Studies, page 77
  11. ^ a b Computer Studies, page 74
  12. ^ Computer Studies, pages 96, 148
  13. ^ Computer Studies, pages 97–99
  14. ^ Computer Studies, page 201
  15. ^ a b c Computer Studies, page 73
  16. ^ Computer Studies, pages 199–200
  17. ^ Computer Studies, pages 80, 97–98
  18. ^ Computer Studies, pages 84, 97–98
  19. ^ Computer Studies, pages 86, 97–98
  20. ^ Computer Studies, pages 90, 97–98
  21. ^ Computer Studies, pages 92, 97–98
  22. ^ Computer Studies, page 145
  23. ^ Computer Studies, page 198
  24. ^ Computer Studies, page 154
  25. ^ Computer Studies, page 83
  26. ^ Computer Studies, page 164
  27. ^ Andrew John Jacobs (20 June 2010). "Visual CESIL". Archived from the original on 12 September 2021. Retrieved 26 November 2021.
  28. ^ Wyrm Software (13 October 2019). "Wyrm CESIL". Archived from the original on 25 November 2021. Retrieved 25 November 2021.
This page is based on the copyrighted Wikipedia article: CESIL. Articles is available under the CC BY-SA 3.0 license; additional terms may apply.Privacy Policy