1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-28 10:55:43 +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:
cuz 2004-05-14 15:05:51 +00:00
parent b61b5f3ec5
commit 556b861640

View File

@ -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);
}
}
}