1
0
mirror of https://github.com/fachat/xa65.git synced 2025-04-08 18:37:12 +00:00

new test case hanging xa in an endless loop

This commit is contained in:
fachat 2012-08-17 14:21:56 +02:00
parent fd364f3eef
commit ecdf4f78b9
2 changed files with 54 additions and 1 deletions

View File

@ -1,7 +1,7 @@
XA=../../xa
all: test1 test2 test3 test4 test5 clean
all: test1 test2 test3 test4 test5 test6 clean
clean:
rm a.o65

View File

@ -0,0 +1,53 @@
// testing some more complicated defines
#define spi_enable(mask) \
lda SPISSRB :\
and #255-(mask) :\
sta SPISSRB
#define spi_disable(mask) \
lda SPISSRB :\
ora #(mask) :\
sta SPISSRB
#define spi_wra() \
.( :\
sta SPIDR :\
l_ bit SPISR :\
bpl l_ :\
lda SPIDR :\
.)
#define max3420e_enable() \
spi_enable(MAX3420E_EnMask)
#define max3420e_disable() \
spi_disable(MAX3420E_EnMask)
#define wreg(reg, val) \
max3420e_enable() :\
lda #(reg) | 0x02 :\
spi_wra() :\
lda #(val) :\
spi_wra() :\
max3420e_disable()
#define wrac(reg) \
pha :\
max3420e_enable() :\
lda #(reg) | 0x02 :\
spi_wra() :\
pla :\
spi_wra() :\
max3420e_disable()
// just the definition of this macro hangs the xa indefinitely...
#define CLRBIT(reg, val) \
rreg(reg) :\
and #255-val :\
wrac(reg)