I working a section of tight code (right now it runs that section at 40,000,000 times/second, goal is 100,000,000 on an Athlon 1200). What I need to do is create a special purpose jump table. Unfortunately I can't find the syntax that will work.
Here's the gist what I'm trying
var P: Pointer;
label CodeAddress;
begin
Some Code
CodeAddress:Some Code
Some Code
end;
What I've tried to do is
P:=CodeAddress , and
P:=@CodeAddress and
P:=Addr(CodeAddress) , but all of these report an error, assuming that either I'm declaring the label or that I'm trying to redeclare it. (BTW this is all within the same scope).
My second problem comes in here:
goto P;
This will not work, I could rewrite it in plain asm but is there another way to do it (the asm statement will mess up the optimizer [Delphi Enterprise])
Finally anyone know a way I could declare the array as a constant such that
label CodeAddress1,CodeAddress2;
const CodeAddresses:array[0..1]=(CodeAddress1,CodeAddress2);
Edited by - Michalson on March 21, 2002 4:34:07 PM