mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 21:40:34 +02:00
+ handle 0 operand instructions in the z80 asm reader
git-svn-id: branches/z80@44802 -
This commit is contained in:
parent
407d19560c
commit
383e834324
@ -81,7 +81,8 @@ Unit raz80asm;
|
||||
Function is_asmdirective(const s: string):boolean;
|
||||
function is_register(const s:string):boolean;
|
||||
function is_targetdirective(const s: string):boolean;
|
||||
//procedure handleopcode;override;
|
||||
procedure BuildOpCode(instr:TZ80Instruction);
|
||||
procedure handleopcode;
|
||||
//procedure BuildReference(oper : tz80operand);
|
||||
//procedure BuildOperand(oper : tz80operand);
|
||||
//procedure BuildOpCode(instr : tz80instruction);
|
||||
@ -784,6 +785,34 @@ Unit raz80asm;
|
||||
end;
|
||||
|
||||
|
||||
procedure tz80reader.BuildOpCode(instr: TZ80Instruction);
|
||||
begin
|
||||
instr.opcode:=actopcode;
|
||||
Consume(AS_OPCODE);
|
||||
{ Zero operand opcode ? }
|
||||
if actasmtoken in [AS_SEPARATOR,AS_END] then
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
||||
procedure tz80reader.handleopcode;
|
||||
var
|
||||
instr: TZ80Instruction;
|
||||
begin
|
||||
instr:=TZ80Instruction.create(TZ80Operand);
|
||||
BuildOpcode(instr);
|
||||
with instr do
|
||||
begin
|
||||
//CheckNonCommutativeOpcodes;
|
||||
//AddReferenceSizes;
|
||||
//SetInstructionOpsize;
|
||||
//CheckOperandSizes;
|
||||
ConcatInstruction(curlist);
|
||||
end;
|
||||
instr.Free;
|
||||
end;
|
||||
|
||||
|
||||
//procedure tz80reader.ReadSym(oper : tz80operand);
|
||||
// var
|
||||
// tempstr, mangledname : string;
|
||||
@ -1317,6 +1346,11 @@ Unit raz80asm;
|
||||
Consume(AS_SEPARATOR);
|
||||
end;
|
||||
|
||||
AS_OPCODE:
|
||||
begin
|
||||
HandleOpCode;
|
||||
end;
|
||||
|
||||
else
|
||||
begin
|
||||
Message(asmr_e_syntax_error);
|
||||
|
Loading…
Reference in New Issue
Block a user