mirror of
https://github.com/fachat/xa65.git
synced 2025-08-11 09:25:09 +00:00
patch 1
This commit is contained in:
@@ -6,7 +6,7 @@ LD = gcc
|
|||||||
# for testing. not to be used; build failures in misc/.
|
# for testing. not to be used; build failures in misc/.
|
||||||
#CFLAGS = -O2 -W -Wall -pedantic -ansi
|
#CFLAGS = -O2 -W -Wall -pedantic -ansi
|
||||||
#CFLAGS = -O2 -g
|
#CFLAGS = -O2 -g
|
||||||
CFLAGS = -O2
|
CFLAGS = -g #-O2
|
||||||
LDFLAGS = -lc
|
LDFLAGS = -lc
|
||||||
|
|
||||||
# for DOS?
|
# for DOS?
|
||||||
|
@@ -196,7 +196,8 @@ int lg_toglobal(char *s ) {
|
|||||||
//printf("lg_toglobal(%s)\n", s);
|
//printf("lg_toglobal(%s)\n", s);
|
||||||
er = ll_search(s,&n, STD);
|
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=afile->la.lt+n;
|
||||||
ltp->fl=3;
|
ltp->fl=3;
|
||||||
ltp->afl=SEG_UNDEF;
|
ltp->afl=SEG_UNDEF;
|
||||||
|
@@ -556,6 +556,13 @@ int list_tokens(char *buf, signed char *input, int len) {
|
|||||||
outp += list_char(buf+outp, '"');
|
outp += list_char(buf+outp, '"');
|
||||||
break;
|
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:
|
default:
|
||||||
c = input[inp];
|
c = input[inp];
|
||||||
if (c > 31) {
|
if (c > 31) {
|
||||||
|
8
xa/tests/listing/listexpr.a65
Normal file
8
xa/tests/listing/listexpr.a65
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
*=$0400
|
||||||
|
|
||||||
|
.assert *<$17e6, "routine too long"
|
||||||
|
|
||||||
|
lda #<$17e6 >> 2
|
||||||
|
|
||||||
|
lda *-2
|
11
xa/tests/usb65/Makefile
Normal file
11
xa/tests/usb65/Makefile
Normal 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
42
xa/tests/usb65/test1.a65
Normal 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
16
xa/tests/usb65/test2.a65
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
.(
|
||||||
|
|
||||||
|
jsr single
|
||||||
|
|
||||||
|
single jmp single
|
||||||
|
|
||||||
|
jmp lenerr
|
||||||
|
|
||||||
|
bne lenerr
|
||||||
|
|
||||||
|
lenerr jsr lenerr
|
||||||
|
|
||||||
|
|
||||||
|
.)
|
||||||
|
|
Reference in New Issue
Block a user