[TUHS] v7 K&R C

Tony Finch dot at dotat.at
Mon May 18 22:25:19 AEST 2020


Paul Winalski <paul.winalski at gmail.com> wrote:
>
> Why did the implementers of the Unix ABI for ARM decide to have char
> be unsigned?  Was there an architectural reason for it?

The early ARM didn't have a sign-extended byte load instruction.

I learned C with the Norcroft ARM C compiler on the Acorn Archimedes in
1991/2ish. Norcroft C had quite a lot of unix flavour despite running on a
system that was not at all unixy. (I didn't get my hands on actual unix
until a couple of years later.) Acorn had a BSD port to the Archimedes
which I've never seen myself - the R260 was a pretty powerful system for
its time which I coveted from afar. I believe the 32 bit ARM ABI evolved
from the early 26 bit ABI on the Archimedes. (32 bit word, 26 bit address
space.)

http://chrisacorns.computinghistory.org.uk/RISCiXComputers.html

More recent versions of the instruction set have more features. I believe
the arm64 ABI uses signed char to match what everyone is used to. I still
think unsigned bytes are more sensible, but that's what I was taught at an
impressionable age...

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
Trafalgar: North 3 or 4, occasionally 5 later. Moderate, occasionally slight
in east. Fair. Good.


More information about the TUHS mailing list