Reenable register variables
git-svn-id: svn://svn.cc65.org/cc65/trunk@1625 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -134,7 +134,7 @@ static const char* GetLabelName (unsigned Flags, unsigned long Label, long Offs)
|
||||
default:
|
||||
Internal ("Invalid address flags");
|
||||
}
|
||||
|
||||
|
||||
/* Return a pointer to the static buffer */
|
||||
return Buf;
|
||||
}
|
||||
@@ -3981,6 +3981,21 @@ void g_zerobytes (unsigned n)
|
||||
|
||||
|
||||
|
||||
void g_initregister (unsigned Label, unsigned Reg, unsigned Size)
|
||||
/* Initialize a register variable from static initialization data */
|
||||
{
|
||||
/* Register variables do always have less than 128 bytes */
|
||||
unsigned CodeLabel = GetLocalLabel ();
|
||||
ldxconst (Size-1);
|
||||
g_defcodelabel (CodeLabel);
|
||||
AddCodeLine ("lda %s,x", GetLabelName (CF_STATIC, Label, 0));
|
||||
AddCodeLine ("sta %s,x", GetLabelName (CF_REGVAR, Reg, 0));
|
||||
AddCodeLine ("dex");
|
||||
AddCodeLine ("bpl %s", LocalLabelName (CodeLabel));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void g_initauto (unsigned Label, unsigned Size)
|
||||
/* Initialize a local variable at stack offset zero from static data */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user