/* */
/* */
/* */
-/* (C) 1998-2008 Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2010, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
{ ".MACPACK", TOK_MACPACK },
{ ".MACRO", TOK_MACRO },
{ ".MATCH", TOK_MATCH },
+ { ".MAX", TOK_MAX },
{ ".MID", TOK_MID },
+ { ".MIN", TOK_MIN },
{ ".MOD", TOK_MOD },
{ ".NOT", TOK_BOOLNOT },
{ ".NULL", TOK_NULL },
/* We are on include level. Search for the file in the include
* directories.
*/
- PathName = FindInclude (Name);
+ PathName = FindInclude (Name, INC_STD);
if (PathName == 0 || (F = fopen (PathName, "r")) == 0) {
/* Not found or cannot open, print an error and bail out */
Error ("Cannot open include file `%s': %s", Name, strerror (errno));
* error message and return ADDR_SIZE_DEFAULT.
*/
{
- static const char* Keys[] = {
- "DIRECT", "ZEROPAGE", "ZP",
- "ABSOLUTE", "ABS", "NEAR",
- "FAR",
- "LONG", "DWORD",
- };
+ unsigned char AddrSize;
/* Check for an identifier */
if (Tok != TOK_IDENT) {
return ADDR_SIZE_DEFAULT;
}
- /* Search for the attribute */
- switch (GetSubKey (Keys, sizeof (Keys) / sizeof (Keys [0]))) {
- case 0:
- case 1:
- case 2: return ADDR_SIZE_ZP;
- case 3:
- case 4:
- case 5: return ADDR_SIZE_ABS;
- case 6: return ADDR_SIZE_FAR;
- case 7:
- case 8: return ADDR_SIZE_LONG;
- default:
- Error ("Address size specifier expected");
- return ADDR_SIZE_DEFAULT;
+ /* Convert the attribute */
+ AddrSize = AddrSizeFromStr (SB_GetConstBuf (&SVal));
+ if (AddrSize == ADDR_SIZE_INVALID) {
+ Error ("Address size specifier expected");
+ AddrSize = ADDR_SIZE_DEFAULT;
}
+
+ /* Done */
+ return AddrSize;
}