You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i tbranches @ tdp @ = ifi tbranches @ shortcut and
then
is by construction (i tbranches @ == tdp @) equivalent to
i tbranches @ tdp @ = if
tdp @ shortcut and
then
which doesn't make sense, as it attempts to shortcut an instruction yet unwritten.
If I understand the code correctly, this is supposed to mean "if an instruction at address i branches to here (as would happen if the last word in a word definition is then), then apply the return-hack to that instruction". The correct if-statement in this case would be something like
i tbranches @ tdp @ = ifi shortcut and
then
if I am not mistaken.
P.S. "shortcut" for this case should probably also replace unconditional-jump to exit location with "exit".
P.P.S. Could the enclosing do-loop be changed from tdp @ 0 to tdp @ wordstart @?
The text was updated successfully, but these errors were encountered:
https://github.com/jamesbowman/swapforth/blob/master/j1a/cross.fs#L167
AFAICT, this piece of code means "If any of the previous instructions branches to end-of-word, do a return trick on it."
However,
is by construction (
i tbranches @
==tdp @
) equivalent towhich doesn't make sense, as it attempts to shortcut an instruction yet unwritten.
If I understand the code correctly, this is supposed to mean "if an instruction at address
i
branches to here (as would happen if the last word in a word definition isthen
), then apply the return-hack to that instruction". The correct if-statement in this case would be something likeif I am not mistaken.
P.S. "shortcut" for this case should probably also replace unconditional-jump to exit location with "exit".
P.P.S. Could the enclosing do-loop be changed from
tdp @ 0
totdp @ wordstart @
?The text was updated successfully, but these errors were encountered: