Re: Disassembling Pentium ColorForth

"Jeff Fox" <[email protected]>
Newsgroups gmane.comp.lang.forth.colorforth
Message-ID <[email protected]>
> 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 "# + ;"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.