mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-01-31 02:29:51 +00:00
374 lines
4.2 KiB
Plaintext
374 lines
4.2 KiB
Plaintext
MACRO
|
|
&LAB LLA &AD1,&AD2
|
|
&LAB ANOP
|
|
LCLA &L
|
|
LCLB &LA
|
|
AIF S:LONGA,.A
|
|
REP #%00100000
|
|
LONGA ON
|
|
&LA SETB 1
|
|
.A
|
|
LDA #&AD2
|
|
&L SETA C:&AD1
|
|
.B
|
|
STA &AD1(&L)
|
|
&L SETA &L-1
|
|
AIF &L,^B
|
|
LDA #^&AD2
|
|
&L SETA C:&AD1
|
|
.C
|
|
STA 2+&AD1(&L)
|
|
&L SETA &L-1
|
|
AIF &L,^C
|
|
AIF &LA=0,.D
|
|
SEP #%00100000
|
|
LONGA OFF
|
|
.D
|
|
MEND
|
|
MACRO
|
|
&LAB PH2 &N1
|
|
LCLC &C
|
|
&LAB ANOP
|
|
&C AMID &N1,1,1
|
|
AIF "&C"="#",.D
|
|
AIF S:LONGA=1,.A
|
|
REP #%00100000
|
|
.A
|
|
AIF "&C"<>"{",.B
|
|
&C AMID &N1,L:&N1,1
|
|
AIF "&C"<>"}",.G
|
|
&N1 AMID &N1,2,L:&N1-2
|
|
LDA (&N1)
|
|
PHA
|
|
AGO .E
|
|
.B
|
|
LDA &N1
|
|
PHA
|
|
AGO .E
|
|
.D
|
|
&N1 AMID &N1,2,L:&N1-1
|
|
PEA &N1
|
|
AGO .F
|
|
.E
|
|
AIF S:LONGA=1,.F
|
|
SEP #%00100000
|
|
.F
|
|
MEXIT
|
|
.G
|
|
MNOTE "Missing closing '}'",16
|
|
MEND
|
|
MACRO
|
|
&LAB PL2 &N1
|
|
LCLC &C
|
|
&LAB ANOP
|
|
AIF S:LONGA=1,.A
|
|
REP #%00100000
|
|
.A
|
|
&C AMID &N1,1,1
|
|
AIF "&C"<>"{",.B
|
|
&C AMID &N1,L:&N1,1
|
|
AIF "&C"<>"}",.F
|
|
&N1 AMID &N1,2,L:&N1-2
|
|
PLA
|
|
STA (&N1)
|
|
AGO .D
|
|
.B
|
|
PLA
|
|
STA &N1
|
|
.D
|
|
AIF S:LONGA=1,.E
|
|
SEP #%00100000
|
|
.E
|
|
MEXIT
|
|
.F
|
|
MNOTE "Missing closing '}'",16
|
|
MEND
|
|
MACRO
|
|
&LAB _READTIMEHEX
|
|
&LAB LDX #$0D03
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _FWENTRY
|
|
&LAB LDX #$2403
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETMOUSECLAMP
|
|
&LAB LDX #$1D03
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _READMOUSE
|
|
&LAB LDX #$1703
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETABSCLAMP
|
|
&LAB LDX #$2B03
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&lab csubroutine &parms,&work
|
|
&lab anop
|
|
aif c:&work,.a
|
|
lclc &work
|
|
&work setc 0
|
|
.a
|
|
gbla &totallen
|
|
gbla &worklen
|
|
&worklen seta &work
|
|
&totallen seta 0
|
|
aif c:&parms=0,.e
|
|
lclc &len
|
|
lclc &p
|
|
lcla &i
|
|
&i seta 1
|
|
.b
|
|
&p setc &parms(&i)
|
|
&len amid &p,2,1
|
|
aif "&len"=":",.c
|
|
&len amid &p,1,2
|
|
&p amid &p,4,l:&p-3
|
|
ago .d
|
|
.c
|
|
&len amid &p,1,1
|
|
&p amid &p,3,l:&p-2
|
|
.d
|
|
&p equ &totallen+4+&work
|
|
&totallen seta &totallen+&len
|
|
&i seta &i+1
|
|
aif &i<=c:&parms,^b
|
|
.e
|
|
tsc
|
|
aif &work=0,.f
|
|
sec
|
|
sbc #&work
|
|
tcs
|
|
.f
|
|
phd
|
|
tcd
|
|
mend
|
|
MACRO
|
|
&lab creturn &r
|
|
&lab anop
|
|
lclc &len
|
|
aif c:&r,.a
|
|
lclc &r
|
|
&r setc 0
|
|
&len setc 0
|
|
ago .h
|
|
.a
|
|
&len amid &r,2,1
|
|
aif "&len"=":",.b
|
|
&len amid &r,1,2
|
|
&r amid &r,4,l:&r-3
|
|
ago .c
|
|
.b
|
|
&len amid &r,1,1
|
|
&r amid &r,3,l:&r-2
|
|
.c
|
|
aif &len<>2,.d
|
|
ldy &r
|
|
ago .h
|
|
.d
|
|
aif &len<>4,.e
|
|
ldx &r+2
|
|
ldy &r
|
|
ago .h
|
|
.e
|
|
aif &len<>10,.g
|
|
ldy #&r
|
|
ldx #^&r
|
|
ago .h
|
|
.g
|
|
mnote 'Not a valid return length',16
|
|
mexit
|
|
.h
|
|
aif &totallen=0,.i
|
|
lda &worklen+2
|
|
sta &worklen+&totallen+2
|
|
lda &worklen+1
|
|
sta &worklen+&totallen+1
|
|
.i
|
|
pld
|
|
tsc
|
|
clc
|
|
adc #&worklen+&totallen
|
|
tcs
|
|
aif &len=0,.j
|
|
tya
|
|
.j
|
|
rtl
|
|
mend
|
|
MACRO
|
|
&LAB PH4 &N1
|
|
LCLC &C
|
|
&LAB ANOP
|
|
&C AMID &N1,1,1
|
|
AIF "&C"="#",.D
|
|
AIF S:LONGA=1,.A
|
|
REP #%00100000
|
|
.A
|
|
AIF "&C"<>"{",.B
|
|
&C AMID &N1,L:&N1,1
|
|
AIF "&C"<>"}",.G
|
|
&N1 AMID &N1,2,L:&N1-2
|
|
LDY #2
|
|
LDA (&N1),Y
|
|
PHA
|
|
LDA (&N1)
|
|
PHA
|
|
AGO .E
|
|
.B
|
|
AIF "&C"<>"[",.C
|
|
LDY #2
|
|
LDA &N1,Y
|
|
PHA
|
|
LDA &N1
|
|
PHA
|
|
AGO .E
|
|
.C
|
|
LDA &N1+2
|
|
PHA
|
|
LDA &N1
|
|
PHA
|
|
AGO .E
|
|
.D
|
|
&N1 AMID &N1,2,L:&N1-1
|
|
PEA +(&N1)|-16
|
|
PEA &N1
|
|
AGO .F
|
|
.E
|
|
AIF S:LONGA=1,.F
|
|
SEP #%00100000
|
|
.F
|
|
MEXIT
|
|
.G
|
|
MNOTE "Missing closing '}'",16
|
|
MEND
|
|
MACRO
|
|
&LAB PL4 &N1
|
|
LCLC &C
|
|
&LAB ANOP
|
|
AIF S:LONGA=1,.A
|
|
REP #%00100000
|
|
.A
|
|
&C AMID &N1,1,1
|
|
AIF "&C"<>"{",.B
|
|
&C AMID &N1,L:&N1,1
|
|
AIF "&C"<>"}",.F
|
|
&N1 AMID &N1,2,L:&N1-2
|
|
PLA
|
|
STA (&N1)
|
|
LDY #2
|
|
PLA
|
|
STA (&N1),Y
|
|
AGO .D
|
|
.B
|
|
AIF "&C"<>"[",.C
|
|
PLA
|
|
STA &N1
|
|
LDY #2
|
|
PLA
|
|
STA &N1,Y
|
|
AGO .D
|
|
.C
|
|
PLA
|
|
STA &N1
|
|
PLA
|
|
STA &N1+2
|
|
.D
|
|
AIF S:LONGA=1,.E
|
|
SEP #%00100000
|
|
.E
|
|
MEXIT
|
|
.F
|
|
MNOTE "Missing closing '}'",16
|
|
MEND
|
|
MACRO
|
|
&LAB _LONGDIVIDE
|
|
&LAB LDX #$0D0B
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _LONGMUL
|
|
&LAB LDX #$0C0B
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _SDIVIDE
|
|
&LAB LDX #$0A0B
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _UDIVIDE
|
|
&LAB LDX #$0B0B
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _INITIALLOAD
|
|
&LAB LDX #$0911
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _RESTART
|
|
&LAB LDX #$0A11
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _LOADSEGNAME
|
|
&LAB LDX #$0D11
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _UNLOADSEG
|
|
&LAB LDX #$0E11
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETLOC
|
|
&LAB LDX #$0C1A
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETERRGLOBALS
|
|
&LAB LDX #$0E0C
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETINGLOBALS
|
|
&LAB LDX #$0C0C
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETINPUTDEVICE
|
|
&LAB LDX #$120C
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETOUTGLOBALS
|
|
&LAB LDX #$0D0C
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETOUTPUTDEVICE
|
|
&LAB LDX #$130C
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _GETERRORDEVICE
|
|
&LAB LDX #$140C
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&LAB _INITIALLOAD2
|
|
&LAB LDX #$2011
|
|
JSL $E10000
|
|
MEND
|
|
MACRO
|
|
&lab _GetMSData
|
|
&lab ldx #$1F23
|
|
jsl $E10000
|
|
MEND
|