Skip to main content

Timeline for x86 as a Pascal Machine?

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
Jul 9, 2018 at 18:41 comment added supercat @DavidThornley: The year 1989 is rather late in the history of C; the Standard was a response to the fact that the language was already pretty well established. I don't know whether any of C's predecessors like B or BCPL shared its parameter-passing conventions, but it would seem likely. In any case, I can't think of any processor features that would be of benefit to a C compiler that wouldn't also benefit a Pascal compiler.
Jul 9, 2018 at 18:17 comment added David Thornley The original design of the 8086 was finished in 1978, and the first C standard was 1989. I couldn't find a reference to a CP/M C compiler that was released before 1978, so I don't know how much influence C could have had on the 8086. The typical higher level languages in use then were BASIC and Pascal.
Jul 7, 2018 at 18:54 comment added supercat @celtschk: The Standard requires that a call to a non-variadic function without a prototype behave the same way as a call to such a function with a prototype. A compiler could use Pascal convention for all function calls (handling variadic arguments as I described) but it would be incompatible with pre-compiled functions using the C convention. Interestingly, most higher-level functions in the 1984 Macintosh Toolbox used the Pascal convention.
Jul 7, 2018 at 18:36 comment added celtschk The C standard also made it undefined behaviour to call a function with the wrong number or type of arguments, and that functions with variadic arguments are required to have prototypes, therefore the compiler could infer the prototype from the call and still be conforming. However I guess too much code assumed that printf was available without prototype to make it impractical to write a compiler that made use of this restriction.
Jul 7, 2018 at 18:10 history answered supercat CC BY-SA 4.0