Make some error messages more consistent (#1393)

* Update some error messages

* Make non-A destination operand syntactically invalid
This commit is contained in:
Sylvie
2024-04-20 17:13:01 -04:00
committed by GitHub
parent 7aecc00919
commit 3e9d2cab12
6 changed files with 71 additions and 61 deletions

View File

@@ -817,7 +817,11 @@ void sect_PCRelByte(Expression &expr, uint32_t pcShift) {
offset = sym->getValue() - (pc->getValue() + 1);
if (offset < -128 || offset > 127) {
error("jr target out of reach (expected -129 < %" PRId16 " < 128)\n", offset);
error(
"jr target must be between -128 and 127 bytes away, not %" PRId16
"; use jp instead\n",
offset
);
writebyte(0);
} else {
writebyte(offset);