mirror of
https://github.com/byteworksinc/Linker.git
synced 2024-05-28 16:41:31 +00:00
convert CR files to LF for better git compatibility.
This commit is contained in:
parent
748ae356d7
commit
c21ae46a4d
28
backup
Executable file → Normal file
28
backup
Executable file → Normal file
|
@ -1 +1,27 @@
|
||||||
if "{#}" != "1"
echo Form: backup [day]
exit 65535
end
set dest /library/mike/{1}/linker
set list backup count directpage linker.notes linkit make smac
set list {list} exp.asm exp.mac
set list {list} file.asm file.mac
set list {list} linker.asm linker.mac linker.rez
set list {list} out.asm out.mac
set list {list} pass1.asm pass1.mac
set list {list} pass2.asm pass2.mac
set list {list} seg.asm seg.mac
set list {list} symbol.asm symbol.mac
set list {list} exp.asm exp.mac
set list {list} util.asm util.mac
unset exit
create {dest} >.null >&.null
for i in {list}
newer {dest}/{i} {i}
if {Status} != 0
copy -c {i} {dest}/{i}
end
end
|
if "{#}" != "1"
|
||||||
|
echo Form: backup [day]
|
||||||
|
exit 65535
|
||||||
|
end
|
||||||
|
|
||||||
|
set dest /library/mike/{1}/linker
|
||||||
|
|
||||||
|
set list backup count directpage linker.notes linkit make smac
|
||||||
|
set list {list} exp.asm exp.mac
|
||||||
|
set list {list} file.asm file.mac
|
||||||
|
set list {list} linker.asm linker.mac linker.rez
|
||||||
|
set list {list} out.asm out.mac
|
||||||
|
set list {list} pass1.asm pass1.mac
|
||||||
|
set list {list} pass2.asm pass2.mac
|
||||||
|
set list {list} seg.asm seg.mac
|
||||||
|
set list {list} symbol.asm symbol.mac
|
||||||
|
set list {list} exp.asm exp.mac
|
||||||
|
set list {list} util.asm util.mac
|
||||||
|
|
||||||
|
unset exit
|
||||||
|
create {dest} >.null >&.null
|
||||||
|
for i in {list}
|
||||||
|
newer {dest}/{i} {i}
|
||||||
|
if {Status} != 0
|
||||||
|
copy -c {i} {dest}/{i}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
12
count
Executable file → Normal file
12
count
Executable file → Normal file
|
@ -1 +1,11 @@
|
||||||
set list directPage linker.asm
set list {list} util.asm
set list {list} file.asm
set list {list} pass1.asm
set list {list} pass2.asm
set list {list} seg.asm
set list {list} symbol.asm
set list {list} exp.asm
set list {list} out.asm
wc {list}
|
set list directPage linker.asm
|
||||||
|
set list {list} util.asm
|
||||||
|
set list {list} file.asm
|
||||||
|
set list {list} pass1.asm
|
||||||
|
set list {list} pass2.asm
|
||||||
|
set list {list} seg.asm
|
||||||
|
set list {list} symbol.asm
|
||||||
|
set list {list} exp.asm
|
||||||
|
set list {list} out.asm
|
||||||
|
|
||||||
|
wc {list}
|
||||||
|
|
63
directpage
Executable file → Normal file
63
directpage
Executable file → Normal file
|
@ -1 +1,62 @@
|
||||||
;
; Global constants
;
OBJ gequ $B1 object file
LIB gequ $B2 library file
EXE gequ $B5 executable file
;
; direct page map
;
r0 gequ $0 general purpose registers
r1 gequ $1
r2 gequ $2
r3 gequ $3
r4 gequ $4
r5 gequ $5
r6 gequ $6
r7 gequ $7
r8 gequ $8
r9 gequ $9
r10 gequ $A
r11 gequ $B
r12 gequ $C
r13 gequ $D
r14 gequ $E
r15 gequ $F
r16 gequ $10
r17 gequ $11
r18 gequ $12
r19 gequ $13
slist gequ $14 list of input names
kname gequ $18 output file name (nil for none)
sdisp gequ $1C disp to next char in slist
fname gequ $1E ptr to current input file name
basename gequ $22 ptr to root file name
seg gequ $26 pointer to the first byte in the segment
sp gequ $2A pointer to the next byte to process
len gequ $2E # bytes left in the current file
pc gequ $32 program counter
dictionary gequ $36 current library dictionary buffer
libSymbols gequ $3A ptr to first library symbol
libNames gequ $3E ptr to first library name
didLibSegment gequ $42 library segment processed flag
libDisp gequ $44 disp in the file being processed
libLength gequ $48 length of the library symbol table
op gequ $4C output buffer pointer
opst gequ $50 op at start of last lConst
dp gequ $54 dictionary pointer
dictSize gequ $58 remaining size of dictionary
dy gequ $5A ptr to next byte in the dynamic segment
expStart gequ $5E start of express segment
expOffset gequ $62 offset table in express segment
expMap gequ $66 segment map in express segment
expHeader gequ $6A header table in express segment
fMark gequ $6E file mark for express segment
! $52 next available spot
|
;
|
||||||
|
; Global constants
|
||||||
|
;
|
||||||
|
OBJ gequ $B1 object file
|
||||||
|
LIB gequ $B2 library file
|
||||||
|
EXE gequ $B5 executable file
|
||||||
|
;
|
||||||
|
; direct page map
|
||||||
|
;
|
||||||
|
r0 gequ $0 general purpose registers
|
||||||
|
r1 gequ $1
|
||||||
|
r2 gequ $2
|
||||||
|
r3 gequ $3
|
||||||
|
r4 gequ $4
|
||||||
|
r5 gequ $5
|
||||||
|
r6 gequ $6
|
||||||
|
r7 gequ $7
|
||||||
|
r8 gequ $8
|
||||||
|
r9 gequ $9
|
||||||
|
r10 gequ $A
|
||||||
|
r11 gequ $B
|
||||||
|
r12 gequ $C
|
||||||
|
r13 gequ $D
|
||||||
|
r14 gequ $E
|
||||||
|
r15 gequ $F
|
||||||
|
r16 gequ $10
|
||||||
|
r17 gequ $11
|
||||||
|
r18 gequ $12
|
||||||
|
r19 gequ $13
|
||||||
|
|
||||||
|
slist gequ $14 list of input names
|
||||||
|
kname gequ $18 output file name (nil for none)
|
||||||
|
sdisp gequ $1C disp to next char in slist
|
||||||
|
fname gequ $1E ptr to current input file name
|
||||||
|
basename gequ $22 ptr to root file name
|
||||||
|
|
||||||
|
seg gequ $26 pointer to the first byte in the segment
|
||||||
|
sp gequ $2A pointer to the next byte to process
|
||||||
|
len gequ $2E # bytes left in the current file
|
||||||
|
pc gequ $32 program counter
|
||||||
|
|
||||||
|
dictionary gequ $36 current library dictionary buffer
|
||||||
|
libSymbols gequ $3A ptr to first library symbol
|
||||||
|
libNames gequ $3E ptr to first library name
|
||||||
|
didLibSegment gequ $42 library segment processed flag
|
||||||
|
libDisp gequ $44 disp in the file being processed
|
||||||
|
libLength gequ $48 length of the library symbol table
|
||||||
|
|
||||||
|
op gequ $4C output buffer pointer
|
||||||
|
opst gequ $50 op at start of last lConst
|
||||||
|
dp gequ $54 dictionary pointer
|
||||||
|
dictSize gequ $58 remaining size of dictionary
|
||||||
|
|
||||||
|
dy gequ $5A ptr to next byte in the dynamic segment
|
||||||
|
|
||||||
|
expStart gequ $5E start of express segment
|
||||||
|
expOffset gequ $62 offset table in express segment
|
||||||
|
expMap gequ $66 segment map in express segment
|
||||||
|
expHeader gequ $6A header table in express segment
|
||||||
|
fMark gequ $6E file mark for express segment
|
||||||
|
|
||||||
|
! $52 next available spot
|
||||||
|
|
1662
exp.asm
Executable file → Normal file
1662
exp.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
508
exp.mac
Executable file → Normal file
508
exp.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
1018
file.asm
Executable file → Normal file
1018
file.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
614
file.mac
Executable file → Normal file
614
file.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
714
linker.asm
Executable file → Normal file
714
linker.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
512
linker.mac
Executable file → Normal file
512
linker.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
29
linker.notes
Executable file → Normal file
29
linker.notes
Executable file → Normal file
|
@ -1 +1,28 @@
|
||||||
ORCA/Linker 2.0.3
Copyright 1996, Byte Works Inc.
-- Change List --------------------------------------------------------------
2.0.3 1. Fixed bug that caused programs with more than one dynamic
segment to link improperly.
(Ian Brumby)
2. Fixed bug that caused approximately one in 65536 load segments
to be trashed with a random word placed every 14 bytes through
the segment.
2.0.2 1. Fixed bug that caused the linker to step on memory that did
not belong to it when the +m flag was used. The most common
symptom of this bug was crashing during the second or
subsequent compile when using PRIZM.
(Kurtis Carter)
2.0.1 1. Fixed bug that caused the current location counter (* in
assembly language parlance) to be evaluated incorrectly in
some expressions.
-- Documentation Update -----------------------------------------------------
No changes.
|
ORCA/Linker 2.0.3
|
||||||
|
Copyright 1996, Byte Works Inc.
|
||||||
|
|
||||||
|
-- Change List --------------------------------------------------------------
|
||||||
|
|
||||||
|
2.0.3 1. Fixed bug that caused programs with more than one dynamic
|
||||||
|
segment to link improperly.
|
||||||
|
|
||||||
|
(Ian Brumby)
|
||||||
|
|
||||||
|
2. Fixed bug that caused approximately one in 65536 load segments
|
||||||
|
to be trashed with a random word placed every 14 bytes through
|
||||||
|
the segment.
|
||||||
|
|
||||||
|
2.0.2 1. Fixed bug that caused the linker to step on memory that did
|
||||||
|
not belong to it when the +m flag was used. The most common
|
||||||
|
symptom of this bug was crashing during the second or
|
||||||
|
subsequent compile when using PRIZM.
|
||||||
|
|
||||||
|
(Kurtis Carter)
|
||||||
|
|
||||||
|
2.0.1 1. Fixed bug that caused the current location counter (* in
|
||||||
|
assembly language parlance) to be evaluated incorrectly in
|
||||||
|
some expressions.
|
||||||
|
|
||||||
|
-- Documentation Update -----------------------------------------------------
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
15
linker.rez
Executable file → Normal file
15
linker.rez
Executable file → Normal file
|
@ -1 +1,14 @@
|
||||||
#include "types.rez"
resource rVersion(1) {
{
2, /* Major revision */
0, /* Minor revision */
3, /* Bug version */
release, /* Release stage */
0, /* Non-final release # */
},
verUS, /* Region code */
"ORCA/Linker", /* Short version number */
"Copyright 1996, Byte Works, Inc." /* Long version number */
};
|
#include "types.rez"
|
||||||
|
|
||||||
|
resource rVersion(1) {
|
||||||
|
{
|
||||||
|
2, /* Major revision */
|
||||||
|
0, /* Minor revision */
|
||||||
|
3, /* Bug version */
|
||||||
|
release, /* Release stage */
|
||||||
|
0, /* Non-final release # */
|
||||||
|
},
|
||||||
|
verUS, /* Region code */
|
||||||
|
"ORCA/Linker", /* Short version number */
|
||||||
|
"Copyright 1996, Byte Works, Inc." /* Long version number */
|
||||||
|
};
|
||||||
|
|
7
linkit
Executable file → Normal file
7
linkit
Executable file → Normal file
|
@ -1 +1,6 @@
|
||||||
echo set auxtype $DB01
set auxtype $DB01
set list obj/linker obj/util obj/file obj/pass1 obj/pass2 obj/seg obj/symbol obj/exp obj/out
echo link {Parameters} {list} 13/SysLib keep=obj/linker
link {Parameters} {list} 13/SysLib keep=obj/linker
|
echo set auxtype $DB01
|
||||||
|
set auxtype $DB01
|
||||||
|
|
||||||
|
set list obj/linker obj/util obj/file obj/pass1 obj/pass2 obj/seg obj/symbol obj/exp obj/out
|
||||||
|
echo link {Parameters} {list} 13/SysLib keep=obj/linker
|
||||||
|
link {Parameters} {list} 13/SysLib keep=obj/linker
|
||||||
|
|
84
make
Executable file → Normal file
84
make
Executable file → Normal file
|
@ -1 +1,83 @@
|
||||||
*
* Linker
*
unset exit
Newer obj/linker linker.rez
if {status} != 0
set exit on
echo compile -e linker.rez keep=obj/linker
compile -e linker.rez keep=obj/linker
unset exit
end
if {#} == 0 then
Newer obj/linker.a linker.asm linker.macros directPage
if {Status} != 0
set linker linker
end
Newer obj/util.a util.asm util.macros directPage
if {Status} != 0
set util util
end
Newer obj/file.a file.asm file.macros directPage
if {Status} != 0
set file file
end
Newer obj/pass1.a pass1.asm pass1.macros directPage
if {Status} != 0
set pass1 pass1
end
Newer obj/pass2.a pass2.asm pass2.macros directPage
if {Status} != 0
set pass2 pass2
end
Newer obj/seg.a seg.asm seg.macros directPage
if {Status} != 0
set seg seg
end
Newer obj/symbol.a symbol.asm symbol.macros directPage
if {Status} != 0
set symbol symbol
end
Newer obj/exp.a exp.asm exp.macros directPage
if {Status} != 0
set exp exp
end
Newer obj/out.a out.asm out.2 out.macros directPage
if {Status} != 0
set out out
end
set exit on
for i in {linker} {util} {file} {pass1} {pass2} {seg} {symbol} {exp} {out}
echo assemble +t +e {i}.asm
assemble +t +e {i}.asm
end
else
set exit on
for i
echo assemble +t +e {i}.asm
assemble +t +e {i}.asm
end
end
linkit
set echo on
copy -c obj/linker 5
|
*
|
||||||
|
* Linker
|
||||||
|
*
|
||||||
|
|
||||||
|
unset exit
|
||||||
|
|
||||||
|
Newer obj/linker linker.rez
|
||||||
|
if {status} != 0
|
||||||
|
set exit on
|
||||||
|
echo compile -e linker.rez keep=obj/linker
|
||||||
|
compile -e linker.rez keep=obj/linker
|
||||||
|
unset exit
|
||||||
|
end
|
||||||
|
|
||||||
|
if {#} == 0 then
|
||||||
|
|
||||||
|
Newer obj/linker.a linker.asm linker.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set linker linker
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/util.a util.asm util.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set util util
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/file.a file.asm file.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set file file
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/pass1.a pass1.asm pass1.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set pass1 pass1
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/pass2.a pass2.asm pass2.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set pass2 pass2
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/seg.a seg.asm seg.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set seg seg
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/symbol.a symbol.asm symbol.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set symbol symbol
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/exp.a exp.asm exp.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set exp exp
|
||||||
|
end
|
||||||
|
|
||||||
|
Newer obj/out.a out.asm out.2 out.macros directPage
|
||||||
|
if {Status} != 0
|
||||||
|
set out out
|
||||||
|
end
|
||||||
|
|
||||||
|
set exit on
|
||||||
|
|
||||||
|
for i in {linker} {util} {file} {pass1} {pass2} {seg} {symbol} {exp} {out}
|
||||||
|
echo assemble +t +e {i}.asm
|
||||||
|
assemble +t +e {i}.asm
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
set exit on
|
||||||
|
|
||||||
|
for i
|
||||||
|
echo assemble +t +e {i}.asm
|
||||||
|
assemble +t +e {i}.asm
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
linkit
|
||||||
|
|
||||||
|
set echo on
|
||||||
|
copy -c obj/linker 5
|
||||||
|
|
3148
out.asm
Executable file → Normal file
3148
out.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
794
out.mac
Executable file → Normal file
794
out.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
874
pass1.asm
Executable file → Normal file
874
pass1.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
452
pass1.mac
Executable file → Normal file
452
pass1.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
1662
pass2.asm
Executable file → Normal file
1662
pass2.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
611
pass2.mac
Executable file → Normal file
611
pass2.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
1106
seg.asm
Executable file → Normal file
1106
seg.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
525
seg.mac
Executable file → Normal file
525
seg.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
203
smac
Executable file → Normal file
203
smac
Executable file → Normal file
|
@ -1 +1,202 @@
|
||||||
macro
&lab da &op
&lab dc a3"&op"
dc i1'0'
mend
macro
&lab cmpl &n1,&n2
&lab lda 2+&n1
cmp 2+&n2
bne ~&syscnt
lda &n1
cmp &n2
~&syscnt anop
mend
MACRO
&LAB DOS &ADR
&LAB DC I"L:~&SYSNAME&SYSCNT"
~&SYSNAME&SYSCNT DC C"&ADR"
MEND
MACRO
&LAB MOVE4 &F,&T
&LAB ~SETM
LDA 2+&F
STA 2+&T
LDA &F
STA &T
~RESTM
MEND
macro
&lab sub &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 c:&parms
.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+3+&work
&totallen seta &totallen+&len
&i seta &i-1
aif &i,^b
.e
tsc
aif &work=0,.f
sec
sbc #&work
tcs
.f
phd
tcd
mend
macro
&lab ret &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+1
sta &worklen+&totallen+1
.i
pld
tsc
clc
adc #&worklen+&totallen
tcs
aif &len=0,.j
tya
.j
rts
mend
MACRO
&LAB MOVE &AD1,&AD2,&LEN
&LAB ANOP
LCLB &LA
LCLB &LI
LCLC &C
AIF C:&LEN,.A1
LCLC &LEN
&LEN SETC #2
.A1
&LA SETB S:LONGA
&LI SETB S:LONGI
AIF S:LONGA.AND.S:LONGI,.A
REP #32*(.NOT.&LA)+16*(.NOT.&LI)
LONGA ON
LONGI ON
.A
&C AMID &LEN,1,1
AIF "&C"<>"#",.D
&C AMID &LEN,2,L:&LEN-1
AIF &C<>2,.D
&C AMID &AD1,1,1
AIF "&C"<>"{",.B
&AD1 AMID &AD1,2,L:&AD1-2
&AD1 SETC (&AD1)
.B
LDA &AD1
&C AMID &AD2,1,1
AIF "&C"<>"{",.C
&AD2 AMID &AD2,2,L:&AD2-2
&AD2 SETC (&AD2)
.C
STA &AD2
AGO .G
.D
&C AMID &AD1,1,1
AIF "&C"="#",.F
&C AMID &LEN,1,1
AIF "&C"<>"{",.E
&LEN AMID &LEN,2,L:&LEN-2
&LEN SETC (&LEN)
.E
&C AMID &LEN,1,1
AIF "&C"="#",.E1
LDA &LEN
DEC A
AGO .E2
.E1
LDA &LEN-1
.E2
LDX #&AD1
LDY #&AD2
MVN &AD1,&AD2
AGO .G
.F
LDA &AD1
STA &AD2
LDA &LEN-2
LDX #&AD2
LDY #&AD2+1
MVN &AD2,&AD2
.G
AIF (&LA+&LI)=2,.I
SEP #32*(.NOT.&LA)+16*(.NOT.&LI)
AIF &LA,.H
LONGA OFF
.H
AIF &LI,.I
LONGI OFF
.I
MEND
|
macro
|
||||||
|
&lab da &op
|
||||||
|
&lab dc a3"&op"
|
||||||
|
dc i1'0'
|
||||||
|
mend
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab cmpl &n1,&n2
|
||||||
|
&lab lda 2+&n1
|
||||||
|
cmp 2+&n2
|
||||||
|
bne ~&syscnt
|
||||||
|
lda &n1
|
||||||
|
cmp &n2
|
||||||
|
~&syscnt anop
|
||||||
|
mend
|
||||||
|
|
||||||
|
|
||||||
|
MACRO
|
||||||
|
&LAB DOS &ADR
|
||||||
|
&LAB DC I"L:~&SYSNAME&SYSCNT"
|
||||||
|
~&SYSNAME&SYSCNT DC C"&ADR"
|
||||||
|
MEND
|
||||||
|
|
||||||
|
|
||||||
|
MACRO
|
||||||
|
&LAB MOVE4 &F,&T
|
||||||
|
&LAB ~SETM
|
||||||
|
LDA 2+&F
|
||||||
|
STA 2+&T
|
||||||
|
LDA &F
|
||||||
|
STA &T
|
||||||
|
~RESTM
|
||||||
|
MEND
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab sub &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 c:&parms
|
||||||
|
.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+3+&work
|
||||||
|
&totallen seta &totallen+&len
|
||||||
|
&i seta &i-1
|
||||||
|
aif &i,^b
|
||||||
|
.e
|
||||||
|
tsc
|
||||||
|
aif &work=0,.f
|
||||||
|
sec
|
||||||
|
sbc #&work
|
||||||
|
tcs
|
||||||
|
.f
|
||||||
|
phd
|
||||||
|
tcd
|
||||||
|
mend
|
||||||
|
|
||||||
|
|
||||||
|
macro
|
||||||
|
&lab ret &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+1
|
||||||
|
sta &worklen+&totallen+1
|
||||||
|
.i
|
||||||
|
pld
|
||||||
|
tsc
|
||||||
|
clc
|
||||||
|
adc #&worklen+&totallen
|
||||||
|
tcs
|
||||||
|
aif &len=0,.j
|
||||||
|
tya
|
||||||
|
.j
|
||||||
|
rts
|
||||||
|
mend
|
||||||
|
|
||||||
|
|
||||||
|
MACRO
|
||||||
|
&LAB MOVE &AD1,&AD2,&LEN
|
||||||
|
&LAB ANOP
|
||||||
|
LCLB &LA
|
||||||
|
LCLB &LI
|
||||||
|
LCLC &C
|
||||||
|
AIF C:&LEN,.A1
|
||||||
|
LCLC &LEN
|
||||||
|
&LEN SETC #2
|
||||||
|
.A1
|
||||||
|
&LA SETB S:LONGA
|
||||||
|
&LI SETB S:LONGI
|
||||||
|
AIF S:LONGA.AND.S:LONGI,.A
|
||||||
|
REP #32*(.NOT.&LA)+16*(.NOT.&LI)
|
||||||
|
LONGA ON
|
||||||
|
LONGI ON
|
||||||
|
.A
|
||||||
|
&C AMID &LEN,1,1
|
||||||
|
AIF "&C"<>"#",.D
|
||||||
|
&C AMID &LEN,2,L:&LEN-1
|
||||||
|
AIF &C<>2,.D
|
||||||
|
&C AMID &AD1,1,1
|
||||||
|
AIF "&C"<>"{",.B
|
||||||
|
&AD1 AMID &AD1,2,L:&AD1-2
|
||||||
|
&AD1 SETC (&AD1)
|
||||||
|
.B
|
||||||
|
LDA &AD1
|
||||||
|
&C AMID &AD2,1,1
|
||||||
|
AIF "&C"<>"{",.C
|
||||||
|
&AD2 AMID &AD2,2,L:&AD2-2
|
||||||
|
&AD2 SETC (&AD2)
|
||||||
|
.C
|
||||||
|
STA &AD2
|
||||||
|
AGO .G
|
||||||
|
.D
|
||||||
|
&C AMID &AD1,1,1
|
||||||
|
AIF "&C"="#",.F
|
||||||
|
&C AMID &LEN,1,1
|
||||||
|
AIF "&C"<>"{",.E
|
||||||
|
&LEN AMID &LEN,2,L:&LEN-2
|
||||||
|
&LEN SETC (&LEN)
|
||||||
|
.E
|
||||||
|
&C AMID &LEN,1,1
|
||||||
|
AIF "&C"="#",.E1
|
||||||
|
LDA &LEN
|
||||||
|
DEC A
|
||||||
|
AGO .E2
|
||||||
|
.E1
|
||||||
|
LDA &LEN-1
|
||||||
|
.E2
|
||||||
|
LDX #&AD1
|
||||||
|
LDY #&AD2
|
||||||
|
MVN &AD1,&AD2
|
||||||
|
AGO .G
|
||||||
|
.F
|
||||||
|
LDA &AD1
|
||||||
|
STA &AD2
|
||||||
|
LDA &LEN-2
|
||||||
|
LDX #&AD2
|
||||||
|
LDY #&AD2+1
|
||||||
|
MVN &AD2,&AD2
|
||||||
|
.G
|
||||||
|
AIF (&LA+&LI)=2,.I
|
||||||
|
SEP #32*(.NOT.&LA)+16*(.NOT.&LI)
|
||||||
|
AIF &LA,.H
|
||||||
|
LONGA OFF
|
||||||
|
.H
|
||||||
|
AIF &LI,.I
|
||||||
|
LONGI OFF
|
||||||
|
.I
|
||||||
|
MEND
|
||||||
|
|
1606
symbol.asm
Executable file → Normal file
1606
symbol.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
746
symbol.mac
Executable file → Normal file
746
symbol.mac
Executable file → Normal file
File diff suppressed because one or more lines are too long
512
util.asm
Executable file → Normal file
512
util.asm
Executable file → Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user