mirror of
https://github.com/cc65/cc65.git
synced 2025-08-13 08:25:28 +00:00
Move FuncIsMnemonic
This commit is contained in:
@@ -418,35 +418,6 @@ static ExprNode* FuncDefined (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static ExprNode* FuncIsMnemonic (void)
|
|
||||||
/* Handle the .ISMNEMONIC, .ISMNEM builtin function */
|
|
||||||
{
|
|
||||||
int Instr = -1;
|
|
||||||
|
|
||||||
/* Check for a macro or an instruction depending on UbiquitousIdents */
|
|
||||||
|
|
||||||
if (CurTok.Tok == TOK_IDENT) {
|
|
||||||
if (UbiquitousIdents) {
|
|
||||||
/* Macros CAN be instructions, so check for them first */
|
|
||||||
if (FindMacro (&CurTok.SVal) == 0) {
|
|
||||||
Instr = FindInstruction (&CurTok.SVal);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Macros and symbols may NOT use the names of instructions, so just check for the instruction */
|
|
||||||
Instr = FindInstruction (&CurTok.SVal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Error ("Identifier expected.");
|
|
||||||
}
|
|
||||||
/* Skip the name */
|
|
||||||
NextTok();
|
|
||||||
|
|
||||||
return GenLiteralExpr (Instr > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static ExprNode* FuncDefinedMacro (void)
|
static ExprNode* FuncDefinedMacro (void)
|
||||||
/* Handle the .DEFINEDMACRO builtin function */
|
/* Handle the .DEFINEDMACRO builtin function */
|
||||||
{
|
{
|
||||||
@@ -483,6 +454,36 @@ static ExprNode* FuncHiWord (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static ExprNode* FuncIsMnemonic (void)
|
||||||
|
/* Handle the .ISMNEMONIC, .ISMNEM builtin function */
|
||||||
|
{
|
||||||
|
int Instr = -1;
|
||||||
|
|
||||||
|
/* Check for a macro or an instruction depending on UbiquitousIdents */
|
||||||
|
|
||||||
|
if (CurTok.Tok == TOK_IDENT) {
|
||||||
|
if (UbiquitousIdents) {
|
||||||
|
/* Macros CAN be instructions, so check for them first */
|
||||||
|
if (FindMacro (&CurTok.SVal) == 0) {
|
||||||
|
Instr = FindInstruction (&CurTok.SVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* Macros and symbols may NOT use the names of instructions, so just check for the instruction */
|
||||||
|
Instr = FindInstruction (&CurTok.SVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Error ("Identifier expected.");
|
||||||
|
}
|
||||||
|
/* Skip the name */
|
||||||
|
NextTok ();
|
||||||
|
|
||||||
|
return GenLiteralExpr (Instr > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ExprNode* FuncLoByte (void)
|
ExprNode* FuncLoByte (void)
|
||||||
/* Handle the .LOBYTE builtin function */
|
/* Handle the .LOBYTE builtin function */
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user