0 Members and 1 Guest are viewing this topic.
I don't care if people copy me. But the 83 idea should work. I don't see why it wouldn't. Too bad I have never seen an 83 in my life.
rst 20h add HL,SP ld E,A.db [program name] ld DE,$D53F ccf
I've been wondering, when you run a BASIC program the calculator parses as it goes right?If so wouldn't it be theoretically possible to just have another program parse a BASIC program and output it as an ASM program using the same method? (Kind of like Axe only just faster BASIC)
One thing: I can't imagine how large a BASIC program would become if it was translated to a compiled-style program but with the slowness of BASIC.
Quote from: DJ Omnimaga on November 04, 2010, 12:46:22 amOne thing: I can't imagine how large a BASIC program would become if it was translated to a compiled-style program but with the slowness of BASIC. If you compile BASIC, you're removing the overhead of the Interpreter which probably has to look through a database of all of the commands and execute the right one. Doing that ahead of time with a compiler would blow up your file size like Axe does, except that the compiled language would be even larger than an equivalent Axe program because of the floating point calculations.Some parts of the parser wouldn't be too difficult, such as the Pause command or the Vertical/Horizontal commands, because those are simply B_calls that you feed the arguments into through the registers.Thinking about it, one could potentially write a reasonably sized compiler/interpreter that would take some of those easy commands and turn them into Assembly library type commands.
The floating point math is definitely a weak point. Using floating point math for For( loops and in other places wastes a lot of CPU power. You'd need a way to inform your compiler that certain variables in certain places can be handled with 8- or 16-bit integer arithmetic.