Deutsch   English   Français   Italiano  
<vc9o5a$2uqam$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.arch
Subject: Re: Computer architects leaving Intel...
Date: Mon, 16 Sep 2024 18:59:21 +0200
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <vc9o5a$2uqam$2@dont-email.me>
References: <vaqgtl$3526$1@dont-email.me>
 <memo.20240830090549.19028u@jgd.cix.co.uk>
 <2024Aug30.161204@mips.complang.tuwien.ac.at> <86r09ulqyp.fsf@linuxsc.com>
 <2024Sep8.173639@mips.complang.tuwien.ac.at>
 <p1cvdjpqjg65e6e3rtt4ua6hgm79cdfm2n@4ax.com>
 <2024Sep10.101932@mips.complang.tuwien.ac.at> <ygn8qvztf16.fsf@y.z>
 <2024Sep11.123824@mips.complang.tuwien.ac.at> <vbsoro$3ol1a$1@dont-email.me>
 <vbut86$9toi$1@dont-email.me> <vbvljl$ea0m$1@dont-email.me>
 <vc1lqs$u8cm$1@dont-email.me> <vc1n9r$ufpc$1@dont-email.me>
 <vc2t1i$18pi2$1@dont-email.me> <vc7bdr$2a405$3@dont-email.me>
 <vc7sh4$2empo$2@dont-email.me> <vc93qf$2q30n$1@dont-email.me>
 <vc9j61$2tsab$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 16 Sep 2024 18:59:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0f501a25988d16ea2f32567a651b5888";
	logging-data="3107158"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19S0vJ3hsZP1WYRt5yt4GvPY3PFTyExdAU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:KTK0aHlbppTL76ngj7JtnujlRK0=
In-Reply-To: <vc9j61$2tsab$2@dont-email.me>
Content-Language: en-GB
Bytes: 3795

On 16/09/2024 17:34, Thomas Koenig wrote:
> David Brown <david.brown@hesbynett.no> schrieb:
> 
>> The GCC community would be quite happy to support such targets, but
>> someone would need to make the port.  And the architecture of the gcc
>> compiler suite is best suited to processors with reasonably regular and
>> orthogonal ISAs with plenty of registers and at least 16-bit width -
>> getting good results for a cpu like the 6502 from gcc would be an
>> extraordinary level of effort.  It makes a lot more sense to look at
>> tools like SDCC with an architecture that fits better.
> 
> Native compilation of gcc on a 6502 would be... interesting.
> 

The 6502 would be a target, rather than a host!

Of course there were C compilers, and many other languages, running on 
the 6502 BBC Micro and BBC Master computers.  But those tools were a bit 
more compact that gcc :-)

> But I think an adaption of gcc to a 6502 could actually work if
> the zero page was treated as 128 16-bit registers.  Not going
> there, though :-)

That would be a starting point, yes.  But I would not use the whole zero 
page there - perhaps just the first 32 bytes (and therefore 16 16-bit 
registers).  Having a huge register bank would make function calls tough 
when you have to stack all the callee-saved registers in your one-page 
stack!

With 16 register pairs, you would get you close to how the AVR is 
treated in gcc - it has 32 8-bit registers which are, for many purposes, 
handled in pairs by the compiler.  (Lowering ALU operations on 16-bit 
register pairs to 8-bit operations on single registers is done mostly as 
peephole optimisations at the backend.)


Someone did manage to get Linux running on an 8-bit AVR (by having the 
AVR run an ARM emulator, and using ARM Linux).  I'm sure the same 
technique could be used to host Linux on a 6502 and run gcc on it, 
though you might not consider that "native".  And "run" might be a bit 
of a misnomer - the AVR was a lot faster than a 6502, and it took 6 
hours to boot to login.

<https://dmitry.gr/?r=05.Projects&proj=07.%20Linux%20on%208bit>