1
0
mirror of https://github.com/fachat/xa65.git synced 2024-07-06 15:28:59 +00:00
xa65/xa/tests/ppdefines/test6.a65
2012-08-17 18:08:00 +02:00

46 lines
1.1 KiB
Plaintext

// 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 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)