Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.micro.68k Subject: Re: Re: FLAME!!! Re: EA orthogonality Message-ID: <2252@sun.uucp> Date: Sat, 1-Jun-85 01:16:22 EDT Article-I.D.: sun.2252 Posted: Sat Jun 1 01:16:22 1985 Date-Received: Wed, 5-Jun-85 01:08:13 EDT References: <5609@utzoo.UUCP> <75600002@ima.UUCP> <387@gumby.UUCP> Organization: Sun Microsystems, Inc. Lines: 39 > The problem is that C is a programming language written with a particular > machine storage model in mind, and it ports poorly to other architectures. > Modula-2, Pascal, Ada, all are languages that port quite well to the 8086 > family, and produce efficient, readable code without any sort of trickery > required of the programmer. Umm... Pascal has pointers, "new", and "dispose", just like C has pointers and its library has "malloc" and "free". How would you write a program that, say, manipulated large trees requiring >64KB worth of node storage in Pascal? Probably similarly to how you'd write it in C. Now imagine that program dealing with two nodes at the same time. Well, you load one pointer into the DS register and one of the general-purpose registers, and the other one into the ES register and one of the general purpose registers. You have to kludge a bit with the "use the ES register" prefix, but the advance information data sheet I have in front of me doesn't list any times for the segment-selection prefix so I assume it takes no time. Now imagine that program dealing with three nodes at the same time - say it's an expression tree, and it's evaluating an addition by adding the LHS to the RHS and storing the result in the parent node. Well, you load one pointer into the DS register and one of the general purpose registers, the second one into the ES register and one of the general purpose registers, and the third one into the EES register and one of the general purpose registers... Oops. There *is* no EES register. Oh well, shuffle shuffle shuffle.... (If you can get good code for this one, try something where you have to use each pointer more than once.) The same data sheet says a direct intersegment call takes 19 more clocks than a direct within segment call in protected mode, and even in real address mode it takes 6 more clocks. Load pointer to DS/ES instructions take 21 clocks in protected mode and 7 in real address mode. Using those segment registers dynamically rather than statically is not cheap. Do you have evidence that compilers for the other languages you mention can solve problems like this much better than compilers of equivalent quality for C? If so, can you show that the difference is due to some characteristic of the languages in question? Guy Harris