User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Did someone say CESIL?

Fri Nov 30, 2012 11:08 am

Look out for Decembers MagPi magazine is all I can say ;-)

-Gordon
--
Gordons projects: https://projects.drogon.net/

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Did someone say CESIL?

Fri Nov 30, 2012 12:06 pm

Suddenly I feel very old.

"JINEG" is the only thing I remember about it now... apart from having to write my programs on those squared paper coding sheets they gave out.

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Did someone say CESIL?

Fri Nov 30, 2012 12:18 pm

Ravenous wrote:Suddenly I feel very old.

"JINEG" is the only thing I remember about it now... apart from having to write my programs on those squared paper coding sheets they gave out.
I just missed it myself - by 1977 getting "hands-on" to a computer was a practicality, so it must have been falling out of use by then...

But do have a go with it - and program the christmas tree lights with it ;-)

-Gordon
--
Gordons projects: https://projects.drogon.net/

User avatar
Wizard
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden

Re: Did someone say CESIL?

Fri Nov 30, 2012 12:21 pm

CECIL didn't travel too far outside UK, did it?

We started with 8502 asm and later 68k asm but that was quite a few years later...
In school we were given a really shitty system called Compis (friend) and had to write COMAL and turbo pascal in CP/M-86 and although the idea was good, the implementation wasn't.
Compared to our VIC 64's and ZX Spectrum we thought we had better stuff at home ;)

Back in the days with flowchart paper-coding I never understood why on earth we should write the logistics on paper with shaded boxes and massive plastic rulers...

...today I fully understand this and only wish I learned "design" before coding a lot sooner...
A million lines assembler sooner :lol:
Raspberry Pi - finally a worthy replacement for A500!!!

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Did someone say CESIL?

Fri Nov 30, 2012 1:46 pm

Yeah - some time in the very late 1970s (I'm having a hard time remembering which school I was at, in fact). I never ran a CESIL program on a computer - we wrote our exercises up on coding sheets and the teacher checked them. (If he was available to me today I'd write the most obfuscated code I could to see whose brain blew first, but I was a sweet and respectful little boy then.)

"Computer Education in Schools Instruction Language" I think it was. I don't even know if there was a computer in existence that ran it at the time, in fact - it may have been just a purely theoretical assembler-like language someone had designed to teach logical step-wise thinking.

Having to write a complete program on paper, without a keyboard or even a computer to compile or run it on as you wrote, was a good way to learn discipline. Though far too slow these days... Young kids don't know how lucky they are!

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Did someone say CESIL?

Fri Nov 30, 2012 1:53 pm

Don't know whats coming in MAGPI but I'll post it again - written by me earlier in the year a home grown CESIL interpreter written in awk - will run right on your PI with no issue!

Run it like so:-

awk -f cesil.awk yourcesilprogramfile

Code: Select all

BEGIN{
	pc=0
	dc=0
	lc=0
	INCODE=1
	for(i=0;i<100;i++) validvalue[i]=""

	if (DEBUG==1) printf("Running in DEBUG mode.\nParsing program ...\n")
}


{
    if ((NF > 0) && (substr($0,1,1) != "*"))
    {
	if (INCODE == 1)
	{
		OPERAND = ""
		INSTRUCTION = ""
		LABEL = ""
		HASALABEL=1

		INPUTLINE=$0
		gsub("\t"," ",INPUTLINE)
		if (substr(INPUTLINE,1,1) == " ") HASALABEL = 0

		if (HASALABEL == 0)
		{
			INSTRUCTION = $1
			opstart = 2
		}
		else
		{
			LABEL = $1	
			INSTRUCTION = $2
			validlabel[LABEL] = LABEL
			labellocation[LABEL] = pc
			labelname[lc] = LABEL
			lc++
			opstart = 3
		}

		if (NF >= opstart)
		{
			/* need to fix spacing retention */
			WORD = $opstart
			gsub("\"","",WORD)
			OPERAND = WORD
			for(word=opstart+1;word<=NF;word++)
			{
				WORD = $word
				gsub("\"","",WORD)
				OPERAND = OPERAND " " WORD
			}
		}

		if (INSTRUCTION == "%")
		{
			INCODE=0
		}
		else
		{
			label[pc] = LABEL
			instruction[pc] = INSTRUCTION
			operand[pc] = OPERAND

			LASTINSTRUCTION = INSTRUCTION
			pc++
		}
		
	}
	else
	{
		data[dc] = $1
		for(word=2;word<=NF;word++)
		{
			data[dc] = data[dc] " " $word
		}
		dc++
	}
    }
    else
    {
	if (DEBUG==1) print "cesil: blank line ignored at " NR 
    }
}

END{
	if (DEBUG==1)
	{
		print "Program:"
		TAB = "|"
		for(ip=0;ip<pc;ip++)
		{
			PAD = ""
			if (ip < 100) PAD = "0"
			if (ip < 10) PAD = "00"
			print TAB PAD ip TAB label[ip] TAB instruction[ip] TAB operand[ip] TAB
		}
		print "Labels:"
		for(lp=0;lp<lc;lp++)
		{
			LABEL = labelname[lp]
			print LABEL " = " labellocation[LABEL]
		}
		printf("Data:");
		for(dp=0;dp<dc;dp++)
		{
			printf(" %s",data[dp])
		}
		printf("\nRunning program ...\n")
	}

	RUNNING=1
	IP=0
	NEXTIP=0
	DP=0
	ACCUMULATOR=0

	for(;RUNNING==1;)
	{
		IP = NEXTIP

		LABEL = label[IP]
		INSTRUCTION = instruction[IP]
		OPERAND = operand[IP]

		NEXTIP=IP+1
		if (DEBUG==1)
		{
			print TAB IP TAB LABEL TAB INSTRUCTION TAB OPERAND TAB
		}
		if (INSTRUCTION == "STORE")
		{
			validvalue[OPERAND] = OPERAND
			value[OPERAND] = ACCUMULATOR
			if (DEBUG==1)  print ">>> STORE " OPERAND " = " value[OPERAND]

		}	
		if (INSTRUCTION == "LOAD")
		{
			VALUE = OPERAND
			if (validvalue[OPERAND] == OPERAND) VALUE=value[OPERAND]
			ACCUMULATOR = VALUE
			if (DEBUG==1)  print ">>> LOAD ACCUMULATOR = " ACCUMULATOR
			if (VALUE == "")
			{
				printf("error: no value for OPERAND " OPERAND " at line %d\n",IP);
				RUNNING=0;
			}
		}
		if (INSTRUCTION == "IN")
		{
			if (DP == dc)
			{
				printf("error: out of data at line %d\n",IP);
				RUNNING=0;
			}
			else
			{
				ACCUMULATOR = data[DP]
				DP++;
			}
		}
		if (INSTRUCTION == "PRINT")
		{
			printf(OPERAND);
		}

		if (INSTRUCTION == "OUT")
		{
			printf("%s",ACCUMULATOR);
		}

		if (INSTRUCTION == "LINE")
		{
			printf("\n");
		}
		
		if (INSTRUCTION == "ADD")
		{
			VALUE = OPERAND
			if (validvalue[OPERAND] == OPERAND) VALUE= value[OPERAND]
			ACCUMULATOR = ACCUMULATOR + VALUE
			if (DEBUG==1) print ">>> ACCUMULATOR ADD " VALUE " = " ACCUMULATOR
		}

		if (INSTRUCTION == "SUBTRACT")
		{
			VALUE = OPERAND
			if (validvalue[OPERAND] == OPERAND) VALUE= value[OPERAND]
			ACCUMULATOR = ACCUMULATOR - VALUE
			if (DEBUG==1) print ">>> ACCUMULATOR SUBTRACT " VALUE " = " ACCUMULATOR
		}

		if (INSTRUCTION == "MULTIPLY")
		{
			VALUE = OPERAND
			if (validvalue[OPERAND] == OPERAND) VALUE= value[OPERAND]
			ACCUMULATOR = ACCUMULATOR * VALUE
			if (DEBUG==1) print ">>> ACCUMULATOR MULTIPLY " VALUE " = " ACCUMULATOR
		}

		if (INSTRUCTION == "DIVIDE")
		{
			VALUE = OPERAND
			if (validvalue[OPERAND] == OPERAND) VALUE= value[OPERAND]
			if (VALUE == 0)
			{
				printf("error: divide by zero at line %d\n",IP);
				RUNNING=0;
			}
			else
			{
				ACCUMULATOR = int(ACCUMULATOR / VALUE)
			}
			if (DEBUG==1) print ">>> ACCUMULATOR DIVIDE " VALUE " = " ACCUMULATOR
		}

		if (INSTRUCTION == "HALT")
		{
			RUNNING=0;
			if (debug==1) printf("warning: program halted at line %s\n",IP);
		}

		if (INSTRUCTION == "JUMP")
		{
			if (validlabel[OPERAND] == OPERAND)
			{
				NEXTIP = labellocation[OPERAND]
			}
			else
			{
				RUNNING=0;
				printf("error: undefined label %s line %s\n",OPERAND,IP);
			}
		}

		if (INSTRUCTION == "JIZERO")
		{
		    if (ACCUMULATOR == 0)
		    {
			if (validlabel[OPERAND] == OPERAND)
			{
				NEXTIP = labellocation[OPERAND]
			}
			else
			{
				RUNNING=0;
				printf("error: undefined label %s line %s\n",OPERAND,IP);
			}
		    }
		}

		if (INSTRUCTION == "JINEG")
		{
		    if (ACCUMULATOR < 0)
		    {
			if (validlabel[OPERAND] == OPERAND)
			{
				NEXTIP = labellocation[OPERAND]
			}
			else
			{
				RUNNING=0;
				printf("error: undefined label %s line %s\n",OPERAND,IP);
			}
		    }
		}
	}
	if (DEBUG==1) printf("Program finished.\n")

}
Good source of CESIL info and a Windoze CESIL environment at http://www.obelisk.demon.co.uk/cesil/
Footnote: I've been trying to track down some example CESIL Coding Sheets from the 1970's - if anyone's got one could they do a full A4 scan please! :D
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Did someone say CESIL?

Fri Nov 30, 2012 2:04 pm

SN wrote:Don't know whats coming in MAGPI but I'll post it again - written by me earlier in the year a home grown CESIL interpreter written in awk - will run right on your PI with no issue!
Just have a look on thd MagPi site - the pre-release is up ..

Essentially I wrote a CESIL interpreter (in Basic, of-course) that does the usual CESIL stuff, but has some additional instructions (JSR/RTS) and code to light up the fairy lights on a cristmas tree, so you can write sequences of code to play with the ligths, all in the comfort of your own on-screen home!

-Gordon
--
Gordons projects: https://projects.drogon.net/

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Did someone say CESIL?

Fri Nov 30, 2012 5:34 pm

Oh gawd, CESIL - "Computer Education in Schools Instructional Language"...

The scourge of my O level Computer Studies course. 14 instructions, two high level (INPUT / PRINT as I recall) and all the others were essentially machine code. One accumulator!

We had to write out our programs on coding sheets, then send them to the local 6th form college to be entered into the teletype (to be run on the local authority's ICL 2900 mainframe). The effect of this was we would do the coding one week, and get the (printed) result the next. So, with a weekly code - result (that is, debug - test) cycle, you can imagine the importance of dry running code before submitting it.

You tell that to the kids of today.... and they wouldn't believe a word of it!

User avatar
Wizard
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden

Re: Did someone say CESIL?

Fri Nov 30, 2012 6:03 pm

JonB wrote:Oh gawd, CESIL - "Computer Education in Schools Instructional Language"...
You tell that to the kids of today.... and they wouldn't believe a word of it!
Kids today think producing html is programming... and not a dtd to SGML, which they've never heard of.
Assembler is unheard of and C is the name of the vitamins they eat since they don't eat enough fruit. :D

Another thing I find sad is the vast mountain of information available through internet and very few actually tries to solve their problem themselfs and instead just google the solution.

I still remember reading the few books I had on 6502 and 68k every night when I went to bed and the things we couldn't work out ourselfs had to be brought up with the friends who were more or less in the same situation.
I still have my old blue Amiga Hardware Reference Manual and I will never get rid of it! I remember getting it one christmas, soon after I got my first Amiga 500 with Workbench 1.2... Those were the days!

I will have a look at CECIL since it's probably right down my alley ;)
Raspberry Pi - finally a worthy replacement for A500!!!

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Did someone say CESIL?

Fri Nov 30, 2012 10:12 pm

Wizard wrote:
JonB wrote:Oh gawd, CESIL - "Computer Education in Schools Instructional Language"...
You tell that to the kids of today.... and they wouldn't believe a word of it!
Kids today think producing html is programming... and not a dtd to SGML, which they've never heard of.
Assembler is unheard of and C is the name of the vitamins they eat since they don't eat enough fruit. :D

Another thing I find sad is the vast mountain of information available through internet and very few actually tries to solve their problem themselfs and instead just google the solution.

I still remember reading the few books I had on 6502 and 68k every night when I went to bed and the things we couldn't work out ourselfs had to be brought up with the friends who were more or less in the same situation.
I still have my old blue Amiga Hardware Reference Manual and I will never get rid of it! I remember getting it one christmas, soon after I got my first Amiga 500 with Workbench 1.2... Those were the days!

I will have a look at CECIL since it's probably right down my alley ;)
Have a look at the MagPi thing then, I'll probably blog the page on my own site in a week or so too, once it's been properly published, but if you want to dive in, you'll need my BASIC intrepreter, and:

git clone git://git.drogon.net/cesil

and have a look at what you get ...

-Gordon
--
Gordons projects: https://projects.drogon.net/

PaulGerrard
Posts: 1
Joined: Thu Jan 03, 2013 7:51 am
Location: Maidenhead
Contact: Website

Re: Did someone say CESIL?

Thu Jan 03, 2013 8:02 am

In my first year at sixth form (autumn 1974), our school computer geek maths teacher set up an ad-hoc after hours computing course for the Double Maths A-Level students. We filled in cards that were standard size, but dark green (not very usable). We pencilled in little oval areas next to instruction names or digits I recall. None of your card punching nonsense. Pencil and rubber were all that was required.

The cards were duly sent off to (I believe) Manchester Uni computing centre and if we were lucky, we'd get the results (and our cards!) back a week later. We didn't know whether it was a great language or not, but we learnt concepts like accumulator, variables, data, loops and decisions (jineg, jizero and jump are etched on my memory). No it wasn't Python, but as an intro - it was fascinating. I've been writing code professionally ever since.

Happy Days!

Thanks for reminding me of it's existence (and continued following!)

Return to “Other programming languages”