mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
Better error messages in case of a range error
git-svn-id: svn://svn.cc65.org/cc65/trunk@3042 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
b61b5f3ec5
commit
556b861640
@ -314,24 +314,24 @@ void SegCheck (void)
|
||||
if (Abs) {
|
||||
/* Absolute value */
|
||||
if (Val > 255) {
|
||||
PError (&F->Pos, "Range error");
|
||||
PError (&F->Pos, "Range error (%ld not in [0..255])", Val);
|
||||
}
|
||||
} else {
|
||||
/* PC relative value */
|
||||
if (Val < -128 || Val > 127) {
|
||||
PError (&F->Pos, "Range error");
|
||||
PError (&F->Pos, "Range error (%ld not in [-128..127])", Val);
|
||||
}
|
||||
}
|
||||
} else if (F->Len == 2) {
|
||||
if (Abs) {
|
||||
/* Absolute value */
|
||||
if (Val > 65535) {
|
||||
PError (&F->Pos, "Range error");
|
||||
PError (&F->Pos, "Range error (%ld not in [0..65535])", Val);
|
||||
}
|
||||
} else {
|
||||
/* PC relative value */
|
||||
if (Val < -32768 || Val > 32767) {
|
||||
PError (&F->Pos, "Range error");
|
||||
PError (&F->Pos, "Range error (%ld not in [-32768..32767])", Val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user