Chromatix wrote:
Well, there have been some distractions…
As of tonight, I've implemented most of the expression parser. I still need to write routines for 32x32b multiplication and signed division, and add at least a PRINT statement so that it can all be tested conveniently. So far all output has been using VDU, which was much simpler to implement but is less convenient to use as a debugging aid. I expect testing and debugging to take a while in itself, since there's a lot of very flexible functionality just been added.
Good progress update, thanks.
Feel free to steal the code for mul & div from my stuff if you like - not the fastest, nor smallest, but as a "get you going" sort of thing it might help. My strategy has always been to check the signs of the numbers, make positive if negative (and set a flag), do the mul or div, then adjust the resulting sign based on the signs of the starting numbers. It's not as space efficient as it could be, but it's a solution I used in my BCPL system which seems to work well. (and the div code returns mod for free - could be optimised not to, but...)
Looking forward to trying it!
Cheers,
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/