[courses] [c] lesson 11: enumerating boolean/hacking vim

Peter Clay pete at flatline.org.uk
Fri Nov 15 16:42:37 EST 2002


On Fri, 15 Nov 2002, Julie wrote:

> Size isn't everything.  No, really, it isn't ;-)  Perhaps
> 20 or 30 years ago when memory was entirely too scarce, sure.
> Four bytes out of a 4KB memory might have been very meaningful,
> but 4 bytes out of 1GB ... I think not.

OTOH, I've recently been writing code for PIC microcontrollers
(http://www.microchip.com) which have 128 bytes of RAM. It's not a lot,
but they do only cost $1 :)

> There's more to economy than counting bytes.  For example,
> if you pass a (char) parameter, you're still very likely
> passing an (int) because the stack has to be word (32-bit
> or 64-bit) aligned.  Except that now the compiler might be
> emitting some weird instruction to sign-extend or clear
> your (char) into an (int).  So now instead of a single
> simple move-word instruction you're running a load, sign-extend,
> move-word sequence.  Amusing, no?

Yup :)

Pete
-- 
Peter Clay                                         | Campaign for   _  _| .__
                                                   | Digital       /  / | |
                                                   | Rights!       \_ \_| |
                                                   | http://uk.eurorights.org




More information about the Courses mailing list