Skip to content

Commit

Permalink
relocate: remove low-memory access warning completely in relocation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ped7g committed Jul 15, 2020
1 parent fdb4f16 commit 85d9a4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sjasm/reader.cpp
Expand Up @@ -333,8 +333,9 @@ int check24(aint val) {
}

void checkLowMemory(byte hiByte, byte lowByte) {
//FIXME relocation to switch this off?
if (hiByte || !warningNotSuppressed() || !Options::syx.IsLowMemWarningEnabled) {
if (hiByte || !Options::syx.IsLowMemWarningEnabled || !warningNotSuppressed() \
|| Relocation::isActive)
{
return; // address is >= 256 or warning is suppressed
}
// for addresses 0..255 issue warning
Expand Down
9 changes: 9 additions & 0 deletions tests/relocate/relocation_low_memory_warning.asm
@@ -0,0 +1,9 @@
ORG 0
RELOCATE_START
; this would trigger warning in regular mode
; but low-mem access warning is suppressed in relocation mode
label1: ld a,(label1)
RELOCATE_END
RELOCATE_TABLE

ASSERT 0 == __WARNINGS__

0 comments on commit 85d9a4d

Please sign in to comment.