|
@@ -158,9 +158,16 @@ implementation
|
|
Instruction table
|
|
Instruction table
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|
|
|
|
|
|
|
|
+ type
|
|
|
|
+ TInsTabCache=array[TasmOp] of longint;
|
|
|
|
+ PInsTabCache=^TInsTabCache;
|
|
|
|
+
|
|
const
|
|
const
|
|
InsTab:array[0..instabentries-1] of TInsEntry={$i z80tab.inc}
|
|
InsTab:array[0..instabentries-1] of TInsEntry={$i z80tab.inc}
|
|
|
|
|
|
|
|
+ var
|
|
|
|
+ InsTabCache : PInsTabCache;
|
|
|
|
+
|
|
{*****************************************************************************
|
|
{*****************************************************************************
|
|
taicpu Constructors
|
|
taicpu Constructors
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|
|
@@ -475,13 +482,40 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+{****************************************************************************
|
|
|
|
+ Instruction table
|
|
|
|
+*****************************************************************************}
|
|
|
|
+
|
|
|
|
+ procedure BuildInsTabCache;
|
|
|
|
+ var
|
|
|
|
+ i : longint;
|
|
|
|
+ begin
|
|
|
|
+ new(instabcache);
|
|
|
|
+ FillChar(instabcache^,sizeof(tinstabcache),$ff);
|
|
|
|
+ i:=0;
|
|
|
|
+ while (i<InsTabEntries) do
|
|
|
|
+ begin
|
|
|
|
+ if InsTabCache^[InsTab[i].OPcode]=-1 then
|
|
|
|
+ InsTabCache^[InsTab[i].OPcode]:=i;
|
|
|
|
+ inc(i);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
procedure InitAsm;
|
|
procedure InitAsm;
|
|
begin
|
|
begin
|
|
|
|
+ if not assigned(instabcache) then
|
|
|
|
+ BuildInsTabCache;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure DoneAsm;
|
|
procedure DoneAsm;
|
|
begin
|
|
begin
|
|
|
|
+ if assigned(instabcache) then
|
|
|
|
+ begin
|
|
|
|
+ dispose(instabcache);
|
|
|
|
+ instabcache:=nil;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
begin
|
|
begin
|