Re: [cc65] 65816

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-04-17 09:44:40


On Tue, Apr 16, 2002 at 11:01:00PM -0400, Jeremy Turner wrote:
> What about inserting 816 opcodes into the C source (assuming you knew what
> you were doing) would that possibly work? (just for changing banks). If
> there was a way to access the memory, and not neccessarily run 16-bit
> instructions, I would be happy. Maybe write something equivalent to a EMM in
> DOS - some functiions you can call that support memory greater than $FFFF ?

The inline assembler does not support the 816 instructions. The reason lies in
the structure of the compiler. The frontend generates calls to the code
generator which generates an abstract notation of 6502 code. The optimizer
runs over this 6502 code. While this approach is not as portable, and while
having another stage of intermediate code would be a good idea (for doing
platform independent optimizations), it is the only good way to generate
decent 6502 code I know of.

Since the optimizer uses 6502 code (in a very abstract form), it cannot handle
anything, it does not know in this stage, which means that the inline
assembler will have to assure that. The disadvantage is that the capabilities
of the inline assembler are rather limited, for example, you cannot insert any
data into the code. On the other side this means that the optimizer will
handle inline assembler code the same as compiler generated code. I have had
several occasions where the optimizer even found a place or two where to
improved my own code.

Of course you can use the ca65 assembler to write C callable subroubtines that
implement an enhanced memory management. It would be nice however, to have a
portable interface for this purpose, that does not only support the extended
memory of an 816, but also REUs and other memory extensions that are in use on
common 6502 machines.

Regards


	Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-04-17 09:45:25 CEST