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

Re: [colorforth] Disassembling Pentium ColorForth


> I was wondering how that would pack on an F21.
> Is this right?

This is probably best:

       # - nop nop      \ -10 as 21-bit number
       9                \ nops for add w/ -number in T
       + jns label      \ jns can go in any slot on f21
       # + ret x        \ x doesn't matter
       58               \ "0" +10 +n -10
label  # + ret x        \ x can be used for something else
       65               \ "A" +n -10

>       nop nop nop #
>       -10
>       + jns label
>       nop nop nop #
>       58
>       + ret nop nop
> label nop nop nop #
>       65
>       ret

On F21 you can't load a 21-bit negative number as a literal
since memory is 20-bits without a "# -" or "# com" or
"n not" or "n invert" (whatever you want to call it)
macro to set sign (carry in 20-bit math).

Two + are the max one would need before a + on F21.
Since you need a "-" after the "#" to get a 21-bit
negative two nop fill out the word and the "+" goes
into slot 0 before a -IF in slot 1.

Your # at the end of the word would prevent prefetch
completely which isn't needed.  The fetch of the next
instruction will act like nops before the +.

Unless I edited it out by accident you forgot the +
from the "A"+ path.  And no nops are needed before the
last two + so they just pack as "# + ;"



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