Shop OBEX P1 Docs P2 Docs Learn Events
towards a P2 Virtual Machine using XBYTE and Subsystems — Parallax Forums

towards a P2 Virtual Machine using XBYTE and Subsystems

This is some experiment exploring possibilities of P2.
Overall goal is a self contained system like Taqoz with SD card using PC with Teraterm as terminal.
One aspect is about the virtual machine: I asked myself, what would be the most "natural way" to implement a dual stack machine (Yes, my implementation shall run Forth, once more) on P2? So, yes we have two index registers PTRA + PTRB for the stacks, but how about the program counter?
Well, why not try XBYTE, which has it's hidden PC, promises to give a fast interpreter and uses the microcache of the streamer.
Downside is, that you can only use XBYTE, if you dedicate it's cog to pure assembler.
XBYTE is new for me and I will have to learn much here. I will start a link-list in the next post about XBYTE.

So, if we want to use libraries from FlexProp or write some code in C, we have to have "intelligent" Subsystems in other Cogs. The question is, if this can be turned into a the benefit of overall throughput. After all it has not been too easy for me to make good use of additional COGs in the past. So at the moment, the idea is something like this:
COG0: Compiler, runs C code, compiles Forth to Bytecode
COG1: Serial buffered input
COG2: Console buffered output (?? process decimal output, string output ??)
COG3: SD Driver (?? with read ahead and write caching ??)
COG4: XBYTE Machine executing Bytecode
COG5, COG6: Spare XBYTE Machines executing Bytecode
COG7: VGA tile driver

I would be interested in your thoughts about such "intelligent subsystems". What is really helpful?
Christof

Comments

Sign In or Register to comment.