Suggested patch for defmod
Stewart Brodie
stewart.brodie at pace.co.uk
Tue Apr 18 12:39:59 BST 2000
I suggest the following patch for defmod - this will make the code generated
by defmod safe for use by APCS 3/32 applications which wish to run on
pre-ARM6 core based processors.
*** ADFS::SBrodie5.$.Dev.Tools.Sources.GNU.defmod.601.!OSLib.Tools.DefMod.c.Objasm Sun Apr 02 13:32:46 2000
--- ADFS::SBrodie5.$.Dev.Tools.Sources.GNU.defmod.sources.c.objasm Tue Apr 18 12:33:13 2000
***************
*** 683,688 ****
--- 683,690 ----
{
reg = (nonx && !Set_Elem (0, s->value)) ? 0 : 1;
+ if ((rc = Emit2 (file, "MOV", SWI_Names [reg], "PC")) < 0)
+ goto finish;
if ((rc = Emit2 (file, "MRS", SWI_Names [reg], "CPSR")) < 0)
goto finish;
}
***************
*** 760,765 ****
--- 762,769 ----
/*If no value is wanted, or if R0 is required, leave R alone.*/
if (apcs32 && Set_Elem(def_FLAGS, s->value))
{
+ if ((rc = Emit2 (file, "MOV", "R", "PC")) < 0)
+ goto finish;
if ((rc = Emit2 (file, "MRS", "R", "CPSR")) < 0)
goto finish;
}
***************
*** 788,793 ****
--- 792,799 ----
/*If no value is wanted, or if R0 is required, leave R alone.*/
if (apcs32 && Set_Elem(def_FLAGS, s->value))
{
+ if ((rc = Emit2 (file, "MOV", "R", "PC")) < 0)
+ goto finish;
if ((rc = Emit2 (file, "MRS", "R", "CPSR")) < 0)
goto finish;
}
--
Stewart Brodie, Senior Software Engineer
Pace Micro Technology PLC
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom WWW: http://www.pacemicro.com/
More information about the oslib-team
mailing list