anormal
Experienced Member
hi!,
I am doing some coding here for a script-language and a VM. I also want to implement this in older cpus (6202 and z80), if possible.
My original arch. design has 8 8bit generic registers (one for flags), and 2 16bit (PC and SP), able to address 64KB, generic arithmetic/logic operations, and the usual stuff (but simpler).
Now, I am in the process of generating code (I already coded lex/syntax tasks in these examples: http://rosettacode.org/wiki/Compiler).
And I was thinking maybe is a better idea to implement this via stack-based operations instead of reg-based (as the rosettacode example).
The scripts will be small routines linked to objects for a little rpg I am thinking, functions return address will work via stack as usual, I plan to use vars globably, so maybe I don't need to pass anything in the stack for function params.
People with experience in 6502/z80 coding, what do you think is better? I mean, space is more important than speed for this.
Maybe I need to implement the VM in these micros and run some tests?
Anything to think about before going to code specific code for these cpus? I'll implement first the VM in C for testing in my W10 machine.
I am doing some coding here for a script-language and a VM. I also want to implement this in older cpus (6202 and z80), if possible.
My original arch. design has 8 8bit generic registers (one for flags), and 2 16bit (PC and SP), able to address 64KB, generic arithmetic/logic operations, and the usual stuff (but simpler).
Now, I am in the process of generating code (I already coded lex/syntax tasks in these examples: http://rosettacode.org/wiki/Compiler).
And I was thinking maybe is a better idea to implement this via stack-based operations instead of reg-based (as the rosettacode example).
The scripts will be small routines linked to objects for a little rpg I am thinking, functions return address will work via stack as usual, I plan to use vars globably, so maybe I don't need to pass anything in the stack for function params.
People with experience in 6502/z80 coding, what do you think is better? I mean, space is more important than speed for this.
Maybe I need to implement the VM in these micros and run some tests?
Anything to think about before going to code specific code for these cpus? I'll implement first the VM in C for testing in my W10 machine.