From 1c16e46f2369306fa7397dbde8750aad3b824816 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 5 Jun 2021 11:31:28 -0400 Subject: [PATCH] Improved ld65's error messages about ca65's .BANK() function. * Split a message into two more specific messages. --- src/ld65/expr.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ld65/expr.c b/src/ld65/expr.c index 41db2326c..7a2f37d4a 100644 --- a/src/ld65/expr.c +++ b/src/ld65/expr.c @@ -403,17 +403,20 @@ long GetExprVal (ExprNode* Expr) case EXPR_BANK: GetSegExprVal (Expr->Left, &D); - if (D.TooComplex || D.Seg == 0) { - Error ("Argument for .BANK is not segment relative or too complex"); + if (D.TooComplex) { + Error ("Argument of .BANK() is too complex"); + } + if (D.Seg == 0) { + Error ("Argument of .BANK() isn't a label attached to a segment"); } if (D.Seg->MemArea == 0) { - Error ("Segment '%s' is referenced by .BANK but " - "not assigned to a memory area", + Error ("Segment '%s' is referenced by .BANK()," + " but not assigned to a memory area", GetString (D.Seg->Name)); } if (D.Seg->MemArea->BankExpr == 0) { - Error ("Memory area '%s' is referenced by .BANK but " - "has no BANK attribute", + Error ("Memory area '%s' is referenced by .BANK()," + " but has no BANK attribute", GetString (D.Seg->MemArea->Name)); } return GetExprVal (D.Seg->MemArea->BankExpr);