mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 20:05:57 +02:00
support SP and FP alias in the assembler reader too
git-svn-id: trunk@27573 -
This commit is contained in:
parent
7ee09b9620
commit
5535df29d4
@ -201,12 +201,26 @@ const
|
|||||||
|
|
||||||
function tm68kmotreader.is_register(const s:string):boolean;
|
function tm68kmotreader.is_register(const s:string):boolean;
|
||||||
begin
|
begin
|
||||||
is_register:=false;
|
result:=false;
|
||||||
// FIX ME!!! Ugly, needs a proper fix (KB)
|
// FIX ME!!! '%'+ is ugly, needs a proper fix (KB)
|
||||||
actasmregister:=gas_regnum_search('%'+lower(s));
|
actasmregister:=gas_regnum_search('%'+lower(s));
|
||||||
if actasmregister<>NR_NO then
|
if actasmregister<>NR_NO then
|
||||||
begin
|
begin
|
||||||
is_register:=true;
|
result:=true;
|
||||||
|
actasmtoken:=AS_REGISTER;
|
||||||
|
end;
|
||||||
|
{ reg found?
|
||||||
|
possible aliases are always 2 char
|
||||||
|
}
|
||||||
|
if result or (length(s)<>2) then
|
||||||
|
exit;
|
||||||
|
if lower(s)='sp' then
|
||||||
|
actasmregister:=NR_STACK_POINTER_REG;
|
||||||
|
if lower(s)='fp' then
|
||||||
|
actasmregister:=NR_STACK_POINTER_REG;
|
||||||
|
if actasmregister<>NR_NO then
|
||||||
|
begin
|
||||||
|
result:=true;
|
||||||
actasmtoken:=AS_REGISTER;
|
actasmtoken:=AS_REGISTER;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1410,7 +1424,6 @@ const
|
|||||||
if expr = 'SELF' then
|
if expr = 'SELF' then
|
||||||
oper.SetupSelf
|
oper.SetupSelf
|
||||||
else begin
|
else begin
|
||||||
writeln('unknown id: ',expr);
|
|
||||||
Message1(sym_e_unknown_id,expr);
|
Message1(sym_e_unknown_id,expr);
|
||||||
end;
|
end;
|
||||||
expr:='';
|
expr:='';
|
||||||
@ -1459,7 +1472,6 @@ const
|
|||||||
end;
|
end;
|
||||||
{ // Register, a variable reference or a constant reference // }
|
{ // Register, a variable reference or a constant reference // }
|
||||||
AS_REGISTER: begin
|
AS_REGISTER: begin
|
||||||
// writeln('register! ',actasmpattern);
|
|
||||||
{ save the type of register used. }
|
{ save the type of register used. }
|
||||||
tempstr := actasmpattern;
|
tempstr := actasmpattern;
|
||||||
Consume(AS_REGISTER);
|
Consume(AS_REGISTER);
|
||||||
|
Loading…
Reference in New Issue
Block a user