Hacker News new | ask | show | jobs
by uecker 49 days ago
I don't think this is really true. What instructions would this be?

In contrast, Intel introduced a lot of instruction for PASCAL, e.g. enter / leave etc. which are basically unused.

2 comments

Raymond Chen has an article about enter / leave: https://devblogs.microsoft.com/oldnewthing/20190130-00/?p=10...

He says Leave is often used by compilers, but not Enter.

LEAVE is used by my x86 backend, but only in one case, and is not used when optimization is turned on. ENTER is not used.
Instructions like AAA (Ascii Adjust for Addition) on the 8088. The 8087's stack architecture. XLAT, STOS, etc. Asymmetries in how the registers work. ENTER/LEAVE. Kludge instruction sets like the Z80.

An instruction set ideally suited for C is the PDP-11.

Why would AAA be an instruction made for C? I don't see this. Or 8087's stack architecture? Or xlat? ENTER/LEAVE is also a counter example where CPU vendors added instructions for other languages than C.
Those instructions preceded the rise of C. CPU makers at the time thought Pascal was going to dominate, hence ENTER/LEAVE.
Ok, sorry, I must have misunderstood your original comment. I thought you were saying CPU makers added those instructions for C.
C wasn't really on the radar when the IBM PC debuted.