1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-21 20:29:24 +00:00

Allow a CPU spec in the GLOBAL section of the info file

git-svn-id: svn://svn.cc65.org/cc65/trunk@2269 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-08-12 11:01:46 +00:00
parent f0dace7bd0
commit 98cdbaba4b
2 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,7 @@
#endif
/* common */
#include "cpu.h"
#include "xmalloc.h"
/* da65 */
@ -51,6 +52,7 @@
#include "error.h"
#include "global.h"
#include "infofile.h"
#include "opctable.h"
#include "scanner.h"
@ -65,6 +67,7 @@ static void GlobalSection (void)
/* Parse a global section */
{
static const IdentTok GlobalDefs[] = {
{ "CPU", INFOTOK_CPU },
{ "INPUTNAME", INFOTOK_INPUTNAME },
{ "OUTPUTNAME", INFOTOK_OUTPUTNAME },
{ "PAGELENGTH", INFOTOK_PAGELENGTH },
@ -86,6 +89,17 @@ static void GlobalSection (void)
/* Look at the token */
switch (InfoTok) {
case INFOTOK_CPU:
InfoNextTok ();
InfoAssureStr ();
if (CPU != CPU_UNKNOWN) {
InfoError ("CPU already specified");
}
CPU = FindCPU (InfoSVal);
SetOpcTable (CPU);
InfoNextTok ();
break;
case INFOTOK_INPUTNAME:
InfoNextTok ();
InfoAssureStr ();

View File

@ -65,6 +65,7 @@ typedef enum token_t {
INFOTOK_LABEL,
/* Global section */
INFOTOK_CPU,
INFOTOK_INPUTNAME,
INFOTOK_OUTPUTNAME,
INFOTOK_PAGELENGTH,