1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-25 17:29:35 +00:00
This commit is contained in:
Andre Fachat 2023-10-27 10:27:17 +02:00
parent c0f334bac9
commit 780d1fed21
7 changed files with 87 additions and 2 deletions

View File

@ -6,7 +6,7 @@ LD = gcc
# for testing. not to be used; build failures in misc/.
#CFLAGS = -O2 -W -Wall -pedantic -ansi
#CFLAGS = -O2 -g
CFLAGS = -O2
CFLAGS = -g #-O2
LDFLAGS = -lc
# for DOS?

View File

@ -196,7 +196,8 @@ int lg_toglobal(char *s ) {
//printf("lg_toglobal(%s)\n", s);
er = ll_search(s,&n, STD);
if(er==E_OK) {
if(er==E_OK && ltp->fl != 3) {
// fonnd, but not yet set as global undef'd label
ltp=afile->la.lt+n;
ltp->fl=3;
ltp->afl=SEG_UNDEF;

View File

@ -556,6 +556,13 @@ int list_tokens(char *buf, signed char *input, int len) {
outp += list_char(buf+outp, '"');
break;
}
case '*': {
// If '*' appears as operand, it is the PC. We need to switch to operator then
inp++;
outp += list_char(buf+outp, '*');
operator = 1;
break;
}
default:
c = input[inp];
if (c > 31) {

View File

@ -0,0 +1,8 @@
*=$0400
.assert *<$17e6, "routine too long"
lda #<$17e6 >> 2
lda *-2

11
xa/tests/usb65/Makefile Normal file
View File

@ -0,0 +1,11 @@
XA=../../xa
all: test1 test2
test1: test1.a65
${XA} -XC -R -U $<
test2: test2.a65
${XA} -R -U $<

42
xa/tests/usb65/test1.a65 Normal file
View File

@ -0,0 +1,42 @@
#define MAX3421E_EnMask $04
#define max3421e_enable() \
lda #MAX3421E_EnMask :\
jsr spi_enable
#define max3421e_disable() \
jsr spi_disable
#define spi_wra()
/********************************************************************/
#define rPINCTL (17<<3)
#define bmFDUPSPI $10
#define bmINTLEVEL $08
#define wreg(reg, val) \
max3421e_enable() :\
lda #(reg) | $02 :\
spi_wra() :\
lda #(val) :\
spi_wra() :\
max3421e_disable()
/********************************************************************/
; unrolled macrois ok
max3421e_enable()
lda #(rPINCTL) | $02
spi_wra()
lda #(bmFDUPSPI+bmINTLEVEL)
spi_wra()
max3421e_disable()
; macro used o give syntax...
wreg(rPINCTL, bmFDUPSPI+bmINTLEVEL)

16
xa/tests/usb65/test2.a65 Normal file
View File

@ -0,0 +1,16 @@
.(
jsr single
single jmp single
jmp lenerr
bne lenerr
lenerr jsr lenerr
.)