Re: Firing up a FIG-Forth
Posted: Tue May 29, 2012 2:41 pm
cjb wrote:
Dr Jefyll wrote:
cjb wrote:
MEM can't be greater than $7F00. The words that scan and add to the dictionary do signed comparisons with pointers.
Code: Select all
MEM = $6E00 ;top of assigned memory+1 byte.
UAREA = MEM-128 ;128 bytes of user area
DAREA = UAREA-BMAG ;disk buffer space.It's clearly my U* routine.
You can see from this trace:
Code: Select all
0F15 BASE 0976 98 01F4 S:0001 0000 0002
0F17 @ 0785 96 01F4 S:3FA6 0001 0000 0002
0F19 U* 052F 96 01F4 S:000A 0001 0000 0002
0F1B D+ 06BE 96 01F4 S:0000 0000 0000 0002
0F1D DPL 097F 9A 01F4 S:0000 0002
It's just started to convert "123". You can see if found the "1", and converted it to 1 via DIGIT. I'm not sure what the double 0000 0002 is at this point. Then it fetches the BASE (10 is this case) and calls U*. But 0A * 01 is not 00. I guess U* takes two singles, and multiplies then unsigned in to an unsigned double. So, in theory the result should be 0000 000A, but instead it's zero.
However, note right after that D+ appears to work in this case.
So, it's certainly in U* at this point. Unfortunately, binary multiplication is not my strong suit. I haven't sussed out the issue here yet. ROL looks good, unless the flags are wrong. The rest are reasonably proven instructions. All of the work is in memory, rather than in registers, that makes it a little more difficult to trace.
Anyway, more digging.