|
@@ -53,39 +53,21 @@ interface
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
- cutils,verbose;
|
|
|
+ cutils,verbose,rgbase;
|
|
|
|
|
|
const
|
|
|
- gas_regname_table : array[tregisterindex] of string[7] = (
|
|
|
+ gas_regname_table : TRegNameTable = (
|
|
|
{$i ravrstd.inc}
|
|
|
);
|
|
|
|
|
|
- gas_regname_index : array[tregisterindex] of tregisterindex = (
|
|
|
+ gas_regname_index : TRegisterIndexTable = (
|
|
|
{$i ravrsri.inc}
|
|
|
);
|
|
|
|
|
|
- function findreg_by_gasname(const s:string):tregisterindex;
|
|
|
- var
|
|
|
- i,p : tregisterindex;
|
|
|
- begin
|
|
|
- {Binary search.}
|
|
|
- p:=0;
|
|
|
- i:=regnumber_count_bsstart;
|
|
|
- repeat
|
|
|
- if (p+i<=high(tregisterindex)) and (gas_regname_table[gas_regname_index[p+i]]<=s) then
|
|
|
- p:=p+i;
|
|
|
- i:=i shr 1;
|
|
|
- until i=0;
|
|
|
- if gas_regname_table[gas_regname_index[p]]=s then
|
|
|
- findreg_by_gasname:=gas_regname_index[p]
|
|
|
- else
|
|
|
- findreg_by_gasname:=0;
|
|
|
- end;
|
|
|
-
|
|
|
|
|
|
function gas_regnum_search(const s:string):Tregister;
|
|
|
begin
|
|
|
- result:=regnumber_table[findreg_by_gasname(s)];
|
|
|
+ result:=regnumber_table[findreg_by_name_table(s,gas_regname_table,gas_regname_index)];
|
|
|
end;
|
|
|
|
|
|
|