This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]


> The 8051 is a pure 8 bit CPU. You need a 16 bit compiler. Can gcc be a 16
> bit compiler? And you still have a lot of internal special features which

Sure it can. There are already some ports to 16 bit and 8/16 bit cpus.

> are speaking against a not specialized compiler. It is difficult enough to
> write assembler code for the 8031/51/535 family because there's not the
> slightest support of 16 bit arithmetic like the Z80 it has. 

Well, that drudgery can be done by the compiler.  Of course, the register
allocation is not likely to be optimal.  Expect somewhat larger and slower
programs that what the average assembler programmer does.

> Assembler programmers try to lay array so, that they do not cross page
> boundaries, this speeds up code by a factor between 1.8 and 3.

That would be a job for the linker.  And gcc might want to emit
special relocations that allow to tailor the code for sucess / failure of
the array alignment.  It's not trivial, but it can be done.

> There are specialized C compilers for the 8051, so you can control the
> code generation. It's something like _near, _far and _huge in MS-DOS.

That would need quite a lot of work to do with gcc.  We do have provisions
for machine dependent attributes, but we use a single mode for all
pointers (Pmode).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]