Re: [cc65] The most critical operations of the C runtime

From: Greg King <greg.king41verizon.net>
Date: 2007-09-20 14:46:39
From: "Emanuele Fornara"; on Thursday, September 13, 2007; at 03:36 AM -0400
>
> As some of you might remember, I'm writing a 6502 Virtual Machine.
> I was thinking about accelerating the most critical routines
> of the C runtime.
> The idea is NOT to extend the CPU with custom opcodes,
> but to use the "IO" chip.
> Something like this:
>
> runtime_operation:
>   STA CC65OP1 ; operand 1, if necessary
>   STX CC65OP2 ; operand 2, if necessary
>   LDX #CC65_???
>   STX CC65OPC ; operation code; triggers operation
>   LDA CC65RES ; operation result, if necessary
>   RTS
>
> I have no access to the CPU registers; but, I have access to the memory,
> and I can assume a specific layout for page 0.  I cannot bloat the code
> of the "IO" chip too much; ideally, I'm looking for 5-10 operations to
> accelerate.

Obviously, the multiplication, division, and modulus subroutines can benefit
from a virtual co-processor.  Also, some of the more "complex" stack
routines could be moved into that "chip" -- the routines that do indexing
and indirect loads/stores.  They are used alot, to handle pointers, arrays,
and structures.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Sep 20 14:48:00 2007

This archive was generated by hypermail 2.1.8 : 2007-09-20 14:48:03 CEST