Pascal S is a weak subset of Pascal, good for learning how to write a compiler. The first implementation, by Wirth, was for the CDC6600 (it has since been ported) and includes the compiler and the bytecode interpreter. But it turns out that the implementation of one of the opcodes is simply broken on other architectures - it turns out there’s an assumption about the now-rather-unusual number formats of the CDC6600.
Here’s the full story, from Scott Moore:
Unwilling to simply declare it to be a bug and fix it, I began to think about what I knew about the CDC 6000 series computer, and looking at some CDC 6600/6000 reference material. The CDC has a very unique floating point format. The CDC 6000 uses 60 bit words for both integer and floating point formats. In fact, a floating point number is essentially the mantissa, represented by a 60 bit signed integer, with the exponent stuck into the high order bits between bit 48 and bit 59. The exponent even is allowed to appear as the complement of itself so that it remains valid if the entire number is complemented (the CDC 6600 used 1’s complement numbers).
The result is that a negate instruction works equally well on both real and integer formats, on the CDC 6600 series computers.
Via Willard Goosey on mastodon:
Got an old Pascal S compiler to compile and run under RISC OS. Then I read about Pascal S on the web (the compiler helpfully includes no documentation) and discover that Pascal S is a toy subset of Pascal. No pointers, no file IO, or function parameters…
No wonder nobody bothered recompiling it for 32bit RISC OS…
But that’s OK because I learned a little about the history of Pascal. And about the … unique architecture of the CDC6600.