Labels as values and threaded-code interpretation

nazriel spam at dzfl.pl
Sun Jun 2 02:14:58 PDT 2013


On Saturday, 1 June 2013 at 05:29:28 UTC, Alex Rønne Petersen 
wrote:
> Hi,
>
> I'm sure this has been brought up before, but I feel I need to 
> bring it up again (because I'm going to be writing a 
> threaded-code interpreter): 
> http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
>
> This is an incredibly important extension. The final switch 
> statement is not a replacement because it doesn't allow the 
> programmer to store a label address directly into a code 
> stream, which is what's essential to write a threaded-code 
> interpreter.
>
> The Erlang folks went through hell just to use this feature; 
> see the 5th Q at: 
> http://www.erlang.org/doc/installation_guide/INSTALL-WIN32.html#Frequently-Asked-Questions
>

It would also solve the problem with IASM and being unable to 
address the labels in iasm

I noticed the problem when I tried to address the db'ed bytes.
http://dpaste.dzfl.pl/36bbd7d3

Commented out //mov dword ptr RAX, meh; ??? illustrates the 
problem.

Jumping to labels in IASM blocks seems to work ( 
http://dpaste.dzfl.pl/d9e47f70 ).

I guess we could have two chickens backed on the same fire ;)


More information about the Digitalmars-d mailing list