home .. forth .. colorforth mail list archive ..

[colorforth] 6502: MachineForth or traditional Forth?


On Saturday 06 March 2004 05:10 am, Eric Laforest wrote:
> Some Forth operations like 2* translate directly, and some like 2/
> don't:
>
> And then there are the signed and unsigned versions where it matters:
>
> Then double all that for double-cell numbers.
> It all adds up quickly.

I won't argue this, but inlining 2* and 2/, regardless of its bit width, 
doesn't necessarily make it a MachineForth.  QuartusForth, for example, 
for the PalmOS platform, is hardly a MachineForth, yet it too inlines 
primitives.

Also, this is just one more reason why you should develop for the 65816 
-- native support for 16-bit integers makes things MUCH simpler.  :)

> Not at all. Most of the time, the flags are ignored.

Every LD, DE, or IN instruction sets flags.  Every single one.  Since the 
stack operations must involve a LD, DE, or IN operation (e.g., if you 
use X as the stack pointer, then INX or DEX is quite often the last 
thing to run on every primitive), then that blows away your flags.

> The downside is that conditionnal branches are relative to +/-128
> bytes, and so the JMP words wrap them around a 'jmp' opcode to make
> conditional branching absolute.

Even my Forth cross-compiler for x86 uses +/- 128 byte jumps for 
everything except calls.  I find absolutely, positively zero need for 
anything longer.

Should we move this to the MachineForth mailing list to keep this more on 
topic?

--
Samuel A. Falvo II


---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com