[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it too hard to program for the Apple?



Michael J. Mahon wrote:
> D Finnigan wrote:
>> Michael Black wrote:
>> 
>>>On Mon, 22 Feb 2010, D Finnigan wrote:
>>>
>>>
>>>>Thanks to everyone's responses, I've decided to slow down, man up, and
>>>>learn
>>>>to program in C for the Apple IIe, and also hopefully learn more
>>>>assembly
>>>>as
>>>>well.
>>>
>>>Assembly is pretty fast, C is really slow.
>>>
>> 
>> 
>> Slower even than Applesoft? That's not the impression that I got.
> 
> 
> Assembly language is easily a few hundred times faster than Applesoft,
> and usually 2x-3x faster than compiled code, since the assembly language
> programmer allocates machine registers "perfectly" for speed and uses
> "ideal" machine-oriented data structures, not a few "standard" types
> provided by a programming language. (Of course, if all the time is
> spent in libraries, those libraries will determine the speed.)
> 
> Any production OS intended to run on a (small fraction of a) 64KB
> machine can and should be written in assembly language, for compactness
> as much as speed and versatility.  16KB of 6502 code is less than 5-6k
> lines of code, and therefore well within the range of easily managed
> assembly programs--assuming reasonable factoring, macros, etc.
> 

I noticed that Aztec C has its own assembler and the C compiler has an
option to convert the C source to assembly without actually doing the
assembling. Would it be worthwhile to hand-tune the generated assembly file?