65816 now generate EXPR_NEARADDR instead of EXPR_WORD0 for default assumed address mode, which will be validated by the linker's range check rather than blindly truncated. Assuming the assembler correctly validated this, the linker is allowed to truncate.

This commit is contained in:
bbbradsmith
2019-05-01 02:12:03 -04:00
committed by Oliver Schmidt
parent a01c4231f2
commit ac2ecb0b2c
7 changed files with 61 additions and 3 deletions

View File

@@ -436,6 +436,10 @@ long GetExprVal (ExprNode* Expr)
case EXPR_WORD1:
return (GetExprVal (Expr->Left) >> 16) & 0xFFFF;
case EXPR_NEARADDR:
/* Assembler was expected to validate this truncation. */
return GetExprVal (Expr->Left) & 0xFFFF;
case EXPR_FARADDR:
return GetExprVal (Expr->Left) & 0xFFFFFF;