comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Adapting an Ada compiler to generate 8051 code (Again?! ;-)
Date: Wed, 31 Mar 2021 11:23:25 +0300	[thread overview]
Message-ID: <iciprtFhlsoU1@mid.individual.net> (raw)
In-Reply-To: <s40555$6rp$1@gioia.aioe.org>

On 2021-03-31 0:28, Luke A. Guest wrote:
> On 30/03/2021 20:16, Paul Rubin wrote:
> 
>> Besides the approaches other people have mentioned, I don't know if
>> there are any really large obstacles to targeting GCC to the 8051, or to
> 
> The biggest obstacles will be the severe lack of registers. But it's 
> possible, lm78 for example.


The 8051 is not very register-poor: it has a main accumulator and a 
secondary accumulator and four sets of eight general-purpose registers. 
The 32 general-purpose registers occupy the first 32 bytes of the 
internal data memory. A compiler could also use all of the directly 
addressable 128 bytes of internal data memory as registers, although the 
instructions that can use those "registers" are a little longer and a 
little slower.

If there is a problem for gcc, it may be that all those registers are 
only 8 bits wide, and cannot be used to address external data memory 
(although some of them can be used as 8-bit offsets in paged memory 
accesses). Only the Data Pointer Register (or registers, in newer 
variants) is wider and can be used to address external data memory.

  parent reply	other threads:[~2021-03-31  8:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  9:04 Adapting an Ada compiler to generate 8051 code (Again?! ;-) mockturtle
2021-03-30  9:56 ` Dmitry A. Kazakov
2021-03-30 11:24   ` Gautier write-only address
2021-03-30 11:27   ` mockturtle
2021-03-30 12:01     ` Dmitry A. Kazakov
2021-03-31 23:08       ` Randy Brukardt
2021-03-31 23:06   ` Randy Brukardt
2021-03-30 10:40 ` Niklas Holsti
2021-03-30 11:32   ` mockturtle
2021-03-31 23:14   ` Randy Brukardt
2021-04-01 15:07     ` Niklas Holsti
2021-04-01 23:34       ` Randy Brukardt
2021-03-30 11:24 ` Luke A. Guest
2021-03-30 13:28   ` Luke A. Guest
2021-03-30 12:45 ` Björn Lundin
2021-03-30 15:49 ` Shark8
2021-03-30 19:16 ` Paul Rubin
2021-03-30 21:28   ` Luke A. Guest
2021-03-30 21:48     ` Paul Rubin
2021-03-31  4:46       ` Luke A. Guest
2021-03-31  7:19         ` Simon Wright
2021-03-31 23:20         ` Randy Brukardt
2021-04-01 12:22           ` Luke A. Guest
2021-04-01 23:43             ` Randy Brukardt
2021-04-02  0:41               ` Luke A. Guest
2021-03-31  8:23     ` Niklas Holsti [this message]
2021-03-31 20:46 ` Gautier write-only address
2021-03-31 21:14   ` Shark8
2021-03-31 21:25     ` Gautier write-only address
2021-03-31 21:46       ` Shark8
2021-03-31 23:22       ` Randy Brukardt
2021-04-01 13:19   ` Luke A. Guest
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox