Hi, In the AZTEC C compiler could generate either 6502 assembly or a code for a 16 bits virtual processor. As far as I can remember, this virtual processor was 16bits easy to implement. I'm not sure but I think that this code takes it's source in Vozniak sweet16... Perhaps it could be a starting point for a future virtual machine. The old AZTEC C is available somewhere for download (I don’t remember where) :( -- didier -----Message d'origine----- De : owner-cbm-hackers@musoftware.de [mailto:owner-cbm-hackers@musoftware.de] De la part de Gábor Lénárt Envoyé : mercredi 26 octobre 2011 17:51 À : cbm-hackers@musoftware.de Objet : design a simple "bytecode" Hi All, I have the idea that I want some programs which run on 6502 (and similar) and Z80 CPUs as well. So I need to have some kind of bytecode, which can be imagined as the machine code of an imagined CPU. That code must be simple to be translated easily for the target CPU with the maximal possible performance (even for the "runtime compiling" and the peformance of the native code I will have then). The file format should have: no self-modification, data/code cannot be mixed, so easy automatic compilation can be done. It would be great to have nice performance with both of Z80 and 6502. There is some kind of "OS" behind it, so it's not a problem that direct hardware accessing is not possible (as they can be quite different on machines even using the same CPU): the code itself just calls "OS functions" identified by a number, for example. 6502 has the advantage of "zero page", so I would like to see similar feature of the bytecode as well, I can simply name those as "registers" just I have more than an average 8 bit CPU :) On 6502 this maps to the zero page locations, on Z80, well, not: they will be regular memory addresses. It was just an example: if we have some advantage/feature of one of the target CPUs, it would be nice to use, especially if it's not a disadvantage on the other CPU (even if it does not mean advantage there). My question: is there any existing project having these goals? I don't want reinvent the wheel ... thanks, - Gábor Message was sent through the cbm-hackers mailing list Message was sent through the cbm-hackers mailing listReceived on 2011-10-26 19:00:27
Archive generated by hypermail 2.2.0.