Prev: LPC2478 arm7tdmi 56mhz 8kb cache 32mb ram, jpeg decoding performance
Next: Help with this little program.
From: Rod Pemberton on 20 Nov 2009 17:50 "bartc" <bartc(a)freeuk.com> wrote in message news:XqvNm.6933$Ym4.1565(a)text.news.virginmedia.com... > "Rod Pemberton" <do_not_have(a)nohavenot.cmm> wrote in message > news:he4pjc$9us$1(a)aioe.org... > > > > How would you recommend coding a bytecode interpreter that works for > > 16-bit, 32-bit, and 64-bit x86? > > What, all together in the same program? Either way. > What, all together in the same program? Sure, why not? It may be slow, but it could be useful for bootstrapping an x86 OS independent of cpu mode. To fully implement useable subset of x86 instructions, one needs: 1) math operations on one of: register, stack, or memory 2) ability to move data between register and stack 3) (optionally) ability to move data between registers 4) (optionally) ability to move data between register and memory 5) ability to load constants IIRC, the x86 has enough older single byte instructions, whose encodings are identical in all three modes, to do that. The real problem is memory addressing, and/or loading of constants. That was why I pointed to the 16-bit/32-bit partial solution in the middle of this thread: http://groups.google.com/group/comp.lang.asm.x86/msg/ce546dada8708c27?hl=en Rod Pemberton PS. Added a.o.d. and a.l.a, since they said they were bored... |