Hacker News new | ask | show | jobs
by tjalfi 2172 days ago
This is a neat project, thanks for writing it up.

Does the Retroputer instruction set have an equivalent to the x86 ja instruction?

If so, here is a trick[0] that can be used for optimizing character class checks.

low <= x <= high is equivalent to x - low u<= high - low

[0] Chapter 4 - Arithmetic Bounds of Hacker's Delight by Henry Warren

1 comments

Oooh -- good idea. I don't think I have an instruction that quite matches. Retroputer's branch instructions are directly tied to the flags, so you can do `br !c(arry)`, but that doesn't rule out zero like `ja` does. At a quick glance I don't think that should rule something like this out, though. :-)

That looks like a really interesting book -- I think I shall add it to my reading list!