mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 15:23:54 +02:00
+ handle the local and global variable instructions with a constant integer
parameter in twasmreader.HandlePlainInstruction
This commit is contained in:
parent
ea988e0b92
commit
95593f15dd
@ -843,6 +843,47 @@ Unit rawasmtext;
|
|||||||
result.operands[1].opr.typ:=OPR_CONSTANT;
|
result.operands[1].opr.typ:=OPR_CONSTANT;
|
||||||
result.operands[1].opr.val:=0;
|
result.operands[1].opr.val:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ instructions that take a local variable parameter (or index) }
|
||||||
|
a_local_get,
|
||||||
|
a_local_set,
|
||||||
|
a_local_tee:
|
||||||
|
case actasmtoken of
|
||||||
|
AS_INTNUM:
|
||||||
|
begin
|
||||||
|
result.operands[1].opr.typ:=OPR_CONSTANT;
|
||||||
|
result.operands[1].opr.val:=actinttoken;
|
||||||
|
Consume(AS_INTNUM);
|
||||||
|
end;
|
||||||
|
{TODO:AS_ID}
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ error: expected integer }
|
||||||
|
result.Free;
|
||||||
|
result:=nil;
|
||||||
|
Consume(AS_INTNUM);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
a_global_get,
|
||||||
|
a_global_set:
|
||||||
|
case actasmtoken of
|
||||||
|
AS_INTNUM:
|
||||||
|
begin
|
||||||
|
result.operands[1].opr.typ:=OPR_CONSTANT;
|
||||||
|
result.operands[1].opr.val:=actinttoken;
|
||||||
|
Consume(AS_INTNUM);
|
||||||
|
end;
|
||||||
|
{TODO:AS_ID}
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ error: expected integer }
|
||||||
|
result.Free;
|
||||||
|
result:=nil;
|
||||||
|
Consume(AS_INTNUM);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
internalerror(2024071401);
|
internalerror(2024071401);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user