gnupic: Quick port of Janusz J. Mlodzianowski's MediumC to linux
Subject:
Re: Quick port of Janusz J. Mlodzianowski's MediumC to linux
From:
"w. v. ooijen / f. hanneman" ####@####.####
Date:
8 Sep 2000 20:31:36 -0000
Message-Id: <200009082033.WAA07009@smtp1.xs4all.nl>
(more on stack-like code generation being impractical for a PIC)
consider
byte a,b,c
a = b + c
good PIC code would be (3 instructions)
movfw c
addwf b, f
movwf a
stack-oriented code would be
push c
push b
add
pop a
or
push c
add b
pop a
stack-oriented code for a PIC, with calls (6 instructions, but calling all
the push etc routines takes 24 instructions execution!)
movlw _c
call push
movlw _b
call add
movlw _a
call pop
inline stack-oriented PIC code would be faster, but takes (much) more
instructions.
So: stack-oriented code generation for PICs is possible, but would you want
to use a compiler that generates code that is either 2 * the size and 6 *
as slow as 'decent' code?
Wouter