From ddfcf45d4007e7ab6cb7436acc5c4a141a29278d Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Wed, 30 Dec 2020 16:59:31 +0100 Subject: [PATCH] added some missing clobbers() specs --- compiler/res/prog8lib/c64/syslib.p8 | 4 ++-- compiler/res/prog8lib/cx16/gfx2.p8 | 10 +++------- compiler/res/prog8lib/cx16/graphics.p8 | 3 +-- compiler/res/prog8lib/cx16/syslib.p8 | 10 +++++----- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/compiler/res/prog8lib/c64/syslib.p8 b/compiler/res/prog8lib/c64/syslib.p8 index 419757b27..7065169d3 100644 --- a/compiler/res/prog8lib/c64/syslib.p8 +++ b/compiler/res/prog8lib/c64/syslib.p8 @@ -306,7 +306,7 @@ sub wait(uword jiffies) { } } -asmsub disable_runstop_and_charsetswitch() { +asmsub disable_runstop_and_charsetswitch() clobbers(A) { %asm {{ lda #$80 sta 657 ; disable charset switching @@ -400,7 +400,7 @@ IRQ_SCRATCH_ZPWORD2 .word 0 }} } -asmsub restore_irqvec() { +asmsub restore_irqvec() clobbers(A) { %asm {{ sei lda # uword @R0, ubyte @R1 { + asmsub addr_mul_320_add_24(uword address @R0, uword value @AY) clobbers(A) -> uword @R0, ubyte @R1 { %asm {{ sta P8ZP_SCRATCH_W1 sty P8ZP_SCRATCH_W1+1 diff --git a/compiler/res/prog8lib/cx16/graphics.p8 b/compiler/res/prog8lib/cx16/graphics.p8 index be2eb64e8..f925b4daa 100644 --- a/compiler/res/prog8lib/cx16/graphics.p8 +++ b/compiler/res/prog8lib/cx16/graphics.p8 @@ -128,8 +128,7 @@ graphics { } } - ; TODO CLOBBERS - inline asmsub plot(uword plotx @R0, uword ploty @R1) { + inline asmsub plot(uword plotx @R0, uword ploty @R1) clobbers(A, X, Y) { %asm {{ jsr cx16.FB_cursor_position lda #1 diff --git a/compiler/res/prog8lib/cx16/syslib.p8 b/compiler/res/prog8lib/cx16/syslib.p8 index f9eab2ee5..f7a840ed5 100644 --- a/compiler/res/prog8lib/cx16/syslib.p8 +++ b/compiler/res/prog8lib/cx16/syslib.p8 @@ -282,7 +282,7 @@ asmsub vpeek(ubyte bank @A, uword address @XY) -> ubyte @A { } -asmsub vaddr(ubyte bank @A, uword address @R0, ubyte addrsel @R1, byte autoIncrOrDecrByOne @Y) { +asmsub vaddr(ubyte bank @A, uword address @R0, ubyte addrsel @R1, byte autoIncrOrDecrByOne @Y) clobbers(A) { ; -- setup the VERA's data address register 0 or 1 %asm {{ and #1 @@ -308,7 +308,7 @@ asmsub vaddr(ubyte bank @A, uword address @R0, ubyte addrsel @R1, byte autoIncrO } -asmsub vpoke(ubyte bank @A, uword address @R0, ubyte value @Y) { +asmsub vpoke(ubyte bank @A, uword address @R0, ubyte value @Y) clobbers(A) { ; -- write a single byte to VERA's video memory ; note: inefficient when writing multiple sequential bytes! %asm {{ @@ -324,7 +324,7 @@ asmsub vpoke(ubyte bank @A, uword address @R0, ubyte value @Y) { }} } -asmsub vpoke_or(ubyte bank @A, uword address @R0, ubyte value @Y) { +asmsub vpoke_or(ubyte bank @A, uword address @R0, ubyte value @Y) clobbers (A) { ; -- or a single byte to the value already in the VERA's video memory at that location ; note: inefficient when writing multiple sequential bytes! %asm {{ @@ -342,7 +342,7 @@ asmsub vpoke_or(ubyte bank @A, uword address @R0, ubyte value @Y) { }} } -asmsub vpoke_and(ubyte bank @A, uword address @R0, ubyte value @Y) { +asmsub vpoke_and(ubyte bank @A, uword address @R0, ubyte value @Y) clobbers(A) { ; -- and a single byte to the value already in the VERA's video memory at that location ; note: inefficient when writing multiple sequential bytes! %asm {{ @@ -360,7 +360,7 @@ asmsub vpoke_and(ubyte bank @A, uword address @R0, ubyte value @Y) { }} } -asmsub vpoke_xor(ubyte bank @A, uword address @R0, ubyte value @Y) { +asmsub vpoke_xor(ubyte bank @A, uword address @R0, ubyte value @Y) clobbers (A) { ; -- xor a single byte to the value already in the VERA's video memory at that location ; note: inefficient when writing multiple sequential bytes! %asm {{