Skip to content

Commit

Permalink
Making clearRAM safer
Browse files Browse the repository at this point in the history
Fixes issue #30.
  • Loading branch information
flamewing authored Feb 25, 2020
1 parent 8bbbb08 commit 3143b40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions s2.macros.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ bytesToWcnt function n,n>>1-1

; fills a region of 68k RAM with 0
clearRAM macro startaddr,endaddr
if startaddr>endaddr
fatal "Starting address of clearRAM \{startaddr} is after ending address \{endaddr}."
elseif startaddr==endaddr
warning "clearRAM is clearing zero bytes. Turning this into a nop instead."
exitm
endif
if ((startaddr)&$8000)==0
lea (startaddr).l,a1
else
Expand Down

0 comments on commit 3143b40

Please sign in to comment.