mirror of
https://github.com/byteworksinc/Linker.git
synced 2025-02-21 17:28:58 +00:00
The ORCA Linker 2.0.3 from the Opus ][ CD
This commit is contained in:
commit
748ae356d7
11
LICENSE
Normal file
11
LICENSE
Normal file
@ -0,0 +1,11 @@
|
||||
The ORCA Linker is released by the copyright holder under the terms of the original copyright.
|
||||
|
||||
The Byte Works, Inc. grants you the right to use this source code privately, fork it, and change it.
|
||||
|
||||
You may not redistribute the code in any form other than submission to this repository without the written permission of the copyright holder.
|
||||
|
||||
The copyright holder decided to do things this way for two reasons:
|
||||
|
||||
1. Reserve commercial distribution rights.
|
||||
|
||||
2. Ensure that any contributions and updates are available from a centralized source (this GitHib repository, for now).
|
14
README.md
Normal file
14
README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Linker
|
||||
Apple IIGS ORCA Linker, a link editor for the Apple IIGS object module format
|
||||
|
||||
If you would like to make changes to this linker and distribute them to others, feel free to submit them here. If the changes apply to compilation on and for an Apple IIGS, they will generally be approved for distribution on the master branch. For changes that run on a different platform, the project will either be forked or a new repository will be created, as appropriate.
|
||||
|
||||
The general conditions that must be met before a change is released on master are:
|
||||
|
||||
1. The modified linker must compile under the currently released version of ORCA/M.
|
||||
|
||||
2. The ORCA compilers must pass their test suites using the new linker, or the test suite must be suitably modified, too.
|
||||
|
||||
Contact support@byteworks.us if you need contributor access.
|
||||
|
||||
A complete distribution of the ORCA languages, including installers and documentation, is available from the Juiced GS store at https://juiced.gs/store/category/software/. It is distributed as part of the Opus ][ package.
|
1
backup
Executable file
1
backup
Executable file
@ -0,0 +1 @@
|
||||
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
|
1
count
Executable file
1
count
Executable file
@ -0,0 +1 @@
|
||||
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}
|
1
directpage
Executable file
1
directpage
Executable file
@ -0,0 +1 @@
|
||||
;
; 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
|
1
linker.asm
Executable file
1
linker.asm
Executable file
File diff suppressed because one or more lines are too long
1
linker.mac
Executable file
1
linker.mac
Executable file
File diff suppressed because one or more lines are too long
1
linker.notes
Executable file
1
linker.notes
Executable file
@ -0,0 +1 @@
|
||||
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.
|
1
linker.rez
Executable file
1
linker.rez
Executable file
@ -0,0 +1 @@
|
||||
#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 */
};
|
1
linkit
Executable file
1
linkit
Executable file
@ -0,0 +1 @@
|
||||
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
|
1
make
Executable file
1
make
Executable file
@ -0,0 +1 @@
|
||||
*
* 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
|
1
obj/README.txt
Normal file
1
obj/README.txt
Normal file
@ -0,0 +1 @@
|
||||
This directory is used by the make file for storing object files.
|
1
smac
Executable file
1
smac
Executable file
@ -0,0 +1 @@
|
||||
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
|
1
symbol.asm
Executable file
1
symbol.asm
Executable file
File diff suppressed because one or more lines are too long
1
symbol.mac
Executable file
1
symbol.mac
Executable file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user