CESIL
Cesil, or Computer Education in Schools Instruction Language, was a programming language designed to introduce pupils in British schools to Assembly language. It is a low level language containing a total of fourteen instructions:
- Load value - place the immediate value or the contents of the variable named in the accumulator.
- Store variable - place the contents of the accumulator in the variable.
- Jump label - transfer control to location labelled.
- Jineg label - transfer control to location labelled if the accumulator contains a negative value.
- Jizero label - transfer control to location labelled if the accumulator contains zero.
- Print literal - output the following string, delimited by single quotes.
- Line - output a carriage return
- In - allow user to input a numerical value from the console.
- Out - Output the contents of the accumulator as a decimal integer, signed if negative.
- Add value - add the variable or immediate integer value to the accumulator.
- Subtract value - subtract the variable or immediate integer from the accumulator.
- Multiply value - place the product of the accumulator and the variable or immediate integer in the accumulator.
- Divide value - place the contents of the accumulator divided by the value in the accumulator.
- Halt - return control to console.
Examples
The following totals the integers in 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 [Output of above program running...] The total is: 6
gollark: The resistor behaves ohmically and the current through both things is the same.
gollark: IIRC, if we assume the LED is an ideal diode, it'll just always have a 2V potential difference across it (if there's more than 2V in the circuit and also it is the right way round oops).
gollark: Well, that would actually have been right if you used the right units then added 2, possibly.
gollark: Not just... multiply... them?
gollark: I'm pretty sure you'd have to work out what voltage across the resistor would give you 20mA through it, then add 2 to it for the LED.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.