see below, please.

regards,

Richard Erlacher

----- Original Message ----- 
From: "Richard Gray" <[EMAIL PROTECTED]>
To: <sdcc-user@lists.sourceforge.net>
Sent: Sunday, September 07, 2008 11:46 PM
Subject: Re: [Sdcc-user] documentation & open source generally


> On Monday 08 September 2008 06:32:51 Richard Erlacher wrote:
> <snip>
>> You shouldn't let things such as that scare you.  If you maintain order 
>> and
>> discipline within your code, you can do it.  ... easily ... and most
>> assemblers have no quirks that would "mess you up" as HLL's often do.
>> Believe me, the possibility that a HLL reduces the line count is not
>> necessarily a blessing.  What matters is the way in which the code is
>> organized.  Most MCU code is small, and even if quite large, it's often
>> mostly table space.  I often generate tables in a HLL on the PC (in 
>> BASIC,
>> ... sometimes ... <cringe> ...) and then paste the output into an ASM
>> source file.  I come from that generation that was happy to have 256-byte
>> EPROMS (they were reuseable!) so I try to be thrifty with code space.
>> Compilers don't always help much with that.
>>
>> 4 k-lines?  That's a small program.  I would find something longer than 
>> 100
>> k-lines difficult to manage, would consider a HLL at 250 k-lines, and
>> certainly would use a HLL if it got to be twice that long.  Fortunately,
>> MCU's generally don't require that much code.
> <snip>
>
> OK, I was exaggerating to make a point.
>
> I wouldn't make assembler my starting point unless there was a really good
> reason to do so. My latest efforts have mandated an assembler fragment
> because I couldn't initialise the stack pointer and MMU any other way (not
> sensibly anyway), but such is an example of where I use that medium - only
> when there's no sensible alternative.
>
With most microcontrollers, there's good reason to do so, as they require 
MCU-specific initialization.  It's possible, I suppose to write 
configuration parameters to the appropriate locations using HLL, but I'm not 
sure I'd do that.  Some MCU's recognize certain SFR writes only if they 
occur within a specific time interval, and I'd guess there are many other 
reasons why one would want to ensure the precise timing of certain 
operations, for which ASM is essential.  As a result, I'm guessing the ASM 
can't be eliminated entirely.  Now, with a Z80, which is a microprocessor, 
rather than a single-chip microcontroller, with no on-chip I/O or memory, 
requiring initialization of on-chip resources, one might do without ASM, 
right up to the point at which external hardware requires precise timing. 
If it doesn't, well, you can do everything in 'C'.
>
> -- 
> Richard.
> PGP Key-id: 0x5AB3D350
>
> God doesn't play dice.
> -- Albert Einstein
>
> -------------------------------------------------------------------------


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to