|
@@ -384,9 +384,10 @@ Unit raarmgas;
|
|
|
|
|
|
|
|
|
|
var
|
|
var
|
|
- tempreg : tregister;
|
|
|
|
|
|
+ tempreg,ireg : tregister;
|
|
hl : tasmlabel;
|
|
hl : tasmlabel;
|
|
ofs : longint;
|
|
ofs : longint;
|
|
|
|
+ registerset : tcpuregisterset;
|
|
Begin
|
|
Begin
|
|
expr:='';
|
|
expr:='';
|
|
case actasmtoken of
|
|
case actasmtoken of
|
|
@@ -396,6 +397,13 @@ Unit raarmgas;
|
|
BuildReference(oper);
|
|
BuildReference(oper);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ AS_HASH: { Constant expression }
|
|
|
|
+ Begin
|
|
|
|
+ Consume(AS_HASH);
|
|
|
|
+ BuildConstantOperand(oper);
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ (*
|
|
AS_INTNUM,
|
|
AS_INTNUM,
|
|
AS_MINUS,
|
|
AS_MINUS,
|
|
AS_PLUS:
|
|
AS_PLUS:
|
|
@@ -413,7 +421,7 @@ Unit raarmgas;
|
|
else
|
|
else
|
|
BuildReference(oper);
|
|
BuildReference(oper);
|
|
end;
|
|
end;
|
|
-
|
|
|
|
|
|
+ *)
|
|
AS_ID: { A constant expression, or a Variable ref. }
|
|
AS_ID: { A constant expression, or a Variable ref. }
|
|
Begin
|
|
Begin
|
|
{ Local Label ? }
|
|
{ Local Label ? }
|
|
@@ -519,7 +527,8 @@ Unit raarmgas;
|
|
BuildReference(oper);
|
|
BuildReference(oper);
|
|
end;
|
|
end;
|
|
|
|
|
|
- AS_REGISTER: { Register, a variable reference or a constant reference }
|
|
|
|
|
|
+ { Register, a variable reference or a constant reference }
|
|
|
|
+ AS_REGISTER:
|
|
Begin
|
|
Begin
|
|
{ save the type of register used. }
|
|
{ save the type of register used. }
|
|
tempreg:=actasmregister;
|
|
tempreg:=actasmregister;
|
|
@@ -534,6 +543,38 @@ Unit raarmgas;
|
|
else
|
|
else
|
|
Message(asmr_e_syn_operand);
|
|
Message(asmr_e_syn_operand);
|
|
end;
|
|
end;
|
|
|
|
+
|
|
|
|
+ { Registerset }
|
|
|
|
+ AS_LSBRACKET:
|
|
|
|
+ begin
|
|
|
|
+ consume(AS_LSBRACKET);
|
|
|
|
+ registerset:=[];
|
|
|
|
+ while true do
|
|
|
|
+ begin
|
|
|
|
+ if actasmtoken=AS_REGISTER then
|
|
|
|
+ begin
|
|
|
|
+ include(registerset,actasmregister);
|
|
|
|
+ tempreg:=actasmregister;
|
|
|
|
+ consume(AS_REGISTER);
|
|
|
|
+ if actasmtoken=AS_MINUS then
|
|
|
|
+ begin
|
|
|
|
+ consume(AS_MINUS);
|
|
|
|
+ for ireg:=tempreg to actasmregister do
|
|
|
|
+ include(registerset,ireg);
|
|
|
|
+ consume(AS_REGISTER);
|
|
|
|
+ end;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ consume(AS_REGISTER);
|
|
|
|
+ if actasmtoken=AS_COMMA then
|
|
|
|
+ consume(AS_COMMA)
|
|
|
|
+ else
|
|
|
|
+ break;
|
|
|
|
+ end;
|
|
|
|
+ consume(AS_RSBRACKET);
|
|
|
|
+ oper.opr.typ:=OPR_REGSET;
|
|
|
|
+ oper.opr.regset:=registerset;
|
|
|
|
+ end;
|
|
AS_END,
|
|
AS_END,
|
|
AS_SEPARATOR,
|
|
AS_SEPARATOR,
|
|
AS_COMMA: ;
|
|
AS_COMMA: ;
|
|
@@ -586,13 +627,7 @@ Unit raarmgas;
|
|
if operandnum>Max_Operands then
|
|
if operandnum>Max_Operands then
|
|
Message(asmr_e_too_many_operands)
|
|
Message(asmr_e_too_many_operands)
|
|
else
|
|
else
|
|
- begin
|
|
|
|
- { condition operands doesn't set the operand but write to the
|
|
|
|
- condition field of the instruction
|
|
|
|
- }
|
|
|
|
- if instr.Operands[operandnum].opr.typ<>OPR_NONE then
|
|
|
|
- Inc(operandnum);
|
|
|
|
- end;
|
|
|
|
|
|
+ Inc(operandnum);
|
|
Consume(AS_COMMA);
|
|
Consume(AS_COMMA);
|
|
end;
|
|
end;
|
|
AS_SEPARATOR,
|
|
AS_SEPARATOR,
|
|
@@ -604,8 +639,6 @@ Unit raarmgas;
|
|
BuildOperand(instr.Operands[operandnum] as tarmoperand);
|
|
BuildOperand(instr.Operands[operandnum] as tarmoperand);
|
|
end; { end case }
|
|
end; { end case }
|
|
until false;
|
|
until false;
|
|
- if (operandnum=1) and (instr.Operands[operandnum].opr.typ=OPR_NONE) then
|
|
|
|
- dec(operandnum);
|
|
|
|
instr.Ops:=operandnum;
|
|
instr.Ops:=operandnum;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -662,7 +695,7 @@ Unit raarmgas;
|
|
begin
|
|
begin
|
|
for icond:=low(tasmcond) to high(tasmcond) do
|
|
for icond:=low(tasmcond) to high(tasmcond) do
|
|
begin
|
|
begin
|
|
- if copy(hs,1,2)=cond2str[icond] then
|
|
|
|
|
|
+ if copy(hs,1,2)=uppercond2str[icond] then
|
|
begin
|
|
begin
|
|
actcondition:=icond;
|
|
actcondition:=icond;
|
|
{ strip condition }
|
|
{ strip condition }
|
|
@@ -750,6 +783,9 @@ initialization
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.1 2003-11-17 23:23:47 florian
|
|
|
|
|
|
+ Revision 1.2 2003-11-21 16:29:26 florian
|
|
|
|
+ * fixed reading of reg. sets in the arm assembler reader
|
|
|
|
+
|
|
|
|
+ Revision 1.1 2003/11/17 23:23:47 florian
|
|
+ first part of arm assembler reader
|
|
+ first part of arm assembler reader
|
|
}
|
|
}
|