Re: [colorforth] Understanding the x18 instruction jump table
- Subject: Re: [colorforth] Understanding the x18 instruction jump table
- From: "Helen Austin" <gwenhwyfaer@xxxxxxxxx>
- Date: Wed, 14 Jun 2006 23:02:13 +0100
On 6/14/06, John Drake <jmdrake_98@xxxxxxxxx> wrote:
I'm aware of the "32 words - one for every 5-bit
opcode" part. I guess that's why I found the
repeated instructions a bit odd. It's also
different from what was reported in Chuck's
paper on the subject.
: inst ( n ) 1 slot +! 1f and jump ret nul call
jmp nul nul jz jns n @+ @b @a !r !+ !b !a
+* 2* 2/ - + and or drop dup over pop a nul
b! push a!
Well... I'm going to hazard a guess here.
jmp and ret are the same operation; they just get their operand from
different places. jmp gets it inline and ret gets it from the return
stack. Perhaps this has been generalised across all control-flow words
now, to provide "conditional return" instructions as well as a
coroutine instruction?
That would also explain where ; went; and if an LSB of 0 means "find
the destination on the return stack", that would explain why ; becomes
"4 [ ip ] +".
Just some completely random, unfounded speculation :)
Regards
Helen
---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com