Remix.run Logo
alexisread 3 days ago

Have you tried looking at Sectorforth?

In most languages branching is a fundamental construct, it's created here (with comments)

https://github.com/cesarblum/sectorforth/blob/master/example...

Effectively IF compiles a 0= ie. If false and then a dummy target address. THEN (aka ENDIF) compiles the real target address over the dummy one, which is the address after THEN.