develooper Front page | perl.perl6.internals | Postings from August 2001

Re: Opcode Dispatch

Thread Previous | Thread Next
Dan Sugalski
August 6, 2001 08:38
Re: Opcode Dispatch
Message ID:
At 01:47 AM 8/6/2001 -0400, Bryan C. Warnock wrote:
>Okay, next set of results.
>508 opcodes, arranged in a primary set of 255, and a secondary set of 253.
>The primary set contained the escape opcode (opcode 0), the null opcode
>(opcode 254), and the program termination opcode (opcode 255).  The
>secondary set was mapped onto opcodes 1 - 254.  (The opcodes themselves
>mapped onto the same set of 255 functions - the data, however, precluded
>calling the escape opcode from within an escaped opcode, and there was only
>one termination opcode present.)  Each of 254 distinct functions were one of
>7 randomly generated code sets, each of which consisted of code that was
>essential to the final output.  Functions 0 and 255 handled the secondary
>dispatch and the program termination, respectively.

Oh, right, one other thing.

We're going with a straightforward opcode numbering scheme. Opcodes get 
numbered from 0 to N, where N is a number larger than 0. :) The 
'predefined' opcode numbers will be guaranteed regardless of where you are 
in your code. The rest will be switched in lexically. (Odds are they'll all 
be switched in lexically in one big table, but that's an implementation 
detail... :)

Opcodes above a certain point, like perhaps 512 (don't hold me to this 
number), will be designated as 'noncore'. That'll mean a potential gap 
between the guaranteed and non-guaranteed opcodes, but that's fine, we can 
cope. We're all clever. We will guarantee that overridable opcodes will be 
looked up via the opcode table, but we won't guarantee the same thing for 
non-overridable ones. (Even if you can some places)

If someone/thing wants to put in an escaping mechanism, that's keen, but it 
does mean that all the escaping details will be handled by something other 
than the core.


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                      teddy bears get drunk

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About