Check for and flag address size modifiers that are invalid for the choosen CPU.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3927 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2009-02-10 21:10:50 +00:00
parent 9082762519
commit c94e82f8b2
3 changed files with 45 additions and 4 deletions

View File

@@ -127,6 +127,11 @@ static unsigned char OptionalAddrSize (void)
if (Tok == TOK_COLON) {
NextTok ();
AddrSize = ParseAddrSize ();
if (!ValidAddrSizeForCPU (AddrSize)) {
/* Print an error and reset to default */
Error ("Invalid address size specification for current CPU");
AddrSize = ADDR_SIZE_DEFAULT;
}
NextTok ();
}
return AddrSize;