C programming missing {}

Looking at the Pet character set I notice {} are missing. Did the developers
plan never to have a C compiler because it was a 6502 or just it was never
expected have a 8 bit micro with 48kb and dual floppies (8")?
What other 8 bit micros are missing ‘{’ and ‘}’. ?
I had a C compiler (os/9) for the TR80 Color Computer, but I can’t remember
how got {} .Ben.

Try main() $( body; $).
B on UNICS used that as {} transliteration and it may have survived in some C compilers.

https://sdf.org/?tutorials/unix50th#section-2

1 Like

The original Apple II with all-uppercase characters didn’t have {} either. I suspect a lot of the early systems with on-board video output that were upper case only were like that.

-Gordon

BCPL (before B) did it that was until lower case terminals became popular… The compiler still recognises it today.

-Gordon

I never really noticed that before. But I can’t remember ever needing to use curly braces on a PET.
It looks like PETSCII doesn’t have curly braces.

My TRS-80 Model 4P has curly braces - in both Model 4 and Model 3 modes. So I would assume that the TRS-80 Model I has them in the character set. You need to do a 3-fingered key press (CLEAR-SHIFT-period/comma) to get them, though.

C uses “trigraphs” for this; ??< is equivalent to {, and ??> is }. This was also a problem on 5-level ITU-2 terminals.

Many languages solved this problem in varying, but related, ways.

1 Like

In playing around recently with the BBC emulator B-em,
together with the NS32000 “Tube” emulator and PanOS,
I noticed that B-em’s BBC-to-PC keyboard mapping doesn’t
seem to include ‘\’, which would make entering C using the
native PanOS editor somewhat problematic.

Fortunately, this wasn’t strictly necessary – I just
typed C into my host machine’s editor and used Stephen Harris’s
“Beeb Utilities” to load the text into B-em via an SSD
floppy image.

5 Level code still seems to miss more than just that.

“trigraphs" are needed since Europe wanted thier accent marks,
with ASCII. What I don’t understand is why lower case was never in the
first revision? How was uppercase terminals like the ASR 33 handled
under unix? Ben.

B-em’s BBC-to-PC keyboard mapping doesn’t seem
to include ‘\’

OK, I should have Googled this before. ;->

Settings->Keyboard->Remap Keyboard
lets me fix this.

1 Like

Yes, 5-level code is missing tons of things.

Old Unix would assume you were on an uppercase terminal if you logged in with an uppercase username, and start sending uppercase only and translating incoming uppercase to lowercase. Linux supported this into the early 2000s, at least, and some BSDs may still.

1 Like

There was a convention and I’ve forgotten the exact details but if you logged in with capitals it would assume you really meant lower case then capital letters were preceded with a backslash and when you typed a capital it would convert to lower case.

-Gordon

I find it more interesting that PETSCII does include LEFT ARROW and UP ARROW symbols. Neither of these were necessary for the de facto standard home computer language BASIC, but they were used by Pascal. Maybe other computer languages I’m not familiar with, like Algol?

This seems to be lost to the ages … nowadays, all usage of LEFT ARROW has been replaced with := and all usage of UP ARROW has been replace with ^

I liked the left arrow since you could use that instead of equals. The equals
sign then could be used for ‘equal’. Ben.

C (and C++) have a set of alternative operator representations that should work. For “{”, this is “<%”, “}” is represented by “%>”.

Here’s a list of alternative operators

https://en.cppreference.com/w/cpp/language/operator_alternative

If you have a look at the origins of the PETSCII character set [1], I’m afraid that this is actually the case.

[1] “Creating PETSCII” by Leonard Tramiel (who created the PETSCII font): https://vintagecomputerstories.blogspot.com/2021/12/creating-petscii.html

Edit: However, it became a consideration later on with the “SuperPET” SP9000, which came with support for multiple programming languages. This one featured an extended character set, comprising the full US-ASCII range, including { and }, as well as APL characters. See the image below:


(SuperPET character set, via http://www.6502.org/users/sjgray/computer/cbmchr/cbmchr.html. The special extension starts at the line above the 3rd occurernce of “@” and is in ASCII order for the lower 7 bits. Mind how the code designation for APL characters is based on similarities to Latin characters in the row below and that APL characters with Latin glyphs are not actual letters. Also note the addition of “μ” [mu].)

1 Like

I find it very interesting that PETSCII apparently started out with the 1963 ASCII arrows. Some ROMs has the left arrow replaced by underscore, but the up arrow remains in place.