|
@@ -36,7 +36,7 @@ Interface
|
|
|
procedure BuildReference(oper : tSparcoperand);
|
|
|
procedure BuildOperand(oper : tSparcoperand);
|
|
|
procedure BuildOpCode(instr : tSparcinstruction);
|
|
|
- procedure ReadAt(oper : tSparcoperand);
|
|
|
+ procedure ReadPercent(oper : tSparcoperand);
|
|
|
procedure ReadSym(oper : tSparcoperand);
|
|
|
procedure ConvertCalljmp(instr : tSparcinstruction);
|
|
|
procedure handlepercent;override;
|
|
@@ -93,7 +93,7 @@ Interface
|
|
|
end;
|
|
|
|
|
|
|
|
|
- procedure tSparcReader.ReadAt(oper : tSparcoperand);
|
|
|
+ procedure tSparcReader.ReadPercent(oper : tSparcoperand);
|
|
|
begin
|
|
|
{ check for ...@ }
|
|
|
if actasmtoken=AS_AT then
|
|
@@ -104,9 +104,9 @@ Interface
|
|
|
Consume(AS_AT);
|
|
|
if actasmtoken=AS_ID then
|
|
|
begin
|
|
|
- if upper(actasmpattern)='L' then
|
|
|
+ if upper(actasmpattern)='LO' then
|
|
|
oper.opr.ref.symaddr:=refs_lo
|
|
|
- else if upper(actasmpattern)='HA' then
|
|
|
+ else if upper(actasmpattern)='HI' then
|
|
|
oper.opr.ref.symaddr:=refs_hi
|
|
|
else
|
|
|
Message(asmr_e_invalid_reference_syntax);
|
|
@@ -158,8 +158,8 @@ Interface
|
|
|
Begin
|
|
|
oper.opr.Ref.Offset:=BuildConstExpression(false,true);
|
|
|
Consume(AS_RPAREN);
|
|
|
- if actasmtoken=AS_AT then
|
|
|
- ReadAt(oper);
|
|
|
+ if actasmtoken=AS_MOD then
|
|
|
+ ReadPercent(oper);
|
|
|
end;
|
|
|
exit;
|
|
|
End;
|
|
@@ -211,8 +211,8 @@ Interface
|
|
|
end;
|
|
|
end;
|
|
|
Consume(AS_RPAREN);
|
|
|
- if actasmtoken=AS_AT then
|
|
|
- ReadAt(oper);
|
|
|
+ if actasmtoken=AS_MOD then
|
|
|
+ ReadPercent(oper);
|
|
|
End;
|
|
|
AS_COMMA: { (, ... can either be scaling, or index }
|
|
|
Begin
|
|
@@ -247,42 +247,20 @@ Interface
|
|
|
actasmpattern[len]:='%';
|
|
|
c:=current_scanner.asmgetchar;
|
|
|
{ to be a register there must be a letter and not a number }
|
|
|
- if c in ['0'..'9'] then
|
|
|
- begin
|
|
|
- actasmtoken:=AS_MOD;
|
|
|
- end
|
|
|
- else
|
|
|
- begin
|
|
|
- while c in ['a'..'z','A'..'Z','0'..'9'] do
|
|
|
- Begin
|
|
|
- inc(len);
|
|
|
- actasmpattern[len]:=c;
|
|
|
- c:=current_scanner.asmgetchar;
|
|
|
- end;
|
|
|
- actasmpattern[0]:=chr(len);
|
|
|
- uppervar(actasmpattern);
|
|
|
- if (actasmpattern = '%ST') and (c='(') then
|
|
|
- Begin
|
|
|
- actasmpattern:=actasmpattern+c;
|
|
|
- c:=current_scanner.asmgetchar;
|
|
|
- if c in ['0'..'9'] then
|
|
|
- actasmpattern:=actasmpattern + c
|
|
|
- else
|
|
|
- Message(asmr_e_invalid_fpu_register);
|
|
|
- c:=current_scanner.asmgetchar;
|
|
|
- if c <> ')' then
|
|
|
- Message(asmr_e_invalid_fpu_register)
|
|
|
- else
|
|
|
- Begin
|
|
|
- actasmpattern:=actasmpattern + c;
|
|
|
- c:=current_scanner.asmgetchar; { let us point to next character. }
|
|
|
- end;
|
|
|
- end;
|
|
|
- if is_register(actasmpattern) then
|
|
|
- exit;
|
|
|
+ while c in ['a'..'z','A'..'Z','0'..'9'] do
|
|
|
+ Begin
|
|
|
+ inc(len);
|
|
|
+ actasmpattern[len]:=c;
|
|
|
+ c:=current_scanner.asmgetchar;
|
|
|
+ end;
|
|
|
+ actasmpattern[0]:=chr(len);
|
|
|
+ uppervar(actasmpattern);
|
|
|
+ if is_register(actasmpattern) then
|
|
|
+ exit;
|
|
|
+ if(actasmpattern='%HI')or(actasmpattern='%LO')then
|
|
|
+ actasmtoken:=AS_MOD
|
|
|
+ else
|
|
|
Message(asmr_e_invalid_register);
|
|
|
- actasmtoken:=raatt.AS_NONE;
|
|
|
- end;
|
|
|
end;
|
|
|
|
|
|
Procedure tSparcReader.BuildOperand(oper : tSparcoperand);
|
|
@@ -406,7 +384,8 @@ Interface
|
|
|
|
|
|
AS_INTNUM,
|
|
|
AS_MINUS,
|
|
|
- AS_PLUS:
|
|
|
+ AS_PLUS,
|
|
|
+ AS_MOD:
|
|
|
Begin
|
|
|
{ Constant memory offset }
|
|
|
{ This must absolutely be followed by ( }
|
|
@@ -467,7 +446,7 @@ Interface
|
|
|
else
|
|
|
begin
|
|
|
if oper.SetupVar(expr,false) then
|
|
|
- ReadAt(oper)
|
|
|
+ ReadPercent(oper)
|
|
|
else
|
|
|
Begin
|
|
|
{ look for special symbols ... }
|
|
@@ -715,7 +694,10 @@ initialization
|
|
|
end.
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.1 2003-12-08 13:02:21 mazen
|
|
|
+ Revision 1.2 2003-12-10 13:16:36 mazen
|
|
|
+ * improve hadlign %hi and %lo operators
|
|
|
+
|
|
|
+ Revision 1.1 2003/12/08 13:02:21 mazen
|
|
|
+ support for native sparc assembler reader
|
|
|
|
|
|
}
|