public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Porting GCC to 8051 Microcontroller
@ 2008-05-07  7:50 Ganesh
  2008-05-07  7:57 ` Fabian Cenedese
  2008-05-07  9:55 ` Andrew Haley
  0 siblings, 2 replies; 8+ messages in thread
From: Ganesh @ 2008-05-07  7:50 UTC (permalink / raw)
  To: gcc-help

I am planning to do GCC porting for 8051 Microcontroller.
 
Kindly send me the steps involved in this project.
 
Regards,
Ganesh

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Porting GCC to 8051 Microcontroller
@ 2008-05-09 15:28 Duane Ellis
  0 siblings, 0 replies; 8+ messages in thread
From: Duane Ellis @ 2008-05-09 15:28 UTC (permalink / raw)
  To: gcc-help

andrew>> I've been thinking about this some more.  I 
andrew>> suspect you could get good results by 
andrew>> generating not 8051 assembly language,
andrew>> which would be gross, but a simple bytecode engine.

I know this for a fact :-) in a previous life we modeled 
the one we did off the instruction set like the MIPS. 
Why? Simple - it has to do with the way the flags 
register is done.

On some CPUs - when you add "r0 + r1" => r2, you either
*must* update the flags (zero, carry, overflow) or not.
having to maintain that in a simulator is added wasteful 
steps that you often do not need...

For example the test:

	if( a == b ){
		do_this();
	}

For us the opcodes became:
   test  r1=r2    ;; test(r1==r2)
   braf  +4	   ; branch if false
   jsr24 do_this   ; 24bit relative call.

This simplified the interpretation code and was a 
huge performance win on a 6502 @ 1mhz.

The simulation engine was a big 6502 switch statement.

In effect, the 6502 was a micro-code engine :-)

-Duane.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-05-09 10:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-07  7:50 Porting GCC to 8051 Microcontroller Ganesh
2008-05-07  7:57 ` Fabian Cenedese
2008-05-07 11:48   ` Ganesh
2008-05-07  9:55 ` Andrew Haley
2008-05-07 10:03   ` Ganesh
2008-05-07 10:15     ` Andrew Haley
2008-05-09 10:35       ` Andrew Haley
2008-05-09 15:28 Duane Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).