Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!csc!ccadfa!csadfa!stephens From: stephens@csadfa.cs.adfa.oz.au (Philip Stephens) Newsgroups: comp.sys.apple Subject: Re: C on the apple Message-ID: <1054@ccadfa.adfa.oz.au> Date: 5 Feb 90 01:05:05 GMT References: <6695@wpi.wpi.edu> <12647@cbnewsd.ATT.COM> <6761@wpi.wpi.edu> <7604@wpi.wpi.edu> Sender: news@ccadfa.adfa.oz.au Lines: 30 In article <7604@wpi.wpi.edu>, greyelf@wpi.wpi.edu (Michael J Pender) writes: > >In article <12054@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: > >>The 6502 hardware stack is too small for serious > >>C applications even if it were used only to hold return addresses. > > The 65c02 wouldn't really help. The additional instructions of the > 65c02 are mostly concerned with a new addressing mode, a short > range absolute branch, instructions to push and pop x and y > on and off the stack, an instruction to store zeroes in memory, > and the test and set bits and test and reset bits instructions. The fact is, the 6502 (and it's equivilants) are _not_ suited for optimized code generation or speed, in relation to high level languages such as C or Pascal. These languages need a large run time stack, and some decent indexing instructions. Thus, the easiest way to implement C or Pascal is to get the compiler to generate P-code (which is a stack oriented pseudo-machine language). C programs translate extremely easily into P-code, but you either need an interpreter for the P-code (which is not much faster than interpreted BASIC), or an assembler to convert P-code to 6502 code (which produces very inefficient and _long_ object code). Even optimized 6502 code translated from P-code will not run as well as the code for better-suited microprocessors. Sorry if all this has been said before. It's hard to keep track of all the traffic. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_ Philip J. Stephens -_- `My Apple II+ may only have 64K, one _-_ _-_ Department of Computer Science -_- 5 1/4 " drive, a stuffed joystick, _-_ _-_ University College, Canberra -_- and run at 1 MHz; but it's mine!!!' _-_