mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Special handling for a few more runtime functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5737 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
7aefd9b4e7
commit
43d0d2fb78
@ -812,13 +812,24 @@ void CE_GenRegInfo (CodeEntry* E, RegContents* InputRegs)
|
||||
Out->SRegHi = UNKNOWN_REGVAL;
|
||||
}
|
||||
/* ## FIXME: Quick hack for some known functions: */
|
||||
if (strcmp (E->Arg, "tosandax") == 0) {
|
||||
if (strcmp (E->Arg, "complax") == 0) {
|
||||
if (RegValIsKnown (In->RegA)) {
|
||||
Out->RegA = (In->RegA ^ 0xFF);
|
||||
}
|
||||
if (RegValIsKnown (In->RegX)) {
|
||||
Out->RegX = (In->RegX ^ 0xFF);
|
||||
}
|
||||
} else if (strcmp (E->Arg, "tosandax") == 0) {
|
||||
if (In->RegA == 0) {
|
||||
Out->RegA = 0;
|
||||
}
|
||||
if (In->RegX == 0) {
|
||||
Out->RegX = 0;
|
||||
}
|
||||
} else if (strcmp (E->Arg, "tosaslax") == 0) {
|
||||
if ((In->RegA & 0x0F) >= 8) {
|
||||
Out->RegA = 0;
|
||||
}
|
||||
} else if (strcmp (E->Arg, "tosorax") == 0) {
|
||||
if (In->RegA == 0xFF) {
|
||||
Out->RegA = 0xFF;
|
||||
@ -826,7 +837,13 @@ void CE_GenRegInfo (CodeEntry* E, RegContents* InputRegs)
|
||||
if (In->RegX == 0xFF) {
|
||||
Out->RegX = 0xFF;
|
||||
}
|
||||
} else if (FindBoolCmpCond (E->Arg) != CMP_INV) {
|
||||
} else if (strcmp (E->Arg, "tosshlax") == 0) {
|
||||
if ((In->RegA & 0x0F) >= 8) {
|
||||
Out->RegA = 0;
|
||||
}
|
||||
} else if (FindBoolCmpCond (E->Arg) != CMP_INV ||
|
||||
FindTosCmpCond (E->Arg) != CMP_INV) {
|
||||
/* Result is boolean value, so X is zero on output */
|
||||
Out->RegX = 0;
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user