mirror of
https://github.com/cc65/cc65.git
synced 2024-09-29 02:55:20 +00:00
Optimization
git-svn-id: svn://svn.cc65.org/cc65/trunk@3007 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
d7234541e2
commit
86b00e8157
@ -105,6 +105,20 @@ static unsigned char IsCharInSet (unsigned char C)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void InvertCharSet (void)
|
||||||
|
/* Invert the character set */
|
||||||
|
{
|
||||||
|
asm ("ldy #%b", sizeof (CharSet) - 1);
|
||||||
|
asm ("L1:");
|
||||||
|
asm ("lda %v,y", CharSet);
|
||||||
|
asm ("eor #$FF");
|
||||||
|
asm ("sta %v,y", CharSet);
|
||||||
|
asm ("dey");
|
||||||
|
asm ("bpl L1");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Code */
|
/* Code */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@ -206,7 +220,7 @@ static void AssignInt (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int _scanf (struct indesc* D_, const char* format, va_list ap_)
|
int _scanf (struct indesc* D_, register const char* format, va_list ap_)
|
||||||
/* This is the routine used to do the actual work. It is called from several
|
/* This is the routine used to do the actual work. It is called from several
|
||||||
* types of wrappers to implement the actual ISO xxscanf functions.
|
* types of wrappers to implement the actual ISO xxscanf functions.
|
||||||
*/
|
*/
|
||||||
@ -467,9 +481,7 @@ FlagsDone:
|
|||||||
|
|
||||||
/* Invert the set if requested */
|
/* Invert the set if requested */
|
||||||
if (Invert) {
|
if (Invert) {
|
||||||
for (Start = 0; Start < sizeof (CharSet); ++Start) {
|
InvertCharSet ();
|
||||||
CharSet[Start] ^= 0xFF;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We have the set in CharSet. Read characters and
|
/* We have the set in CharSet. Read characters and
|
||||||
|
Loading…
Reference in New Issue
Block a user