When defining a colon word which contains other colon words, the codeword definition doesn't seem to point to the correct address. It appears to point to docol in each case, but I think it might need to point to the next memory address right after that (+4).
Example:
: dup sp@ @ ; ok
: invert dup nand ; ok
0 invert<??crash??>
Technically this invert should take the top stack value, duplicate it, then uses nand to bitwise AND and NOT the two identical values, thus inverting them, thus giving -1 (or 0xFFFFFFFF).
When defining a colon word which contains other colon words, the
codeword
definition doesn't seem to point to the correct address. It appears to point todocol
in each case, but I think it might need to point to the next memory address right after that (+4).Example:
Technically this
invert
should take the top stack value, duplicate it, then usesnand
to bitwiseAND
andNOT
the two identical values, thus inverting them, thus giving-1
(or0xFFFFFFFF
).