fixup commit for tag 'oct-1'
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
Action
|
||||
as
|
||||
cg
|
||||
top
|
||||
cv
|
||||
int
|
||||
libem
|
||||
libend
|
||||
libsys
|
||||
mach_params
|
||||
@@ -1,25 +0,0 @@
|
||||
name "PDP 11 assembler"
|
||||
dir as
|
||||
end
|
||||
name "PDP 11 backend"
|
||||
dir cg
|
||||
end
|
||||
name "PDP 11 target optimizer"
|
||||
dir top
|
||||
end
|
||||
name "PDP 11 conversion program"
|
||||
dir cv
|
||||
end
|
||||
name "PDP 11 interpreter"
|
||||
system pdp*
|
||||
dir int
|
||||
end
|
||||
name "PDP 11 EM library"
|
||||
dir libem
|
||||
end
|
||||
name "PDP 11 etext,edata,end library"
|
||||
dir libend
|
||||
end
|
||||
name "PDP 11 systemcall library"
|
||||
dir libsys
|
||||
end
|
||||
@@ -1,6 +0,0 @@
|
||||
mach0.c
|
||||
mach1.c
|
||||
mach2.c
|
||||
mach3.c
|
||||
mach4.c
|
||||
mach5.c
|
||||
@@ -1,67 +0,0 @@
|
||||
# $Header$
|
||||
EMHOME = ../../..
|
||||
h = $(EMHOME)/h
|
||||
LIBOBJ = $(EMHOME)/modules/lib/libobject.a
|
||||
CDIR = $(EMHOME)/mach/proto/as
|
||||
CPP = $(EMHOME)/lib/cpp
|
||||
DEF =
|
||||
|
||||
FFLAG =
|
||||
INCL = -I. -I$h $(DEF)
|
||||
CFLAGS = $(FFLAG) -O $(INCL)
|
||||
YFLAGS = -d
|
||||
LDFLAGS = $(FFLAG)
|
||||
|
||||
CSRC = $(CDIR)/comm3.c $(CDIR)/comm4.c $(CDIR)/comm5.c \
|
||||
$(CDIR)/comm6.c $(CDIR)/comm7.c $(CDIR)/comm8.c
|
||||
COBJ = comm3.o comm4.o comm5.o \
|
||||
comm6.o comm7.o comm8.o
|
||||
MACH = mach0.c mach1.c mach2.c mach3.c mach4.c mach5.c
|
||||
COMM = $(CDIR)/comm0.h $(CDIR)/comm1.h $(CDIR)/comm2.y $(CSRC)
|
||||
|
||||
all: as
|
||||
|
||||
install:all
|
||||
../../install as
|
||||
|
||||
cmp:
|
||||
-../../compare as
|
||||
|
||||
clean:
|
||||
rm -f *.o as as.[cy] y.tab.h
|
||||
|
||||
pr: $(MACH)
|
||||
@pr -n $(MACH)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
as: $(COBJ) as.o
|
||||
$(CC) $(LDFLAGS) $(COBJ) as.o $(LIBOBJ) -o as
|
||||
|
||||
as.y: $(CDIR)/comm2.y
|
||||
$(CPP) -P -I. -I$h $(DEF) $(CDIR)/comm2.y >as.y
|
||||
-@if test -f Expect ; then cat Expect ; else echo "expect 1 shift/reduce conflict"; fi
|
||||
|
||||
lint: $(CSRC) as.c
|
||||
lint $(INCL) $(CSRC) as.c
|
||||
|
||||
y.tab.h: as.c
|
||||
$(COBJ): y.tab.h
|
||||
$(COBJ) as.y: $(CDIR)/comm0.h mach0.c
|
||||
$(COBJ) as.y: $(CDIR)/comm1.h mach1.c
|
||||
as.y: mach2.c
|
||||
comm3.o: mach3.c
|
||||
as.y: mach4.c
|
||||
comm8.o: mach5.c
|
||||
comm3.o: $(CDIR)/comm3.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/comm3.c
|
||||
comm4.o: $(CDIR)/comm4.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/comm4.c
|
||||
comm5.o: $(CDIR)/comm5.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/comm5.c
|
||||
comm6.o: $(CDIR)/comm6.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/comm6.c
|
||||
comm7.o: $(CDIR)/comm7.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/comm7.c
|
||||
comm8.o: $(CDIR)/comm8.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/comm8.c
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#define RCSID0 "$Id$"
|
||||
|
||||
/*
|
||||
* PDP 11 machine dependent options
|
||||
*/
|
||||
|
||||
#define THREE_PASS
|
||||
#define WORDS_REVERSED
|
||||
#define LISTING
|
||||
#define RELOCATION
|
||||
#undef ISALPHA
|
||||
#define ISALPHA(c) (isalpha(c) || c == '_' || c == '.' || c == '~')
|
||||
#undef ISALNUM
|
||||
#define ISALNUM(c) (isalnum(c) || c == '_' || c == '.' || c == '~')
|
||||
|
||||
#undef ALIGNWORD
|
||||
#define ALIGNWORD 2
|
||||
#undef ALIGNSECT
|
||||
#define ALIGNSECT 2
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#define RCSID1 "$Id$"
|
||||
|
||||
#
|
||||
/*
|
||||
* PDP 11 Machine dependent C declarations
|
||||
*/
|
||||
|
||||
/* Addressing modes */
|
||||
#define RMODE 00
|
||||
#define AIMODE 020
|
||||
#define ADMODE 040
|
||||
#define INDMODE 060
|
||||
#define RDEFMODE 010
|
||||
#define AIDEFMODE 030
|
||||
#define ADDEFMODE 050
|
||||
#define INDDEFMODE 070
|
||||
|
||||
#define OPLDF 0172400
|
||||
#define OPSTF 0174000
|
||||
#define OPSOB 077000
|
||||
#define OPBRA 0400
|
||||
|
||||
#define low3(z) (((short) z) & 07)
|
||||
#define low6(z) (((short) z) & 077)
|
||||
#define low7(z) (((short) z) & 0177)
|
||||
|
||||
#define fit3(z) (low3(z) == (z))
|
||||
#define fit6(z) (low6(z) == (z))
|
||||
#define fit8(z) (lowb(z) == (z))
|
||||
|
||||
extern expr_t exp_1, exp_2;
|
||||
extern int rel_1, rel_2;
|
||||
extern int im1flag INIT(0);
|
||||
extern int im2flag INIT(0);
|
||||
extern valu_t adjust();
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#define RCSID2 "$Id$"
|
||||
|
||||
/*
|
||||
* PDP 11 machine dependent yacc declarations
|
||||
*/
|
||||
%token <y_word> REG
|
||||
%token <y_word> FREG
|
||||
%token <y_word> FRSP
|
||||
%token <y_word> JMP
|
||||
%token <y_word> OP_SO
|
||||
%token <y_word> OP_DO
|
||||
%token <y_word> OP_R_SO
|
||||
%token <y_word> BR
|
||||
%token <y_word> EJMP
|
||||
%token <y_word> JSR
|
||||
%token <y_word> RTS
|
||||
%token <y_word> MARK
|
||||
%token <y_word> SOB
|
||||
%token <y_word> SPL
|
||||
%token <y_word> TRAP
|
||||
%token <y_word> OP_NO
|
||||
%token <y_word> OP_SO_R
|
||||
%token <y_word> MFP
|
||||
%token <y_word> FOP_FSO_FR
|
||||
%token <y_word> FOP_NO
|
||||
%token <y_word> FOP_FSO
|
||||
%token <y_word> FOP_SO
|
||||
%token <y_word> MOVF
|
||||
%token <y_word> FOP_SO_FR
|
||||
%token <y_word> FOP_FR_SO
|
||||
%token <y_word> FOP_FR_FSO
|
||||
%token <y_word> CLEARCC
|
||||
%token <y_word> SETCC
|
||||
|
||||
%type <y_word> opr1, opr2, op2, fopr2, fopr1, ari, ainc, adec
|
||||
%type <y_word> fop2, clcc, secc, fregister
|
||||
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#define RCSID3 "$Id$"
|
||||
|
||||
/*,
|
||||
* PDP 11 keywords,
|
||||
*/
|
||||
0, REG, 00, "r0",
|
||||
0, REG, 01, "r1",
|
||||
0, REG, 02, "r2",
|
||||
0, REG, 03, "r3",
|
||||
0, REG, 04, "r4",
|
||||
0, REG, 05, "r5",
|
||||
0, REG, 06, "r6",
|
||||
0, REG, 06, "sp",
|
||||
0, REG, 07, "r7",
|
||||
0, REG, 07, "pc",
|
||||
0, FREG, 00, "fr0",
|
||||
0, FREG, 01, "fr1",
|
||||
0, FREG, 02, "fr2",
|
||||
0, FREG, 03, "fr3",
|
||||
0, FRSP, 04, "fr4",
|
||||
0, FRSP, 05, "fr5",
|
||||
0, OP_SO, 05000, "clr",
|
||||
0, OP_SO, 0105000, "clrb",
|
||||
0, OP_SO, 05100, "com",
|
||||
0, OP_SO, 0105100, "comb",
|
||||
0, OP_SO, 005200, "inc",
|
||||
0, OP_SO, 0105200, "incb",
|
||||
0, OP_SO, 005300, "dec",
|
||||
0, OP_SO, 0105300, "decb",
|
||||
0, OP_SO, 005400, "neg",
|
||||
0, OP_SO, 0105400, "negb",
|
||||
0, OP_SO, 005700, "tst",
|
||||
0, OP_SO, 0105700, "tstb",
|
||||
0, OP_SO, 006200, "asr",
|
||||
0, OP_SO, 0106200, "asrb",
|
||||
0, OP_SO, 006300, "asl",
|
||||
0, OP_SO, 0106300, "aslb",
|
||||
0, OP_SO, 006000, "ror",
|
||||
0, OP_SO, 0106000, "rorb",
|
||||
0, OP_SO, 006100, "rol",
|
||||
0, OP_SO, 0106100, "rolb",
|
||||
0, OP_SO, 000300, "swab",
|
||||
0, OP_SO, 005500, "adc",
|
||||
0, OP_SO, 0105500, "adcb",
|
||||
0, OP_SO, 005600, "sbc",
|
||||
0, OP_SO, 0105600, "sbcb",
|
||||
0, OP_SO, 006700, "sxt",
|
||||
0, OP_DO, 010000, "mov",
|
||||
0, OP_DO, 0110000, "movb",
|
||||
0, OP_DO, 020000, "cmp",
|
||||
0, OP_DO, 0120000, "cmpb",
|
||||
0, OP_DO, 060000, "add",
|
||||
0, OP_DO, 0160000, "sub",
|
||||
0, OP_DO, 030000, "bit",
|
||||
0, OP_DO, 0130000, "bitb",
|
||||
0, OP_DO, 040000, "bic",
|
||||
0, OP_DO, 0140000, "bicb",
|
||||
0, OP_DO, 050000, "bis",
|
||||
0, OP_DO, 0150000, "bisb",
|
||||
0, OP_R_SO, 074000, "xor",
|
||||
0, JMP, 0100, "jmp",
|
||||
0, BR, 0400, "br",
|
||||
0, BR, 01000, "bne",
|
||||
0, BR, 01400, "beq",
|
||||
0, BR, 0100000, "bpl",
|
||||
0, BR, 0100400, "bmi",
|
||||
0, BR, 0102000, "bvc",
|
||||
0, BR, 0102400, "bvs",
|
||||
0, BR, 0103000, "bcc",
|
||||
0, BR, 0103400, "bcs",
|
||||
0, BR, 002000, "bge",
|
||||
0, BR, 002400, "blt",
|
||||
0, BR, 003000, "bgt",
|
||||
0, BR, 003400, "ble",
|
||||
0, BR, 0101000, "bhi",
|
||||
0, BR, 0101400, "blos",
|
||||
0, BR, 0103000, "bhis",
|
||||
0, BR, 0103400, "blo",
|
||||
0, EJMP, 0400, "jbr",
|
||||
0, EJMP, 01000, "jne",
|
||||
0, EJMP, 01400, "jeq",
|
||||
0, EJMP, 0100000, "jpl",
|
||||
0, EJMP, 0100400, "jmi",
|
||||
0, EJMP, 0102000, "jvc",
|
||||
0, EJMP, 0102400, "jvs",
|
||||
0, EJMP, 0103000, "jcc",
|
||||
0, EJMP, 0103400, "jcs",
|
||||
0, EJMP, 02000, "jge",
|
||||
0, EJMP, 02400, "jlt",
|
||||
0, EJMP, 03000, "jgt",
|
||||
0, EJMP, 03400, "jle",
|
||||
0, EJMP, 0101000, "jhi",
|
||||
0, EJMP, 0101400, "jlos",
|
||||
0, EJMP, 0103000, "jhis",
|
||||
0, EJMP, 0103400, "jlo",
|
||||
0, JSR, 004000, "jsr",
|
||||
0, RTS, 000200, "rts",
|
||||
0, MARK, 006400, "mark",
|
||||
0, SOB, 077000, "sob",
|
||||
0, SPL, 0230, "spl",
|
||||
0, TRAP, 0104000, "emt",
|
||||
0, TRAP, 0104400, "trap",
|
||||
0, TRAP, 0104400, "sys",
|
||||
0, OP_NO, 03, "bpt",
|
||||
0, OP_NO, 04, "iot",
|
||||
0, OP_NO, 02, "rti",
|
||||
0, OP_NO, 06, "rtt",
|
||||
0, OP_NO, 0, "halt",
|
||||
0, OP_NO, 01, "wait",
|
||||
0, OP_NO, 05, "reset",
|
||||
0, OP_NO, 0170000, "cfcc",
|
||||
0, OP_NO, 0170002, "seti",
|
||||
0, OP_NO, 0170012, "setl",
|
||||
0, OP_NO, 0170001, "setf",
|
||||
0, OP_NO, 0170011, "setd",
|
||||
0, CLEARCC, 0241, "clc",
|
||||
0, CLEARCC, 0242, "clv",
|
||||
0, CLEARCC, 0244, "clz",
|
||||
0, CLEARCC, 0250, "cln",
|
||||
0, SETCC, 0261, "sec",
|
||||
0, SETCC, 0262, "sev",
|
||||
0, SETCC, 0264, "sez",
|
||||
0, SETCC, 0270, "sen",
|
||||
0, OP_SO_R, 070000, "mul",
|
||||
0, OP_SO_R, 071000, "div",
|
||||
0, OP_SO_R, 072000, "ash",
|
||||
0, OP_SO_R, 073000, "ashc",
|
||||
0, MFP, 006500, "mfpi",
|
||||
0, MFP, 0106500, "mfpd",
|
||||
0, MFP, 006600, "mtpi",
|
||||
0, MFP, 0106600, "mtpd",
|
||||
0, FOP_FSO_FR, 0172000, "addf",
|
||||
0, FOP_FSO_FR, 0173000, "subf",
|
||||
0, FOP_FSO_FR, 0171000, "mulf",
|
||||
0, FOP_FSO_FR, 0174400, "divf",
|
||||
0, FOP_FSO_FR, 0173400, "cmpf",
|
||||
0, FOP_FSO_FR, 0171400, "modf",
|
||||
0, FOP_FSO, 0170400, "clrf",
|
||||
0, FOP_FSO, 0170700, "negf",
|
||||
0, FOP_FSO, 0170600, "absf",
|
||||
0, FOP_FSO, 0170500, "tstf",
|
||||
0, FOP_SO, 0170100, "ldfps",
|
||||
0, FOP_SO, 0170200, "stfps",
|
||||
0, FOP_SO, 0170300, "stst",
|
||||
0, MOVF, 0, "movf",
|
||||
0, FOP_SO_FR, 0177000, "movif",
|
||||
0, FOP_SO_FR, 0176400, "movie",
|
||||
0, FOP_FR_SO, 0175400, "movfi",
|
||||
0, FOP_FR_SO, 0175000, "movei",
|
||||
0, FOP_FSO_FR, 0177400, "movof",
|
||||
0, FOP_FR_FSO, 0176000, "movfo",
|
||||
@@ -1,154 +0,0 @@
|
||||
#define RCSID4 "$Id$"
|
||||
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* PDP 11 dependent yacc table
|
||||
*/
|
||||
|
||||
operation
|
||||
: OP_SO opr1
|
||||
{ emit2( $1 | $2 ); op1($2); }
|
||||
| OP_DO opr1 ',' opr2
|
||||
{ emit2( $1 | ($2 << 6) | $4); op1($2); op2($4);}
|
||||
| OP_R_SO REG ',' opr1
|
||||
{ emit2( $1 | ($2 << 6) | $4); op1($4); }
|
||||
| BR expr
|
||||
{ branch( $1, $2); }
|
||||
| EJMP expr
|
||||
{ ejump( $1, $2); }
|
||||
| JMP opr1
|
||||
{ jump( $1, $2); }
|
||||
| JSR REG ',' opr1
|
||||
{ emit2( $1 | ($2 << 6) | $4); op1($4); }
|
||||
| RTS REG
|
||||
{ emit2($1 | $2); }
|
||||
| MARK absexp
|
||||
{ fit(fit6($2)); emit2($1 | $2); }
|
||||
| SOB REG ',' expr
|
||||
{ sob($2, $4); }
|
||||
| SPL absexp
|
||||
{ fit(fit3($2)); emit2( $1 | $2 ); }
|
||||
| TRAP absexp
|
||||
{ fit(fit8($2)); emit2( $1 | $2 ); }
|
||||
| OP_NO
|
||||
{emit2($1); }
|
||||
| clcc
|
||||
{ emit2($1); }
|
||||
| secc
|
||||
{ emit2($1); }
|
||||
| OP_SO_R opr1 ',' REG
|
||||
{ emit2( $1 | ($4 << 6) | $2); op1($2); }
|
||||
| MFP opr1
|
||||
{ emit2( $1 | $2); op1($2); }
|
||||
| FOP_FSO_FR fopr1 ',' fregister
|
||||
{emit2($1 | ($4 << 6) | $2); op1($2); }
|
||||
| FOP_FSO fopr1
|
||||
{ emit2( $1 | $2); op1($2); }
|
||||
| FOP_SO opr1
|
||||
{ emit2( $1 | $2); op1($2); }
|
||||
| MOVF fop2 ',' fregister
|
||||
{ emit2(OPLDF | ($4 << 6) | $2); op2($2);}
|
||||
| MOVF fregister ',' fopr1
|
||||
{ emit2(OPSTF | ($2 << 6) | $4); op1($4); }
|
||||
| FOP_SO_FR opr1 ',' fregister
|
||||
{ emit2($1 | ($4 << 6) | $2); op1($2); }
|
||||
| FOP_FR_SO fregister ',' opr1
|
||||
{ emit2($1 | ($2 << 6) | $4); op1($4); }
|
||||
| FOP_FR_FSO fregister ',' fopr1
|
||||
{ emit2($1 | ($2 << 6) | $4); op1($4); }
|
||||
;
|
||||
clcc
|
||||
: CLEARCC
|
||||
| clcc '|' CLEARCC
|
||||
{ $$ = ( $1 | $3 ); }
|
||||
;
|
||||
secc
|
||||
: SETCC
|
||||
| secc '|' SETCC
|
||||
{ $$ = ( $1 | $3 ); }
|
||||
;
|
||||
opr1
|
||||
: opr2
|
||||
{ $$ = $1;
|
||||
exp_1 = exp_2;
|
||||
RELOMOVE(rel_1, rel_2);
|
||||
im1flag = im2flag;
|
||||
im2flag=0;
|
||||
}
|
||||
;
|
||||
opr2
|
||||
: REG
|
||||
| op2
|
||||
;
|
||||
op2
|
||||
: ari
|
||||
{ $$ = ( RDEFMODE | $1); }
|
||||
| '*' REG
|
||||
{ $$ = ( RDEFMODE | $2); }
|
||||
| ainc
|
||||
{ $$ = ( AIMODE | $1 ); }
|
||||
| adec
|
||||
{ $$ = ( ADMODE | $1 ); }
|
||||
| expr ari
|
||||
{ exp_2 = $1; $$ = ( INDMODE | $2); im2flag = 1;
|
||||
RELOMOVE(rel_2, relonami);
|
||||
}
|
||||
| '*' expr ari
|
||||
{ exp_2 = $2; $$ = ( INDDEFMODE | $3); im2flag = 1;
|
||||
RELOMOVE(rel_2, relonami);
|
||||
}
|
||||
| '*' ainc
|
||||
{ $$ = ( AIDEFMODE | $2 ); }
|
||||
| '*' adec
|
||||
{ $$ = ( ADDEFMODE | $2 ); }
|
||||
| expr
|
||||
{ exp_2 = $1; $$ = (INDMODE | 07); im2flag = 1;
|
||||
RELOMOVE(rel_2, relonami);
|
||||
}
|
||||
| '$' expr
|
||||
{ exp_2 =$2; $$ = ( AIMODE | 07); im2flag = 1;
|
||||
RELOMOVE(rel_2, relonami);
|
||||
}
|
||||
| '*' '$' expr
|
||||
{ exp_2 = $3; $$ = ( AIDEFMODE | 07 ); im2flag = 1;
|
||||
RELOMOVE(rel_2, relonami);
|
||||
}
|
||||
| '*' expr
|
||||
{ exp_2 = $2; $$ = ( INDDEFMODE | 07 ); im2flag = 1;
|
||||
RELOMOVE(rel_2, relonami);
|
||||
}
|
||||
;
|
||||
fopr1
|
||||
: fopr2
|
||||
{ $$ = $1; exp_1 = exp_2; im1flag = im2flag; im2flag=0;
|
||||
RELOMOVE(rel_1, rel_2);
|
||||
}
|
||||
;
|
||||
fopr2
|
||||
: fregister
|
||||
| fop2
|
||||
;
|
||||
fop2
|
||||
: FRSP
|
||||
| op2
|
||||
;
|
||||
ari
|
||||
: '(' REG ')'
|
||||
{ $$ = $2; }
|
||||
;
|
||||
ainc
|
||||
: ari '+'
|
||||
;
|
||||
adec
|
||||
: '-' ari
|
||||
{ $$ = $2; }
|
||||
;
|
||||
fregister
|
||||
: FREG
|
||||
| REG
|
||||
;
|
||||
@@ -1,124 +0,0 @@
|
||||
#define RCSID5 "$Id$"
|
||||
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
*/
|
||||
|
||||
op1(mode) {
|
||||
int relpc = 0;
|
||||
if (im1flag) {
|
||||
if (mode == 067 || mode == 077) {
|
||||
exp_1.val = adjust(exp_1);
|
||||
relpc = RELPC;
|
||||
}
|
||||
#ifdef RELOCATION
|
||||
RELOMOVE(relonami, rel_1);
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
newrelo(exp_1.typ, RELO2|relpc);
|
||||
#endif
|
||||
emit2(exp_1.val);
|
||||
im1flag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
op2(mode) {
|
||||
int relpc = 0;
|
||||
if (im2flag) {
|
||||
if (mode == 067 || mode == 077) {
|
||||
relpc = RELPC;
|
||||
exp_2.val = adjust(exp_2);
|
||||
}
|
||||
#ifdef RELOCATION
|
||||
RELOMOVE(relonami, rel_2);
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
newrelo(exp_2.typ, RELO2|relpc);
|
||||
#endif
|
||||
emit2(exp_2.val);
|
||||
im2flag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
branch(opc,exp) expr_t exp; {
|
||||
register eval;
|
||||
register sm;
|
||||
|
||||
eval = adjust(exp) >> 1;
|
||||
sm = fitb(eval);
|
||||
if ((exp.typ & ~S_DOT) != DOTTYP && pass >= PASS_2) sm = 0;
|
||||
if (!sm && pass >= PASS_2) {
|
||||
serror("label too far");
|
||||
}
|
||||
emit2(opc | lowb(eval));
|
||||
}
|
||||
|
||||
ejump(opc, exp) expr_t exp; {
|
||||
register sm,eval;
|
||||
int gain;
|
||||
|
||||
# ifdef THREE_PASS
|
||||
eval = adjust(exp) >> 1;
|
||||
sm = fitb(eval);
|
||||
if ((exp.typ & ~S_DOT) != DOTTYP) {
|
||||
sm = 0;
|
||||
}
|
||||
gain = (opc == OPBRA ? 2 : 4);
|
||||
if (small(sm,gain)) {
|
||||
emit2( opc | lowb(eval));
|
||||
}
|
||||
else {
|
||||
# endif
|
||||
if (opc != OPBRA) {
|
||||
emit2((opc^0400) | 02);
|
||||
}
|
||||
|
||||
exp_1 = exp;
|
||||
im1flag = 1;
|
||||
emit2(0100|067);
|
||||
op1(067);
|
||||
# ifdef THREE_PASS
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
sob(reg, exp) expr_t exp; {
|
||||
if ((exp.typ & ~S_DOT) != DOTTYP) {
|
||||
serror("error in sob-label");
|
||||
}
|
||||
exp.val = ( - adjust(exp) ) >> 1;
|
||||
fit(fit6(exp.val));
|
||||
emit2( OPSOB | (reg << 6) | exp.val);
|
||||
}
|
||||
|
||||
jump(opc,opr) {
|
||||
register val;
|
||||
|
||||
# ifdef THREE_PASS
|
||||
if (opr==067) {
|
||||
register sm = 0;
|
||||
|
||||
val = adjust(exp_1) >> 1;
|
||||
if ( fitb(val) && (exp_1.typ & ~S_DOT) == DOTTYP) {
|
||||
sm = 1;
|
||||
}
|
||||
if (small(sm,2)) {
|
||||
emit2(OPBRA | lowb(val));
|
||||
im1flag = 0;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
emit2(opc | opr);
|
||||
op1(opr);
|
||||
}
|
||||
|
||||
valu_t adjust(exp) expr_t exp; {
|
||||
valu_t val;
|
||||
|
||||
val = exp.val - DOTVAL - 2;
|
||||
# ifdef THREE_PASS
|
||||
if (pass == PASS_2 && val > 0) val -= DOTGAIN;
|
||||
# endif
|
||||
return(val);
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
mach.c
|
||||
mach.h
|
||||
table
|
||||
@@ -1,184 +0,0 @@
|
||||
# $Header$
|
||||
|
||||
EMHOME=../../..
|
||||
PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG
|
||||
PFLAGS=
|
||||
CFLAGS=$(PREFLAGS) $(PFLAGS) -O
|
||||
LDFLAGS=$(PFLAGS)
|
||||
LINTOPTS=-hbxac
|
||||
LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a
|
||||
CDIR=$(EMHOME)/mach/proto/cg
|
||||
CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
|
||||
$(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
|
||||
$(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
|
||||
$(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
|
||||
OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
|
||||
move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
|
||||
|
||||
all: tables.c
|
||||
make "EMHOME="$(EMHOME) cg
|
||||
|
||||
cg: tables.o $(OFILES)
|
||||
$(CC) $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
|
||||
|
||||
tables.o: tables.c
|
||||
$(CC) -c $(PREFLAGS) -I$(CDIR) tables.c
|
||||
|
||||
codegen.o: $(CDIR)/codegen.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/codegen.c
|
||||
compute.o: $(CDIR)/compute.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/compute.c
|
||||
equiv.o: $(CDIR)/equiv.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/equiv.c
|
||||
fillem.o: $(CDIR)/fillem.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/fillem.c
|
||||
gencode.o: $(CDIR)/gencode.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/gencode.c
|
||||
glosym.o: $(CDIR)/glosym.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/glosym.c
|
||||
main.o: $(CDIR)/main.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/main.c
|
||||
move.o: $(CDIR)/move.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/move.c
|
||||
nextem.o: $(CDIR)/nextem.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/nextem.c
|
||||
reg.o: $(CDIR)/reg.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/reg.c
|
||||
regvar.o: $(CDIR)/regvar.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/regvar.c
|
||||
salloc.o: $(CDIR)/salloc.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/salloc.c
|
||||
state.o: $(CDIR)/state.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/state.c
|
||||
subr.o: $(CDIR)/subr.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/subr.c
|
||||
var.o: $(CDIR)/var.c
|
||||
$(CC) -c $(CFLAGS) $(CDIR)/var.c
|
||||
|
||||
install: all
|
||||
../../install cg
|
||||
|
||||
cmp: all
|
||||
-../../compare cg
|
||||
|
||||
distr: tables.c
|
||||
rm -f tables1.[ch]
|
||||
cp tables.c tables1.c
|
||||
cp tables.h tables1.h
|
||||
chmod -w tables1.[ch]
|
||||
|
||||
|
||||
tables.c: table
|
||||
-mv tables.h tables.h.save
|
||||
$(EMHOME)/lib/cpp -P table | $(EMHOME)/lib/cgg > debug.out
|
||||
-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
|
||||
-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
|
||||
|
||||
lint: $(CFILES)
|
||||
lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
|
||||
clean:
|
||||
rm -f *.o tables.c tables.h debug.out cg tables.h.save
|
||||
|
||||
codegen.o: $(CDIR)/assert.h
|
||||
codegen.o: $(CDIR)/data.h
|
||||
codegen.o: $(CDIR)/equiv.h
|
||||
codegen.o: $(CDIR)/extern.h
|
||||
codegen.o: $(CDIR)/param.h
|
||||
codegen.o: $(CDIR)/result.h
|
||||
codegen.o: $(CDIR)/state.h
|
||||
codegen.o: tables.h
|
||||
codegen.o: $(CDIR)/types.h
|
||||
compute.o: $(CDIR)/assert.h
|
||||
compute.o: $(CDIR)/data.h
|
||||
compute.o: $(CDIR)/extern.h
|
||||
compute.o: $(CDIR)/glosym.h
|
||||
compute.o: $(CDIR)/param.h
|
||||
compute.o: $(CDIR)/result.h
|
||||
compute.o: tables.h
|
||||
compute.o: $(CDIR)/types.h
|
||||
equiv.o: $(CDIR)/assert.h
|
||||
equiv.o: $(CDIR)/data.h
|
||||
equiv.o: $(CDIR)/equiv.h
|
||||
equiv.o: $(CDIR)/extern.h
|
||||
equiv.o: $(CDIR)/param.h
|
||||
equiv.o: $(CDIR)/result.h
|
||||
equiv.o: tables.h
|
||||
equiv.o: $(CDIR)/types.h
|
||||
fillem.o: $(CDIR)/assert.h
|
||||
fillem.o: $(CDIR)/data.h
|
||||
fillem.o: $(CDIR)/extern.h
|
||||
fillem.o: mach.c
|
||||
fillem.o: mach.h
|
||||
fillem.o: $(CDIR)/param.h
|
||||
fillem.o: $(CDIR)/regvar.h
|
||||
fillem.o: $(CDIR)/result.h
|
||||
fillem.o: tables.h
|
||||
fillem.o: $(CDIR)/types.h
|
||||
gencode.o: $(CDIR)/assert.h
|
||||
gencode.o: $(CDIR)/data.h
|
||||
gencode.o: $(CDIR)/extern.h
|
||||
gencode.o: $(CDIR)/param.h
|
||||
gencode.o: $(CDIR)/result.h
|
||||
gencode.o: tables.h
|
||||
gencode.o: $(CDIR)/types.h
|
||||
glosym.o: $(CDIR)/glosym.h
|
||||
glosym.o: $(CDIR)/param.h
|
||||
glosym.o: tables.h
|
||||
glosym.o: $(CDIR)/types.h
|
||||
main.o: $(CDIR)/param.h
|
||||
move.o: $(CDIR)/assert.h
|
||||
move.o: $(CDIR)/data.h
|
||||
move.o: $(CDIR)/extern.h
|
||||
move.o: $(CDIR)/param.h
|
||||
move.o: $(CDIR)/result.h
|
||||
move.o: tables.h
|
||||
move.o: $(CDIR)/types.h
|
||||
nextem.o: $(CDIR)/assert.h
|
||||
nextem.o: $(CDIR)/data.h
|
||||
nextem.o: $(CDIR)/extern.h
|
||||
nextem.o: $(CDIR)/param.h
|
||||
nextem.o: $(CDIR)/result.h
|
||||
nextem.o: tables.h
|
||||
nextem.o: $(CDIR)/types.h
|
||||
reg.o: $(CDIR)/assert.h
|
||||
reg.o: $(CDIR)/data.h
|
||||
reg.o: $(CDIR)/extern.h
|
||||
reg.o: $(CDIR)/param.h
|
||||
reg.o: $(CDIR)/result.h
|
||||
reg.o: tables.h
|
||||
reg.o: $(CDIR)/types.h
|
||||
regvar.o: $(CDIR)/assert.h
|
||||
regvar.o: $(CDIR)/data.h
|
||||
regvar.o: $(CDIR)/extern.h
|
||||
regvar.o: $(CDIR)/param.h
|
||||
regvar.o: $(CDIR)/regvar.h
|
||||
regvar.o: $(CDIR)/result.h
|
||||
regvar.o: tables.h
|
||||
regvar.o: $(CDIR)/types.h
|
||||
salloc.o: $(CDIR)/assert.h
|
||||
salloc.o: $(CDIR)/data.h
|
||||
salloc.o: $(CDIR)/extern.h
|
||||
salloc.o: $(CDIR)/param.h
|
||||
salloc.o: $(CDIR)/result.h
|
||||
salloc.o: tables.h
|
||||
salloc.o: $(CDIR)/types.h
|
||||
state.o: $(CDIR)/assert.h
|
||||
state.o: $(CDIR)/data.h
|
||||
state.o: $(CDIR)/extern.h
|
||||
state.o: $(CDIR)/param.h
|
||||
state.o: $(CDIR)/result.h
|
||||
state.o: $(CDIR)/state.h
|
||||
state.o: tables.h
|
||||
state.o: $(CDIR)/types.h
|
||||
subr.o: $(CDIR)/assert.h
|
||||
subr.o: $(CDIR)/data.h
|
||||
subr.o: $(CDIR)/extern.h
|
||||
subr.o: $(CDIR)/param.h
|
||||
subr.o: $(CDIR)/result.h
|
||||
subr.o: tables.h
|
||||
subr.o: $(CDIR)/types.h
|
||||
var.o: $(CDIR)/data.h
|
||||
var.o: $(CDIR)/param.h
|
||||
var.o: $(CDIR)/result.h
|
||||
var.o: tables.h
|
||||
var.o: $(CDIR)/types.h
|
||||
@@ -1,210 +0,0 @@
|
||||
#ifndef NORCSID
|
||||
static char rcsid[] = "$Id$";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
* Author: Hans van Staveren
|
||||
*/
|
||||
|
||||
/*
|
||||
* machine dependent back end routines for the PDP-11
|
||||
*/
|
||||
|
||||
/* #define REGPATCH /* save all registers in markblock */
|
||||
|
||||
con_part(sz,w) register sz; word w; {
|
||||
|
||||
while (part_size % sz)
|
||||
part_size++;
|
||||
if (part_size == TEM_WSIZE)
|
||||
part_flush();
|
||||
if (sz == 1) {
|
||||
w &= 0xFF;
|
||||
if (part_size)
|
||||
w <<= 8;
|
||||
part_word |= w;
|
||||
} else {
|
||||
assert(sz == 2);
|
||||
part_word = w;
|
||||
}
|
||||
part_size += sz;
|
||||
}
|
||||
|
||||
con_mult(sz) word sz; {
|
||||
long l, atol();
|
||||
|
||||
if (sz != 4)
|
||||
fatal("bad icon/ucon size");
|
||||
l = atol(str);
|
||||
#ifdef ACK_ASS
|
||||
fprintf(codefile,".data2 0%o, 0%o !%s\n",(int)(l>>16),(int)l, str);
|
||||
#else
|
||||
fprintf(codefile,"\t%o;%o\n",(int)(l>>16),(int)l);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define PDPFLOAT
|
||||
#define FL_MSL_AT_LOW_ADDRESS 1
|
||||
#define FL_MSW_AT_LOW_ADDRESS 1
|
||||
#define FL_MSB_AT_LOW_ADDRESS 0
|
||||
#define CODE_GENERATOR
|
||||
#include <con_float>
|
||||
|
||||
#ifdef REGVARS
|
||||
|
||||
char Rstring[10];
|
||||
full lbytes;
|
||||
struct regadm {
|
||||
char *ra_str;
|
||||
long ra_off;
|
||||
} regadm[2];
|
||||
int n_regvars;
|
||||
|
||||
regscore(off,size,typ,score,totyp) long off; {
|
||||
|
||||
if (size != 2)
|
||||
return(-1);
|
||||
score -= 1; /* allow for save/restore */
|
||||
if (off>=0)
|
||||
score -= 2;
|
||||
if (typ==reg_pointer)
|
||||
score *= 17;
|
||||
else if (typ==reg_loop)
|
||||
score = 10*score+50; /* Guestimate */
|
||||
else
|
||||
score *= 10;
|
||||
return(score); /* estimated # of words of profit */
|
||||
}
|
||||
|
||||
i_regsave() {
|
||||
|
||||
Rstring[0] = 0;
|
||||
n_regvars=0;
|
||||
}
|
||||
|
||||
f_regsave() {
|
||||
register i;
|
||||
|
||||
if (n_regvars==0 || lbytes==0) {
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"mov r2,-(sp)\nmov r4,-(sp)\n");
|
||||
#endif
|
||||
fprintf(codefile,"mov r5,-(sp)\nmov sp,r5\n");
|
||||
if (lbytes == 2)
|
||||
fprintf(codefile,"tst -(sp)\n");
|
||||
else if (lbytes!=0)
|
||||
fprintf(codefile,"sub $0%o,sp\n",lbytes);
|
||||
for (i=0;i<n_regvars;i++)
|
||||
fprintf(codefile,"mov %s,-(sp)\n",regadm[i].ra_str);
|
||||
} else {
|
||||
if (lbytes>6) {
|
||||
fprintf(codefile,"mov $0%o,r0\n",lbytes);
|
||||
fprintf(codefile,"jsr r5,PR%s\n",Rstring);
|
||||
} else {
|
||||
fprintf(codefile,"jsr r5,PR%d%s\n",lbytes,Rstring);
|
||||
}
|
||||
}
|
||||
for (i=0;i<n_regvars;i++)
|
||||
if (regadm[i].ra_off>=0)
|
||||
fprintf(codefile,"mov 0%lo(r5),%s\n",regadm[i].ra_off,
|
||||
regadm[i].ra_str);
|
||||
}
|
||||
|
||||
regsave(regstr,off,size) char *regstr; long off; {
|
||||
|
||||
fprintf(codefile,"%c Local %ld into %s\n",COMMENTCHAR,off,regstr);
|
||||
/* commented away
|
||||
#ifndef REGPATCH
|
||||
fprintf(codefile,"mov %s,-(sp)\n",regstr);
|
||||
#endif
|
||||
strcat(Rstring,regstr);
|
||||
if (off>=0)
|
||||
fprintf(codefile,"mov 0%lo(r5),%s\n",off,regstr);
|
||||
end of commented away */
|
||||
|
||||
strcat(Rstring,regstr);
|
||||
regadm[n_regvars].ra_str = regstr;
|
||||
regadm[n_regvars].ra_off = off;
|
||||
n_regvars++;
|
||||
}
|
||||
|
||||
regreturn() {
|
||||
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"jmp eret\n");
|
||||
#else
|
||||
fprintf(codefile,"jmp RT%s\n",Rstring);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
prolog(nlocals) full nlocals; {
|
||||
|
||||
#ifndef REGVARS
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"mov r2,-(sp)\nmov r4,-(sp)\n");
|
||||
#endif
|
||||
fprintf(codefile,"mov r5,-(sp)\nmov sp,r5\n");
|
||||
if (nlocals == 0)
|
||||
return;
|
||||
if (nlocals == 2)
|
||||
fprintf(codefile,"tst -(sp)\n");
|
||||
else
|
||||
fprintf(codefile,"sub $0%o,sp\n",nlocals);
|
||||
#else
|
||||
lbytes = nlocals;
|
||||
#endif
|
||||
}
|
||||
|
||||
dlbdlb(as,ls) string as,ls; {
|
||||
|
||||
if (strlen(as)+strlen(ls)+2<sizeof(labstr)) {
|
||||
strcat(ls,":");
|
||||
strcat(ls,as);
|
||||
} else
|
||||
fatal("too many consecutive labels");
|
||||
}
|
||||
|
||||
mes(type) word type; {
|
||||
int argt ;
|
||||
|
||||
switch ( (int)type ) {
|
||||
case ms_ext :
|
||||
for (;;) {
|
||||
switch ( argt=getarg(
|
||||
ptyp(sp_cend)|ptyp(sp_pnam)|sym_ptyp) ) {
|
||||
case sp_cend :
|
||||
return ;
|
||||
default:
|
||||
strarg(argt) ;
|
||||
#ifdef ACK_ASS
|
||||
fprintf(codefile,".define %s\n",argstr) ;
|
||||
#else
|
||||
fprintf(codefile,".globl %s\n",argstr) ;
|
||||
#endif
|
||||
break ;
|
||||
}
|
||||
}
|
||||
default :
|
||||
while ( getarg(any_ptyp) != sp_cend ) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
char *segname[] = {
|
||||
#ifdef ACK_ASS
|
||||
".sect .text", /* SEGTXT */
|
||||
".sect .data", /* SEGCON */
|
||||
".sect .rom", /* SEGROM */
|
||||
".sect .bss" /* SEGBSS */
|
||||
#else
|
||||
".text", /* SEGTXT */
|
||||
".data", /* SEGCON */
|
||||
".data", /* SEGROM */
|
||||
".bss" /* SEGBSS */
|
||||
#endif
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
/* The next define switches between codegeneration for an ACK assembler
|
||||
* or for the standard UNIX V7 assembler.
|
||||
* If on code is generated for the ACK assembler.
|
||||
*/
|
||||
#define ACK_ASS /* code for ACK assembler */
|
||||
|
||||
#ifdef ACK_ASS
|
||||
#define COMMENTCHAR '!'
|
||||
#define ex_ap(y) fprintf(codefile,".extern %s\n",y)
|
||||
#else
|
||||
#define COMMENTCHAR '/'
|
||||
#define ex_ap(y) fprintf(codefile,".globl %s\n",y)
|
||||
#endif
|
||||
#define in_ap(y) /* nothing */
|
||||
|
||||
#define newplb(x) fprintf(codefile,"%s:\n",x)
|
||||
#define newilb(x) fprintf(codefile,"%s:\n",x)
|
||||
#define newdlb(x) fprintf(codefile,"%s:\n",x)
|
||||
#ifdef ACK_ASS
|
||||
#define newlbss(l,x) fprintf(codefile,".comm %s,%u\n",l,x);
|
||||
#else
|
||||
#define newlbss(l,x) fprintf(codefile,"%s:.=.+0%o\n",l,x);
|
||||
#endif
|
||||
|
||||
#define cst_fmt "$0%o"
|
||||
#define off_fmt "0%o"
|
||||
#define ilb_fmt "I%x_%x"
|
||||
#define dlb_fmt "_%d"
|
||||
#define hol_fmt "hol%d"
|
||||
|
||||
#define hol_off "0%lo+hol%d"
|
||||
|
||||
#ifdef ACK_ASS
|
||||
#define con_cst(x) fprintf(codefile,".data2 0%lo\n",x)
|
||||
#define con_ilb(x) fprintf(codefile,".data2 %s\n",x)
|
||||
#define con_dlb(x) fprintf(codefile,".data2 %s\n",x)
|
||||
#else
|
||||
#define con_cst(x) fprintf(codefile,"0%lo\n",x)
|
||||
#define con_ilb(x) fprintf(codefile,"%s\n",x)
|
||||
#define con_dlb(x) fprintf(codefile,"%s\n",x)
|
||||
#endif
|
||||
|
||||
#ifdef ACK_ASS
|
||||
#define modhead ".sect .text; .sect .rom; .sect .data; .sect .bss\n"
|
||||
#define fmt_id(f,t) sprintf(t,"_%s",f)
|
||||
#else
|
||||
#define id_first '_'
|
||||
#endif
|
||||
|
||||
#define BSS_INIT 0
|
||||
@@ -1,135 +0,0 @@
|
||||
#ifndef NORCSID
|
||||
static char rcsid[] = "$Header$";
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
*
|
||||
* This product is part of the Amsterdam Compiler Kit.
|
||||
*
|
||||
* Permission to use, sell, duplicate or disclose this software must be
|
||||
* obtained in writing. Requests for such permissions may be sent to
|
||||
*
|
||||
* Dr. Andrew S. Tanenbaum
|
||||
* Wiskundig Seminarium
|
||||
* Vrije Universiteit
|
||||
* Postbox 7161
|
||||
* 1007 MC Amsterdam
|
||||
* The Netherlands
|
||||
*
|
||||
* Author: Hans van Staveren
|
||||
*/
|
||||
|
||||
char buf[512];
|
||||
char *index();
|
||||
|
||||
main() {
|
||||
register n,sa;
|
||||
register char *p;
|
||||
|
||||
sa=0;
|
||||
for (;;) {
|
||||
getline(buf);
|
||||
if (n=stackadjust()) {
|
||||
sa += n;
|
||||
continue;
|
||||
}
|
||||
if (nullinstruction())
|
||||
continue;
|
||||
if (sa) {
|
||||
if (buf[0]=='t' && buf[1]=='s' && buf[2]=='t' && buf[3]==' ') {
|
||||
sa -= 2;
|
||||
buf[0]='m';
|
||||
buf[1]='o';
|
||||
buf[2]='v';
|
||||
strcat(buf,",(sp)+");
|
||||
} else if (buf[0]=='m' && buf[1]=='o' && buf[2]=='v' &&
|
||||
buf[3]==' ' && (p=index(&buf[5],','))!=0 &&
|
||||
p[1]=='-' && p[2]=='(' && p[3]=='s') {
|
||||
sa -= 2;
|
||||
p[1]=' ';
|
||||
}
|
||||
}
|
||||
switch(sa) {
|
||||
case 0:break;
|
||||
case 2:puts("tst (sp)+");sa=0;break;
|
||||
case 4:puts("cmp (sp)+,(sp)+");sa=0;break;
|
||||
case 6:puts("add $06,sp");sa=0;break;
|
||||
}
|
||||
puts(buf);
|
||||
}
|
||||
}
|
||||
|
||||
getline(buf) register char *buf; {
|
||||
register c;
|
||||
|
||||
while ((c=getchar())==' ' || c=='\t')
|
||||
;
|
||||
if (c==EOF)
|
||||
exit(0);
|
||||
do *buf++=c;
|
||||
while ((c=getchar())!='\n');
|
||||
*buf=0;
|
||||
}
|
||||
|
||||
stackadjust() {
|
||||
|
||||
if (buf[0]=='t' &&
|
||||
buf[1]=='s' &&
|
||||
buf[2]=='t' &&
|
||||
buf[3]==' ' &&
|
||||
buf[4]=='(' &&
|
||||
buf[5]=='s' &&
|
||||
buf[6]=='p' &&
|
||||
buf[7]==')' &&
|
||||
buf[8]=='+') return(2);
|
||||
if (buf[0]=='c' &&
|
||||
buf[1]=='m' &&
|
||||
buf[2]=='p' &&
|
||||
buf[3]==' ' &&
|
||||
buf[4]=='(' &&
|
||||
buf[5]=='s' &&
|
||||
buf[6]=='p' &&
|
||||
buf[7]==')' &&
|
||||
buf[8]=='+' &&
|
||||
buf[9]==',' &&
|
||||
buf[10]=='(' &&
|
||||
buf[11]=='s' &&
|
||||
buf[12]=='p' &&
|
||||
buf[13]==')' &&
|
||||
buf[14]=='+') return(4);
|
||||
if (buf[0]=='a' &&
|
||||
buf[1]=='d' &&
|
||||
buf[2]=='d' &&
|
||||
buf[3]==' ' &&
|
||||
buf[4]=='$' &&
|
||||
buf[5]=='0' &&
|
||||
buf[6]=='6' &&
|
||||
buf[7]==',' &&
|
||||
buf[8]=='s' &&
|
||||
buf[9]=='p' &&
|
||||
buf[10]==0) return(6);
|
||||
return(0);
|
||||
}
|
||||
|
||||
nullinstruction() {
|
||||
register char *p;
|
||||
|
||||
if (buf[4]=='$' && buf[5]=='0' && buf[6]=='0' && buf[7]==',') {
|
||||
p=index(buf,'-');
|
||||
if (p!=0 && p[1]=='(')
|
||||
return(0);
|
||||
p=index(buf,'+');
|
||||
if (p!=0 && p[-1]==')')
|
||||
return(0);
|
||||
if (buf[0]=='b' && buf[1]=='i' && (buf[2]=='s' || buf[2]=='c'))
|
||||
return(1);
|
||||
if (buf[0]=='a' && buf[1]=='d' && buf[2]=='d')
|
||||
return(1);
|
||||
if (buf[0]=='s' && buf[1]=='u' && buf[2]=='b')
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
2863
mach/pdp/cg/table
2863
mach/pdp/cg/table
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
proto.make
|
||||
cv.c
|
||||
@@ -1,25 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
LIBOBJ = $(EMHOME)/modules/lib/libobject.a
|
||||
INCLUDE = $(EMHOME)/h
|
||||
CFLAGS = -I. -I$(INCLUDE) -O
|
||||
TARGETS = cv
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
install: all
|
||||
../../install cv
|
||||
|
||||
cmp: all
|
||||
../../compare cv
|
||||
|
||||
cv: cv.o
|
||||
$(CC) $(LDFLAGS) -o cv cv.o $(LIBOBJ)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGETS) *.o nohup.out Out
|
||||
|
||||
pr:
|
||||
@pr Makefile cv.c
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
311
mach/pdp/cv/cv.c
311
mach/pdp/cv/cv.c
@@ -1,311 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program converts ack.out format to PDP 11 V7 a.out format.
|
||||
* It uses ~em/modules/lib/libobject.a.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
struct exec {
|
||||
short a_magic;
|
||||
short a_text;
|
||||
short a_data;
|
||||
short a_bss;
|
||||
short a_syms;
|
||||
short a_entry;
|
||||
short a_unused;
|
||||
short a_flag;
|
||||
};
|
||||
|
||||
struct nlist
|
||||
{ char n_name[8];
|
||||
short n_type;
|
||||
short n_value;
|
||||
};
|
||||
|
||||
#include <out.h>
|
||||
|
||||
#ifndef NORCSID
|
||||
static char rcs_id[] = "$Id$" ;
|
||||
#endif
|
||||
|
||||
#define ENTRY 0x0 /* entry point */
|
||||
|
||||
/*
|
||||
* Header and section table of new format object file.
|
||||
*/
|
||||
struct outhead outhead;
|
||||
struct outsect outsect[S_MAX];
|
||||
|
||||
struct exec exec;
|
||||
|
||||
char *output_file;
|
||||
int outputfile_created;
|
||||
FILE *output;
|
||||
int rom_in_text;
|
||||
|
||||
char *program ;
|
||||
|
||||
char flag ;
|
||||
|
||||
/* Output file definitions and such */
|
||||
|
||||
#define TEXTSG 0
|
||||
#define ROMSG 1
|
||||
#define DATASG 2
|
||||
#define BSSSG 3
|
||||
#define LSECT BSSSG+1
|
||||
#define NSECT LSECT+1
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
register struct exec *e = &exec;
|
||||
|
||||
output = stdout;
|
||||
program= argv[0] ;
|
||||
if ( argc>1 && argv[1][0]=='-' ) {
|
||||
flag=argv[1][1] ;
|
||||
argc-- ; argv++ ;
|
||||
}
|
||||
switch (argc) {
|
||||
case 1: rd_fdopen(0);
|
||||
break;
|
||||
case 3: if ((output = fopen(argv[2], "w")) == NULL) {
|
||||
fatal("Can't write %s.\n", argv[2]);
|
||||
}
|
||||
output_file = argv[2];
|
||||
outputfile_created = 1;
|
||||
/* FALLTHROUGH */
|
||||
case 2:
|
||||
if (! rd_open(argv[1]))
|
||||
fatal("Can't read %s.\n", argv[1]);
|
||||
break;
|
||||
default:fatal("Usage: %s <as object> <dl object>.\n", argv[0]);
|
||||
}
|
||||
rd_ohead(&outhead);
|
||||
if (BADMAGIC(outhead))
|
||||
fatal("Not an ack object file.\n");
|
||||
if (outhead.oh_flags & HF_LINK)
|
||||
fatal("Contains unresolved references.\n");
|
||||
if (outhead.oh_nrelo > 0)
|
||||
fprintf(stderr, "Warning: relocation information present.\n");
|
||||
if ( outhead.oh_nsect!=LSECT && outhead.oh_nsect!=NSECT )
|
||||
fatal("Input file must have %d sections, not %ld\n",
|
||||
NSECT,outhead.oh_nsect) ;
|
||||
rd_sect(outsect, outhead.oh_nsect);
|
||||
if (outsect[TEXTSG].os_size & 1)
|
||||
outsect[TEXTSG].os_size++;
|
||||
if (outsect[ROMSG].os_size & 1)
|
||||
outsect[ROMSG].os_size++;
|
||||
if (outsect[DATASG].os_size & 1)
|
||||
outsect[DATASG].os_size++;
|
||||
if (outsect[BSSSG].os_size & 1)
|
||||
outsect[BSSSG].os_size++;
|
||||
/* A few checks */
|
||||
if ( outsect[TEXTSG].os_base != ENTRY)
|
||||
fatal("text must start at %d not at 0x%lx\n", ENTRY,
|
||||
outsect[TEXTSG].os_base) ;
|
||||
if ( outsect[BSSSG].os_flen != 0 )
|
||||
fatal("bss space contains initialized data\n") ;
|
||||
if ( outsect[BSSSG].os_base != outsect[DATASG].os_base+
|
||||
outsect[DATASG].os_size )
|
||||
fatal("bss segment must follow data segment\n") ;
|
||||
|
||||
e->a_magic = 0407;
|
||||
e->a_text = outsect[TEXTSG].os_size;
|
||||
e->a_data = outsect[ROMSG].os_size + outsect[DATASG].os_size;
|
||||
e->a_bss = outsect[BSSSG].os_size;
|
||||
e->a_entry = outsect[TEXTSG].os_base;
|
||||
e->a_syms = outhead.oh_nname * sizeof (struct nlist);
|
||||
e->a_flag = 1;
|
||||
if ( outsect[ROMSG].os_base == 0x0 ) {
|
||||
/* Separate I/D */
|
||||
e->a_magic = 0411;
|
||||
if ( outsect[DATASG].os_base != outsect[ROMSG].os_base+
|
||||
outsect[ROMSG].os_size )
|
||||
fatal("data segment must follow rom\n") ;
|
||||
} else if ( outsect[ROMSG].os_lign == 0x2000 ) {
|
||||
/* -n, rom in data */
|
||||
e->a_magic = 0410;
|
||||
if ( outsect[DATASG].os_base != outsect[ROMSG].os_base+
|
||||
outsect[ROMSG].os_size )
|
||||
fatal("data segment must follow rom\n") ;
|
||||
} else if ( outsect[DATASG].os_lign == 0x2000 ) {
|
||||
/* -n, rom in text */
|
||||
rom_in_text = 1;
|
||||
e->a_magic = 0410;
|
||||
e->a_text += outsect[ROMSG].os_size;
|
||||
e->a_data -= outsect[ROMSG].os_size;
|
||||
if ( outsect[ROMSG].os_base != outsect[TEXTSG].os_base+
|
||||
outsect[TEXTSG].os_size )
|
||||
fatal("rom segment must follow text\n") ;
|
||||
}
|
||||
else {
|
||||
if ( outsect[ROMSG].os_base != outsect[TEXTSG].os_base+
|
||||
outsect[TEXTSG].os_size )
|
||||
fatal("rom segment must follow text\n") ;
|
||||
if ( outsect[DATASG].os_base != outsect[ROMSG].os_base+
|
||||
outsect[ROMSG].os_size )
|
||||
fatal("data segment must follow rom\n") ;
|
||||
}
|
||||
if ( outhead.oh_nsect==NSECT ) {
|
||||
if ( outsect[LSECT].os_base != outsect[BSSSG].os_base+
|
||||
outsect[BSSSG].os_size )
|
||||
fatal("end segment must follow bss\n") ;
|
||||
if ( outsect[LSECT].os_size != 0 )
|
||||
fatal("end segment must be empty\n") ;
|
||||
}
|
||||
|
||||
/* Action at last */
|
||||
wr_int2(e->a_magic);
|
||||
wr_int2(e->a_text);
|
||||
wr_int2(e->a_data);
|
||||
wr_int2(e->a_bss);
|
||||
wr_int2(e->a_syms);
|
||||
wr_int2(e->a_entry);
|
||||
wr_int2(e->a_unused);
|
||||
wr_int2(e->a_flag);
|
||||
emits(&outsect[TEXTSG]) ;
|
||||
emits(&outsect[ROMSG]) ;
|
||||
emits(&outsect[DATASG]) ;
|
||||
emit_symtab();
|
||||
if ( outputfile_created ) chmod(argv[2],0755);
|
||||
return 0;
|
||||
}
|
||||
|
||||
wr_int2(n)
|
||||
{
|
||||
putc(n, output);
|
||||
putc((n>>8), output);
|
||||
}
|
||||
|
||||
/*
|
||||
wr_long(l)
|
||||
long l;
|
||||
{
|
||||
putc((int)(l >> 16), output);
|
||||
putc((int)(l >> 24), output);
|
||||
putc((int) l, output);
|
||||
putc(((int)l >> 8), output);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Transfer the emitted byted from one file to another.
|
||||
*/
|
||||
emits(section) struct outsect *section ; {
|
||||
register long n ;
|
||||
register int blk;
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
n= section->os_flen ;
|
||||
rd_outsect(section - outsect);
|
||||
while (n > 0) {
|
||||
blk = n > BUFSIZ ? BUFSIZ : n;
|
||||
rd_emit(buffer, (long) blk);
|
||||
fwrite(buffer, sizeof(char), blk, output);
|
||||
n -= blk;
|
||||
}
|
||||
if ((n = section->os_size - section->os_flen) > 0) {
|
||||
for (blk = BUFSIZ - 1; blk >= 0; blk--) {
|
||||
buffer[blk] = 0;
|
||||
}
|
||||
while (n > 0) {
|
||||
blk = n > BUFSIZ ? BUFSIZ : n;
|
||||
fwrite(buffer, sizeof(char), blk, output);
|
||||
n -= blk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit_symtab()
|
||||
{
|
||||
struct outname ACK_name; /* symbol table entry in ACK format */
|
||||
struct nlist PDP_name; /* symbol table entry in PDP V7 format */
|
||||
register unsigned short i;
|
||||
|
||||
extern char *malloc();
|
||||
char *chars;
|
||||
long l;
|
||||
long off = OFF_CHAR(outhead);
|
||||
int j;
|
||||
char *p;
|
||||
|
||||
chars = malloc((unsigned) (outhead.oh_nchar));
|
||||
rd_string(chars,outhead.oh_nchar);
|
||||
for (i = 0; i < outhead.oh_nname; i++) {
|
||||
rd_name(&ACK_name, 1);
|
||||
switch(ACK_name.on_type & S_TYP) {
|
||||
case S_UND:
|
||||
PDP_name.n_type = 0;
|
||||
break;
|
||||
case S_ABS:
|
||||
PDP_name.n_type = 01;
|
||||
break;
|
||||
case S_MIN + TEXTSG:
|
||||
PDP_name.n_type = 02;
|
||||
break;
|
||||
case S_MIN + ROMSG:
|
||||
if (rom_in_text) {
|
||||
PDP_name.n_type = 02;
|
||||
break;
|
||||
}
|
||||
/* Fall through */
|
||||
case S_MIN + DATASG:
|
||||
PDP_name.n_type = 03;
|
||||
break;
|
||||
case S_MIN + BSSSG:
|
||||
case S_MIN + LSECT:
|
||||
PDP_name.n_type = 04;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"warning: unknown s_type: %d\n",
|
||||
ACK_name.on_type & S_TYP);
|
||||
}
|
||||
if (ACK_name.on_type & S_EXT) PDP_name.n_type |= 040;
|
||||
PDP_name.n_value = ACK_name.on_valu;
|
||||
if (ACK_name.on_foff == 0) {
|
||||
p = "\0\0";
|
||||
}
|
||||
else {
|
||||
l = ACK_name.on_foff - off;
|
||||
if (l < 0 || l >= outhead.oh_nchar) {
|
||||
fatal("bad on_off: %ld\n",l);
|
||||
}
|
||||
p = &chars[l];
|
||||
}
|
||||
for (j = 0; j < 8; j++) {
|
||||
PDP_name.n_name[j] = *p++;
|
||||
if (*p == '\0') break;
|
||||
}
|
||||
for (j++; j < 8; j++) {
|
||||
PDP_name.n_name[j] = 0;
|
||||
}
|
||||
fwrite((char *) &PDP_name, sizeof(char), 8, output);
|
||||
wr_int2(PDP_name.n_type);
|
||||
wr_int2(PDP_name.n_value);
|
||||
}
|
||||
}
|
||||
|
||||
/* VARARGS1 */
|
||||
fatal(s, a1, a2)
|
||||
char *s;
|
||||
{
|
||||
fprintf(stderr,"%s: ",program) ;
|
||||
fprintf(stderr, s, a1, a2);
|
||||
if (outputfile_created)
|
||||
unlink(output_file);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
rd_fatal()
|
||||
{
|
||||
fatal("read error\n");
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
#PARAMS do not remove this line!
|
||||
|
||||
OBJLIB=$(TARGET_HOME)/modules/lib/libobject.$(LIBSUF)
|
||||
|
||||
SRC_DIR = $(SRC_HOME)/mach/pdp/cv
|
||||
|
||||
all: cv
|
||||
|
||||
cv: cv.$(SUF)
|
||||
$(CC) $(LDOPTIONS) -o cv cv.$(SUF) $(OBJLIB)
|
||||
|
||||
cv.$(SUF): $(SRC_DIR)/cv.c
|
||||
$(CC) $(COPTIONS) -I$(TARGET_HOME)/h -c $(SRC_DIR)/cv.c
|
||||
|
||||
install: all
|
||||
-mkdir $(TARGET_HOME)/lib.bin/pdp
|
||||
cp cv $(TARGET_HOME)/lib.bin/pdp/cv
|
||||
|
||||
cmp: all
|
||||
-cmp cv $(TARGET_HOME)/lib.bin/pdp/cv
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) Out cv
|
||||
|
||||
lint:
|
||||
$(LINT) $(LINTOPTIONS) -I$(TARGET_HOME)/h $(SRC_DIR)/cv.c $(UTIL_HOME)/modules/lib/$(LINTPREF)object.$(LINTSUF)
|
||||
|
||||
pr:
|
||||
@pr $(SRC_DIR)/proto.make $(SRC_DIR)/cv.c
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
@@ -1,15 +0,0 @@
|
||||
proto.make
|
||||
README
|
||||
em.1
|
||||
eminform.1
|
||||
em.c
|
||||
em_int.s
|
||||
eminform.s
|
||||
c+
|
||||
c-
|
||||
f+
|
||||
f-
|
||||
p+
|
||||
p-
|
||||
t+
|
||||
t-
|
||||
@@ -1,51 +0,0 @@
|
||||
INTS=em_t--- em_---- em_tf-- em_t-c- em_t--p
|
||||
b=../../../lib/em22
|
||||
|
||||
all: $(INTS) eminform em
|
||||
|
||||
em: em.c
|
||||
$(CC) -o em -I../../../h em.c
|
||||
|
||||
eminform: eminform.s
|
||||
as eminform.s;ld -i -o eminform a.out -lc
|
||||
|
||||
em_t---: t+ f- c- p- em_int.s
|
||||
as t+ f- c- p- em_int.s;ld -i -o em_t--- a.out -lc
|
||||
|
||||
em_----: t- f- c- p- em_int.s
|
||||
as t- f- c- p- em_int.s;ld -i -o em_---- a.out -lc
|
||||
|
||||
em_tf--: t+ f+ c- p- em_int.s
|
||||
as t+ f+ c- p- em_int.s;ld -i -o em_tf-- a.out -lc
|
||||
|
||||
em_t-c-: t+ f- c+ p- em_int.s
|
||||
as t+ f- c+ p- em_int.s;ld -i -o em_t-c- a.out -lc
|
||||
|
||||
em_t--p: t+ f- c- p+ em_int.s
|
||||
as t+ f- c- p+ em_int.s;ld -i -o em_t--p a.out -lc
|
||||
|
||||
install: all
|
||||
-mkdir $b
|
||||
cp em_???? $b
|
||||
cp em eminform ../../../bin
|
||||
cp em.1 eminform.1 ../../../man
|
||||
|
||||
cmp: all
|
||||
-cmp em_t--- $b/em_t---
|
||||
-cmp em_---- $b/em_----
|
||||
-cmp em_tf-- $b/em_tf--
|
||||
-cmp em_t-c- $b/em_t-c-
|
||||
-cmp em_t--p $b/em_t--p
|
||||
-cmp em ../../../bin/em
|
||||
-cmp eminform ../../../bin/eminform
|
||||
-cmp em.1 ../../../man/em.1
|
||||
-cmp eminform.1 ../../../man/eminform.1
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.old a.out em eminform $(INTS)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
pr:
|
||||
@pr em.c em_int.s eminform.s
|
||||
@@ -1,18 +0,0 @@
|
||||
In this directory is a complete interpreter for EM-code on a
|
||||
PDP 11, written in Unix assembly language.
|
||||
There exist assembler options .test .opfreq .flow .count .prof
|
||||
and .last.
|
||||
.test tests undefined integers, bad arrays etcetera
|
||||
.opfreq makes a table of the usage of othe em-opcodes
|
||||
.flow makes a table of the used lines
|
||||
.count makes a count table of the used lines
|
||||
.prof estimates the amount of time spent on each source line
|
||||
.last gives a table of the last executed lines and files
|
||||
The interpreter writes its runtime information on a file
|
||||
em_runinf, which is converted to human readable files
|
||||
em_last, em_opfreq, em_profile, em_flow and em_count by
|
||||
the program eminform, for which we also have an assembler
|
||||
source in this directory.
|
||||
Because the size of the interpreter just exceeds 8k, it is
|
||||
advisible to have either .prof or .test turned off on a machine
|
||||
without separate I and D when a large user program is running.
|
||||
@@ -1 +0,0 @@
|
||||
.count = 1
|
||||
@@ -1 +0,0 @@
|
||||
.count = 0
|
||||
@@ -1,76 +0,0 @@
|
||||
.\" $Id$
|
||||
.TH EM 1 "$Revision$"
|
||||
.ad
|
||||
.SH NAME
|
||||
em \- calling program for em interpreters
|
||||
.SH SYNOPSIS
|
||||
\fBem\fP [-t] [+fcp] [loadfile [args ... ...] ]
|
||||
.SH DESCRIPTION
|
||||
The loadfile ("e.out" if not specified) is opened to read the first 8 word header.
|
||||
The format of this header is explained in e.out(5).
|
||||
One of these 8 words is a flag word
|
||||
specifying the interpreter options requested at compile time.
|
||||
The usual setting of these options is +t -f -c -p.
|
||||
One of these options may be overridden at run time
|
||||
by the corresponding flag of em.
|
||||
Based on these options the name of the appropriate interpreter
|
||||
is constructed.
|
||||
.PP
|
||||
The flags control the following options that can be turned off
|
||||
or on by prepending them with - or + respectively:
|
||||
.IP t
|
||||
run time tests for undefined variables, array bounds etc...
|
||||
This option costs a small amount of memory and some time.
|
||||
However, it is very useful for debugging.
|
||||
.IP p
|
||||
profiling of the entire program. The interpreter maintain tables containing
|
||||
an estimate of the number of memory cycles used per source line.
|
||||
This option is expensive in time as well as in memory space.
|
||||
The result tables made at run time are dumped onto a file named
|
||||
em_runinf. This file is converted to human readable format
|
||||
by the program eminform(1) which writes the profiling information
|
||||
on a file called em_profile.
|
||||
.IP f
|
||||
maintain a bit map of all source lines that have been executed.
|
||||
This map is written also onto the file em_runinf and can be interpreted by eminform(1) which writes in this case the file em_flow.
|
||||
This option is almost free in time and space.
|
||||
.IP c
|
||||
count line usage in tables that
|
||||
contains for every source line the number of times it
|
||||
was entered.
|
||||
These tables are also written onto em_runinf.
|
||||
Eminform(1) can be used to convert this information into the
|
||||
file em_count.
|
||||
Cheap in time, expensive in memory space.
|
||||
.PP
|
||||
These flags
|
||||
give rise to 5 different interpreters which are in the
|
||||
directory ~em/lib/em22/em_????
|
||||
.PP
|
||||
If the interpreter exits with a non-zero exit status, then the line numbers
|
||||
of the 64 last executed source lines are dumped on the file
|
||||
em_runinf
|
||||
in the current directory. Eminform(1) writes this information
|
||||
on the human readable file em_last.
|
||||
.SH "FILES"
|
||||
.IP ~em/lib/em22/em_???? 35
|
||||
interpreters proper
|
||||
.IP em_runinf
|
||||
memory dump containing runtime information
|
||||
.IP em_profile
|
||||
profile data
|
||||
.IP em_count
|
||||
source line count data
|
||||
.IP em_flow
|
||||
source line flow data
|
||||
.IP em_last
|
||||
last lines executed
|
||||
.PD
|
||||
.SH "SEE ALSO"
|
||||
eminform(1), ack(1),
|
||||
.SH BUGS
|
||||
Most error messages are self explanatory.
|
||||
The interpreter stops in case of lack of space with an error
|
||||
message SEGVIO stack overflow.
|
||||
If runtime flags are turned on it is advisable to try again
|
||||
with the default options.
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <em_path.h>
|
||||
#include <local.h>
|
||||
|
||||
char rcs_id[] = "$Id$" ;
|
||||
|
||||
#define MAGIC 07255
|
||||
|
||||
struct header {
|
||||
short h_magic; /* Magic number */
|
||||
short h_flags; /* See below for defines */
|
||||
short h_unresolved; /* Cannot run if nonzero */
|
||||
short h_version; /* Check for VERSION */
|
||||
short h_wsize;
|
||||
short h_psize;
|
||||
short h_unused[2]; /* left over */
|
||||
} header;
|
||||
|
||||
#define TEST 001
|
||||
#define PROFILE 002
|
||||
#define FLOW 004
|
||||
#define COUNT 010
|
||||
char em_dir[64] = EM_DIR; /* easier to patch */
|
||||
char *defargv[] = {
|
||||
"em",
|
||||
"e.out",
|
||||
0
|
||||
};
|
||||
|
||||
char interpret[BUFSIZ];
|
||||
char flags[5];
|
||||
char tflg,fflg,cflg,pflg;
|
||||
|
||||
main(argc,argv) char **argv; {
|
||||
char *file;
|
||||
int fildes;
|
||||
|
||||
while (argc>1 && (argv[1][0]=='-' || argv[1][0]=='+')) {
|
||||
switch(argv[1][1]) {
|
||||
case 't': tflg=argv[1][0]; break;
|
||||
case 'c': cflg=argv[1][0]; break;
|
||||
case 'f': fflg=argv[1][0]; break;
|
||||
case 'p': pflg=argv[1][0]; break;
|
||||
default:
|
||||
fprintf(stderr,"Bad flag %c\n",argv[1][1]);
|
||||
exit(-1);
|
||||
}
|
||||
argv[1] = argv[0];
|
||||
argc--;argv++;
|
||||
}
|
||||
if (argc==1)
|
||||
argv= defargv;
|
||||
file=argv[1];
|
||||
if ((fildes=open(file,0))<0) {
|
||||
perror(file);
|
||||
exit(8) ;
|
||||
}
|
||||
header.h_magic= r2b(fildes,file) ;
|
||||
header.h_flags= r2b(fildes,file) ;
|
||||
header.h_unresolved= r2b(fildes,file) ;
|
||||
header.h_version= r2b(fildes,file) ;
|
||||
header.h_wsize= r2b(fildes,file) ;
|
||||
header.h_psize= r2b(fildes,file) ;
|
||||
header.h_unused[0]= r2b(fildes,file) ;
|
||||
header.h_unused[1]= r2b(fildes,file) ;
|
||||
if (header.h_magic != MAGIC) {
|
||||
fprintf(stderr,"%s not in correct format\n",file);
|
||||
exit(-1);
|
||||
}
|
||||
if (header.h_version != VERSION) {
|
||||
fprintf(stderr,"%s obsolete, recompile\n",file);
|
||||
exit(-1);
|
||||
}
|
||||
if (header.h_unresolved != 0) {
|
||||
fprintf(stderr,
|
||||
"%s has unresolved references, cannot run it\n",file);
|
||||
exit(-1);
|
||||
}
|
||||
if (tflg)
|
||||
flags[0] = tflg=='+' ? 't' : '-';
|
||||
else
|
||||
flags[0]= header.h_flags&TEST ? 't' : '-';
|
||||
if (fflg)
|
||||
flags[1] = fflg=='+' ? 'f' : '-';
|
||||
else
|
||||
flags[1]= header.h_flags&FLOW ? 'f' : '-';
|
||||
if (cflg)
|
||||
flags[2] = cflg=='+' ? 'c' : '-';
|
||||
else
|
||||
flags[2]= header.h_flags&COUNT ? 'c' : '-';
|
||||
if (pflg)
|
||||
flags[3] = pflg=='+' ? 'p' : '-';
|
||||
else
|
||||
flags[3]= header.h_flags&PROFILE ? 'p' : '-';
|
||||
sprintf(interpret,"%s/lib.bin/em%d%d/em_%s",
|
||||
em_dir,header.h_wsize,header.h_psize,flags);
|
||||
execv(interpret,argv);
|
||||
fprintf(stderr,"Interpreter %s not available\n",interpret);
|
||||
}
|
||||
|
||||
r2b(fildes,file) char *file ; {
|
||||
char rd2[2] ;
|
||||
if ( read(fildes,rd2,sizeof rd2)!=sizeof rd2) {
|
||||
fprintf(stderr,"%s too short\n",file);
|
||||
exit(-1);
|
||||
}
|
||||
return (rd2[0]&0xFF) | ( (rd2[1]&0xFF)<<8 ) ;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
.\" $Id$
|
||||
.tr ~
|
||||
.TH EMINFORM 1 "$Revision$"
|
||||
.ad
|
||||
.SH NAME
|
||||
eminform \- converts runtime information of interpreted em to
|
||||
human readable form.
|
||||
.SH SYNOPSIS
|
||||
\fBeminform\fP
|
||||
.SH DESCRIPTION
|
||||
The EM interpreter, em(1), has several debugging features built in.
|
||||
They can be activated by flag options to em(1).
|
||||
The EM interpreter collects the information while it runs the program.
|
||||
When the program is terminated, the interpreter dumps this information onto
|
||||
a file called em_runinf.
|
||||
Eminform converts this information in human readable form onto
|
||||
a set of files with fixed names, the file em_runinf itself is unlinked.
|
||||
.PP
|
||||
.in +15
|
||||
.ti -13
|
||||
~~em_last~~~~A circular buffer is used to keep track of
|
||||
the last collection of executed source lines.
|
||||
.ti -13
|
||||
~~em_flow~~~~A bit map for all source lines tells which lines
|
||||
are executed.
|
||||
.ti -13
|
||||
~~em_count~~~Count the number of times each source line was entered.
|
||||
.ti -13
|
||||
~~em_profile~Estimate the number of memory cycles
|
||||
spent on each source line.
|
||||
.in -15
|
||||
.LP
|
||||
The most common use of eminform is to print the numbers of the last executed
|
||||
source lines if an execution error occurred.
|
||||
No arguments are needed in this case.
|
||||
.LP
|
||||
Eminform will create only those files for which there were
|
||||
interpreter flags turned on. If no runtime error occurred and
|
||||
no flag was turned on the file em_runinf is not created. In
|
||||
this case eminform will give the error message "read header
|
||||
failed".
|
||||
.SH FILES
|
||||
em_runinf, em_last, em_flow, em_count, em_profile
|
||||
.SH "SEE ALSO"
|
||||
ack(1), em(1).
|
||||
.SH BUGS
|
||||
If an entire procedure is not touched, the the file name in
|
||||
which this procedure occured is unknown.
|
||||
If no em_runinf is available the error message is "read header
|
||||
failed" and a core dump is created.
|
||||
Bugs should be reported to Evert Wattel
|
||||
@@ -1,634 +0,0 @@
|
||||
/
|
||||
/ (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
/
|
||||
/ This product is part of the Amsterdam Compiler Kit.
|
||||
/
|
||||
/ Permission to use, sell, duplicate or disclose this software must be
|
||||
/ obtained in writing. Requests for such permissions may be sent to
|
||||
/
|
||||
/ Dr. Andrew S. Tanenbaum
|
||||
/ Wiskundig Seminarium
|
||||
/ Vrije Universiteit
|
||||
/ Postbox 7161
|
||||
/ 1007 MC Amsterdam
|
||||
/ The Netherlands
|
||||
/
|
||||
/
|
||||
/------------------------------------------------------------------------------
|
||||
/
|
||||
indir = 0
|
||||
exit = 1
|
||||
fork = 2
|
||||
read = 3
|
||||
write = 4
|
||||
open = 5
|
||||
close = 6
|
||||
creat = 8.
|
||||
unlink = 10.
|
||||
break = 17.
|
||||
alarm = 27.
|
||||
pause = 29.
|
||||
sleep = 35.
|
||||
signal = 48.
|
||||
|
||||
iot = 4
|
||||
/------------------------------------------------------------------------------
|
||||
/ External references
|
||||
/------------------------------------------------------------------------------
|
||||
|
||||
.globl _end
|
||||
|
||||
/
|
||||
/------------------------------------------------------------------------------
|
||||
/ Now the real program starts
|
||||
/------------------------------------------------------------------------------
|
||||
|
||||
startoff:
|
||||
mov sp,memlim
|
||||
mov $ldfail,r5
|
||||
mov $emfile,forward+2
|
||||
sys indir;forward
|
||||
jes badruninf;
|
||||
mov r0,saver0;
|
||||
mov $rhfail,r5;
|
||||
sys read;header;34.
|
||||
jes badruninf;
|
||||
cmp $34.,r0
|
||||
jne badruninf
|
||||
mov $rtfail,r5
|
||||
mov $_end,loadstart
|
||||
mov option,r1
|
||||
bit $17774,r1
|
||||
bne 1f
|
||||
mov tblmax,globmax
|
||||
1:
|
||||
bit $1,r1
|
||||
beq 1f
|
||||
mov saver0,r0
|
||||
sys read;lasttab;98.
|
||||
jes badruninf;
|
||||
|
||||
1: bit $2,r1
|
||||
beq 1f
|
||||
mov saver0,r0
|
||||
sys read;opfrb;512.
|
||||
jes badruninf
|
||||
mov saver0,r0
|
||||
sys read;opfra;512.
|
||||
jes badruninf
|
||||
mov saver0,r0
|
||||
sys read;opfrc;640.
|
||||
jes badruninf
|
||||
1: bit $4,r1
|
||||
beq 1f
|
||||
mov saver0,r0
|
||||
sys read;lcount;4
|
||||
jes badruninf
|
||||
1: bit $8.,r1
|
||||
beq 1f
|
||||
mov saver0,r0
|
||||
sys read;lflow;4
|
||||
jes badruninf
|
||||
1: bit $16.,r1
|
||||
beq 1f
|
||||
mov saver0,r0
|
||||
sys read;ltime;4
|
||||
jes badruninf
|
||||
1:
|
||||
mov tblmax,r3
|
||||
sub pd,r3
|
||||
sub ml,r3
|
||||
mov $_end,sybreak+2
|
||||
add r3,sybreak+2;
|
||||
sys indir;sybreak
|
||||
mov r3,lblread+4
|
||||
mov $_end,lblread+2;
|
||||
mov saver0,r0
|
||||
sys indir;lblread;
|
||||
jes badruninf
|
||||
mov saver0,r0
|
||||
sys close
|
||||
sys unlink;emfile
|
||||
lbladj:
|
||||
add $header,linused
|
||||
sub header,linused
|
||||
|
||||
mov pd,filext
|
||||
sub loadstart,filext
|
||||
mov filext,filarg
|
||||
add ml,filarg
|
||||
sub tblmax,filarg
|
||||
lbllast:
|
||||
bit $1,option /test for last
|
||||
beq 2f / no last table jump
|
||||
sys creat;emlast;666
|
||||
bcs 2f
|
||||
cmp linused,$lasttab
|
||||
bhis 3f
|
||||
mov $yetmsg,lblwri+2
|
||||
mov $40.,lblwri+4
|
||||
sys indir;lblwri
|
||||
br 2f
|
||||
3: mov r0,saver0
|
||||
cmp linused-2,$-1
|
||||
bne 6f
|
||||
mov $linused-2,linused
|
||||
clr linused-2
|
||||
6: jsr pc,slilast
|
||||
inc r2
|
||||
jsr pc,nexttab
|
||||
tst (r5)
|
||||
beq 3f
|
||||
sub $2,linused
|
||||
cmp eb,(r5)
|
||||
blo 3f
|
||||
7: cmp r2,$lnend
|
||||
blt 1f
|
||||
jsr pc,slnlast
|
||||
1: jsr pc,lnrnxt
|
||||
bne 7b
|
||||
3: jsr pc,sfllast
|
||||
bne 6b
|
||||
mov saver0,r0
|
||||
sys close
|
||||
2:
|
||||
|
||||
lblopfreq:
|
||||
bit $2,option
|
||||
beq 9f
|
||||
sys creat;emopf;666
|
||||
bcs 9f
|
||||
mov r0,saver0
|
||||
mov $opcode,r3
|
||||
mov $104.,r4
|
||||
mov $counttab,r5
|
||||
0: mov $lnlast,r2
|
||||
mov $8.,r0
|
||||
2: movb (r3)+,(r2)+
|
||||
sob r0,2b
|
||||
add $8,r2
|
||||
mov r2,-(sp)
|
||||
jsr pc,ltoa
|
||||
mov (sp)+,r2
|
||||
add $5,r2
|
||||
mov $8.,r0
|
||||
2: movb (r3)+,(r2)+
|
||||
sob r0,2b
|
||||
add $8,r2
|
||||
mov r2,-(sp)
|
||||
jsr pc,ltoa
|
||||
mov (sp)+,r2
|
||||
add $5,r2
|
||||
mov $8.,r0
|
||||
2: movb (r3)+,(r2)+
|
||||
sob r0,2b
|
||||
add $8,r2
|
||||
mov r2,-(sp)
|
||||
jsr pc,ltoa
|
||||
mov (sp)+,r2
|
||||
add $5,r2
|
||||
mov $8.,r0
|
||||
2: movb (r3)+,(r2)+
|
||||
sob r0,2b
|
||||
add $8,r2
|
||||
mov r2,-(sp)
|
||||
jsr pc,ltoa
|
||||
mov (sp)+,r2
|
||||
mov r3,-(sp)
|
||||
jsr pc,slnlast
|
||||
mov (sp)+,r3
|
||||
sob r4,0b
|
||||
mov saver0,r0
|
||||
sys close
|
||||
9:
|
||||
lblcount:
|
||||
clr filb
|
||||
bit $4,option
|
||||
beq 9f
|
||||
sys creat;emcount;666
|
||||
bcs 9f
|
||||
mov r0,saver0
|
||||
mov lcount,r5
|
||||
add $4,r5
|
||||
sub filext,r5
|
||||
jsr pc,procrun
|
||||
mov saver0,r0
|
||||
sys close
|
||||
9:
|
||||
lblprof:
|
||||
bit $16.,option
|
||||
beq 9f
|
||||
sys creat;emprof;666
|
||||
bcs 9f
|
||||
mov r0,saver0
|
||||
mov ltime,r5
|
||||
sub filext,r5
|
||||
mov $profmsg,lblwri+2
|
||||
mov $29,lblwri+4
|
||||
mov $profmsg+27,r2
|
||||
jsr pc,ltoa
|
||||
mov saver0,r0
|
||||
sys indir;lblwri
|
||||
jsr pc,procrun
|
||||
mov saver0,r0
|
||||
sys close
|
||||
9:
|
||||
lblflow:
|
||||
mov $1,filb
|
||||
bit $8.,option
|
||||
beq 9f
|
||||
sys creat;emflow;666
|
||||
bcs 9f
|
||||
mov lflow,r5
|
||||
mov $-1,flowsiz
|
||||
sub filext,r5
|
||||
jsr pc,procrun
|
||||
mov saver0,r0
|
||||
sys close
|
||||
9:
|
||||
clr r0
|
||||
sys exit
|
||||
|
||||
badruninf:
|
||||
mov $0f,lblwri+2
|
||||
mov $21.,lblwri+4
|
||||
mov $2,r0
|
||||
sys indir;lblwri
|
||||
mov r5,lblwri+2
|
||||
mov $23.,lblwri+4
|
||||
mov $2,r0
|
||||
sys indir;lblwri
|
||||
iot /force core dump
|
||||
.data
|
||||
lblwri:
|
||||
sys write;0;0
|
||||
forward:
|
||||
sys open;0;0
|
||||
sybreak:
|
||||
sys break;0;
|
||||
lblread:
|
||||
sys read;0;0
|
||||
0: <em_runinf load error,\0>
|
||||
ldfail: < open runinf failed \n\0>
|
||||
rhfail: < read header failed \n\0>
|
||||
rtfail: < read tables failed \n\0>
|
||||
msgto: <to>
|
||||
emlast: <em_last\0>
|
||||
emcount:<em_count\0>
|
||||
emfile: <em_runinf\0>
|
||||
emopf: <em_opfreq\0>
|
||||
emprof: <em_profile\0>
|
||||
emflow: <em_flow\0>
|
||||
yetmsg: <no line or file message processed yet \n\n\0>
|
||||
unknown:<with unknown filename\0>
|
||||
lilast: <\nlines \0>
|
||||
lnlast: < >
|
||||
< >
|
||||
lnend: < \0>
|
||||
fllast: < of file >
|
||||
< \0>
|
||||
profmsg:<\ninitialization \n\0>
|
||||
sep: <\n\0>
|
||||
/----------------------------------------------------------------------------
|
||||
opcode:
|
||||
<loc.0 loc.1 loc.2 loc.3 loc.4 loc.5 loc.6 loc.7 >
|
||||
<loc.8 loc.9 loc.10 loc.11 loc.12 loc.13 loc.14 loc.15 >
|
||||
<loc.16 loc.17 loc.18 loc.19 loc.20 loc.21 loc.22 loc.23 >
|
||||
<loc.24 loc.25 loc.26 loc.27 loc.28 loc.29 loc.30 loc.31 >
|
||||
<loc.32 loc.33 aar.1W adf.s0 adi.1W adi.2W adp.l adp.1 >
|
||||
<adp.2 adp.s0 adp.s_1 ads.1W and.1W asp.1W asp.2W asp.3W >
|
||||
<asp.4W asp.5W asp.w0 beq.l beq.s0 bge.s0 bgt.s0 ble.s0 >
|
||||
<blm.s0 blt.s0 bne.s0 bra.l bra.s_1 bra.s_2 bra.s0 bra.s1 >
|
||||
<cal.1 cal.2 cal.3 cal.4 cal.5 cal.6 cal.7 cal.8 >
|
||||
<cal.9 cal.10 cal.11 cal.12 cal.13 cal.14 cal.15 cal.16 >
|
||||
<cal.17 cal.18 cal.19 cal.20 cal.21 cal.22 cal.23 cal.24 >
|
||||
<cal.25 cal.26 cal.27 cal.28 cal.s0 cff.z cif.z cii.z >
|
||||
<cmf.s0 cmi.1W cmi.2W cmp.z cms.s0 csa.1W csb.1W dec.z >
|
||||
<dee.w0 del.w_1 dup.1W dvf.s0 dvi.1W fil.l inc.z ine.lw >
|
||||
<ine.w0 inl._1W inl._2W inl._3W inl.w_1 inn.s0 ior.1W ior.s0 >
|
||||
<lae.l lae.w0 lae.w1 lae.w2 lae.w3 lae.w4 lae.w5 lae.w6 >
|
||||
|
||||
<lal.p lal.n lal.0 lal._1 lal.w0 lal.w_1 lal.w_2 lar.1W >
|
||||
<ldc.0 lde.lw lde.w0 ldl.0 ldl.w_1 lfr.1W lfr.2W lfr.s0 >
|
||||
<lil.w_1 lil.w0 lil.0 lil.1W lin.l lin.s0 lni.z loc.l >
|
||||
<loc._1 loc.s0 loc.s_1 loe.lw loe.w0 loe.w1 loe.w2 loe.w3 >
|
||||
<loe.w4 lof.l lof.1W lof.2W lof.3W lof.4W lof.s0 loi.l >
|
||||
<loi.1 loi.1W loi.2W loi.3W loi.4W loi.s0 lol.pw lol.nw >
|
||||
<lol.0 lol.1W lol.2W lol.3W lol._1W lol._2W lol._3W lol._4W >
|
||||
<lol._5W lol._6W lol._7W lol._8W lol.w0 lol.w_1 lxa.1 lxl.1 >
|
||||
<lxl.2 mlf.s0 mli.1W mli.2W rck.1W ret.0 ret.1W ret.s0 >
|
||||
<rmi.1W sar.1W sbf.s0 sbi.1W sbi.2W sdl.w_1 set.s0 sil.w_1 >
|
||||
<sil.w0 sli.1W ste.lw ste.w0 ste.w1 ste.w2 stf.l stf.1W >
|
||||
<stf.2W stf.s0 sti.1 sti.1W sti.2W sti.3W sti.4W sti.s0 >
|
||||
<stl.pw stl.nw stl.0 stl.1W stl._1W stl._2W stl._3W stl._4W >
|
||||
<stl._5W stl.w_1 teq.z tgt.z tlt.z tne.z zeq.l zeq.s0 >
|
||||
<zeq.s1 zer.s0 zge.s0 zgt.s0 zle.s0 zlt.s0 zne.s0 zne.s_1 >
|
||||
<zre.lw zre.w0 zrl._1W zrl._2W zrl.w_1 zrl.nw escape1 escape2 >
|
||||
|
||||
<aar.l aar.z adf.l adf.z adi.l adi.z ads.l ads.z >
|
||||
<adu.l adu.z and.l and.z asp.lw ass.l ass.z bge.l >
|
||||
<bgt.l ble.l blm.l bls.l bls.z blt.l bne.l cai.z >
|
||||
<cal.l cfi.z cfu.z ciu.z cmf.l cmf.z cmi.l cmi.z >
|
||||
<cms.l cms.z cmu.l cmu.z com.l com.z csa.l csa.z >
|
||||
<csb.l csb.z cuf.z cui.z cuu.z dee.lw del.pw del.nw >
|
||||
<dup.l dus.l dus.z dvf.l dvf.z dvi.l dvi.z dvu.l >
|
||||
<dvu.z fef.l fef.z fif.l fif.z inl.pw inl.nw inn.l >
|
||||
<inn.z ior.l ior.z lar.l lar.z ldc.l ldf.l ldl.pw >
|
||||
<ldl.nw lfr.l lil.pw lil.nw lim.z los.l los.z lor.s0 >
|
||||
<lpi.l lxa.l lxl.l mlf.l mlf.z mli.l mli.z mlu.l >
|
||||
<mlu.z mon.z ngf.l ngf.z ngi.l ngi.z nop.z rck.l >
|
||||
<rck.z ret.l rmi.l rmi.z rmu.l rmu.z rol.l rol.z >
|
||||
<ror.l ror.z rtt.z sar.l sar.z sbf.l sbf.z sbi.l >
|
||||
<sbi.z sbs.l sbs.z sbu.l sbu.z sde.l sdf.l sdl.pw >
|
||||
<sdl.nw set.l set.z sig.z sil.pw sil.nw sim.z sli.l >
|
||||
|
||||
<sli.z slu.l slu.z sri.l sri.z sru.l sru.z sti.l >
|
||||
<sts.l sts.z str.s0 tge.z tle.z trp.z xor.l xor.z >
|
||||
<zer.l zer.z zge.l zgt.l zle.l zlt.l zne.l zrf.l >
|
||||
<zrf.z zrl.pw dch.z exg.s0 exg.l exg.z lpb.z gto.l \0\0>
|
||||
.even
|
||||
.text
|
||||
/------------------------------------------------------------------------------
|
||||
/ General subroutines
|
||||
/------------------------------------------------------------------------------
|
||||
|
||||
wrdoff: movb (r3)+,r0 /get first byte
|
||||
swab r0 /put it in high byte
|
||||
clrb r0 /clear low byte of r0
|
||||
bisb (r3)+,r0 /"or" second byte in
|
||||
rts pc /done
|
||||
|
||||
/------------------------------------------------------------------------------
|
||||
|
||||
|
||||
nexttab: mov linused,r5;
|
||||
add $2,r5 / increment lasttab
|
||||
cmp r5,$linused / top of table reached?
|
||||
blo 1f
|
||||
sub $96.,r5
|
||||
1: mov r5,linused
|
||||
rts pc
|
||||
|
||||
slilast: mov $lnlast,r2
|
||||
mov $6,r0
|
||||
mov $lilast,r3
|
||||
2: movb (r3)+,(r2)+
|
||||
sob r0,2b
|
||||
rts pc
|
||||
|
||||
slnlast: mov $lnlast,lblwri+2
|
||||
mov r2,r3
|
||||
sub $lnlast,r3
|
||||
beq 3f
|
||||
inc r3
|
||||
movb sep,(r2)
|
||||
1: mov r3,lblwri+4
|
||||
mov saver0,r0
|
||||
sys indir; lblwri
|
||||
mov $lnlast,r2
|
||||
2: movb $' ,(r2)+
|
||||
sob r3,2b
|
||||
3: mov $lnlast,r2
|
||||
rts pc
|
||||
|
||||
lnrnxt: jsr pc,nexttab
|
||||
tst (r5)
|
||||
ble 0f
|
||||
mov (r5),r1
|
||||
clr (r5)
|
||||
add $6,r2
|
||||
mov r2,r0
|
||||
jsr pc,itoa
|
||||
0: rts pc
|
||||
|
||||
sfllast:jsr pc,nexttab
|
||||
tst (r5)
|
||||
bne 0f
|
||||
clr linused
|
||||
mov eb,-(sp)
|
||||
sub filext,(sp)
|
||||
add $4,(sp)
|
||||
mov *(sp),(sp)
|
||||
mov (sp)+,(r5)
|
||||
0: jsr pc,slnlast
|
||||
jsr pc,filadj
|
||||
mov $14.,r3
|
||||
mov $fllast+14.,r2
|
||||
mov (r5),r0
|
||||
3: inc r3
|
||||
movb (r0)+,(r2)+
|
||||
bne 3b
|
||||
movb sep,-(r2)
|
||||
mov $fllast,lblwri+2
|
||||
mov r3,lblwri+4
|
||||
mov saver0,r0
|
||||
sys indir;lblwri
|
||||
mov $fllast+14.,r2
|
||||
sub $10.,r3
|
||||
2: movb $' ,(r2)+
|
||||
sob r3,2b
|
||||
clr (r5)
|
||||
tst linused
|
||||
beq 2f
|
||||
jsr pc,slilast
|
||||
2: rts pc
|
||||
|
||||
filadj:
|
||||
cmp ml,(r5)
|
||||
bhi 8f
|
||||
sub filarg,(r5)
|
||||
br 7f
|
||||
8: cmp eb,(r5)
|
||||
bhi 7f
|
||||
sub filext,(r5)
|
||||
7: rts pc
|
||||
|
||||
procrun:
|
||||
mov firstp,r4
|
||||
sub filext,r4
|
||||
0:
|
||||
tst 4(r4)
|
||||
beq 8f
|
||||
jsr pc,msgfile
|
||||
mov r4,-(sp)
|
||||
mov countsiz,r4
|
||||
7: cmp r2,$lnend+10
|
||||
blo 6f
|
||||
jsr pc,slnlast
|
||||
mov $lnlast,r2
|
||||
6: tst filb
|
||||
bne 3f
|
||||
add $11.,r2
|
||||
mov r2,-(sp)
|
||||
jsr pc,ltoa
|
||||
mov (sp)+,r2
|
||||
br 4f
|
||||
3:
|
||||
jsr pc,bittoa
|
||||
add $4,r2
|
||||
4: sob r4,7b
|
||||
jsr pc,slnlast
|
||||
mov (sp)+,r4
|
||||
8: mov 8.(r4),r4
|
||||
beq 8f
|
||||
sub filext,r4
|
||||
br 0b
|
||||
mov r0,saver0
|
||||
sys write;sep;1
|
||||
8: rts pc
|
||||
|
||||
|
||||
msgfile:
|
||||
jsr pc,slilast
|
||||
add $6,r2
|
||||
mov 6(r4),r1
|
||||
mov r2,r0
|
||||
jsr pc,itoa
|
||||
add $4,r2
|
||||
movb msgto,(r2)+
|
||||
movb msgto+1,(r2)+
|
||||
add $6,r2
|
||||
mov 8.(r4),r1
|
||||
3: bne 1f
|
||||
mov maxcount,r1
|
||||
br 2f
|
||||
1: sub filext,r1
|
||||
tst 4(r1)
|
||||
beq 1f
|
||||
mov 4(r1),r1
|
||||
br 2f
|
||||
1: mov 8.(r1),r1
|
||||
br 3b
|
||||
2: sub 4(r4),r1
|
||||
mov r1,countsiz
|
||||
dec r1 / is this a bug?
|
||||
add 6(r4),r1
|
||||
mov r2,r0
|
||||
jsr pc,itoa
|
||||
mov $fllast,r3
|
||||
mov $14,r1
|
||||
2: movb (r3)+,(r2)+
|
||||
sob r1,2b
|
||||
mov 10.(r4),r3
|
||||
bne 6f
|
||||
mov $unknown,r3
|
||||
br 5f
|
||||
6: cmp ml,r3
|
||||
bhi 4f
|
||||
sub filarg,r3
|
||||
br 5f
|
||||
4: cmp eb,r3
|
||||
bhi 5f
|
||||
sub filext,r3
|
||||
5:
|
||||
lblmsgf:
|
||||
2: movb (r3)+,(r2)+
|
||||
bne 2b
|
||||
jsr pc,slnlast
|
||||
rts pc
|
||||
|
||||
itoa:
|
||||
|
||||
mov r5,-(sp)
|
||||
mov r0,r5
|
||||
1: clr r0
|
||||
div $10.,r0
|
||||
add $'0,r1
|
||||
movb r1,-(r5)
|
||||
mov r0,r1
|
||||
bne 1b
|
||||
mov r5,r0
|
||||
mov (sp)+,r5
|
||||
rts pc
|
||||
|
||||
rts pc
|
||||
ltoa:
|
||||
0: mov (r5),r1
|
||||
clr r0
|
||||
div $10.,r0
|
||||
mov r0,(r5)
|
||||
swab r1
|
||||
clr r0
|
||||
bisb 3(r5),r1
|
||||
div $10.,r0
|
||||
movb r0,3(r5)
|
||||
clr r0
|
||||
swab r1
|
||||
bisb 2(r5),r1
|
||||
div $10.,r0
|
||||
add $'0,r1
|
||||
movb r1,-(r2)
|
||||
movb r0,2(r5)
|
||||
bne 0b
|
||||
tst (r5)
|
||||
bne 0b
|
||||
add $4,r5
|
||||
rts pc
|
||||
|
||||
bittoa:
|
||||
mov (r5),r1
|
||||
mov flowsiz,r0
|
||||
ash r0,r1
|
||||
bit $1,r1
|
||||
beq 0f
|
||||
movb $'1,(r2)
|
||||
br 1f
|
||||
0: movb $'0,(r2)
|
||||
1: dec r0
|
||||
cmp $-16.,r0
|
||||
beq 2f
|
||||
mov r0,flowsiz
|
||||
br 3f
|
||||
2: clr flowsiz
|
||||
add $2,r5
|
||||
3: rts pc
|
||||
|
||||
/------------------------------------------------------------------------------
|
||||
/ Leftover data
|
||||
/------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
.bss
|
||||
filb: .=.+2
|
||||
loadstart: .=.+2
|
||||
saver0: .=.+2
|
||||
filarg: .=.+2
|
||||
filext: .=.+2
|
||||
memlim: .=.+2
|
||||
header:
|
||||
bstrt: txtsiz: .=.+2
|
||||
bend: ndatad: .=.+2
|
||||
nprocs: .=.+2
|
||||
option: entry.: .=.+2
|
||||
nlines: .=.+2
|
||||
szdata: .=.+2
|
||||
firstp: .=.+2
|
||||
maxcount: .=.+2
|
||||
argc: .=.+2
|
||||
argv: .=.+2
|
||||
environ:
|
||||
.=.+2
|
||||
pb: .=.+2
|
||||
pd: .=.+2
|
||||
eb: .=.+2
|
||||
globmax: .=.+2
|
||||
tblmax: .=.+2
|
||||
ml: .=.+2
|
||||
lasttab:.=.+96. / 16 descriptors of integers + index at the end
|
||||
linused:.=.+2
|
||||
|
||||
counttab:
|
||||
opfra: .=.+512.
|
||||
opfrb: .=.+512.
|
||||
opfrc: .=.+640.
|
||||
|
||||
lcount: .=.+2
|
||||
countsiz:.=.+2
|
||||
|
||||
lflow: .=.+2
|
||||
flowsiz:.=.+2
|
||||
|
||||
ltime: .=.+2
|
||||
profsiz:.=.+2
|
||||
@@ -1 +0,0 @@
|
||||
.flow = 1
|
||||
@@ -1 +0,0 @@
|
||||
.flow = 0
|
||||
@@ -1 +0,0 @@
|
||||
.prof = 1
|
||||
@@ -1 +0,0 @@
|
||||
.prof = 0
|
||||
@@ -1,64 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
#PARAMS do not remove this line!
|
||||
|
||||
INTS=em_t--- em_---- em_tf-- em_t-c- em_t--p
|
||||
|
||||
SRC_DIR = $(SRC_HOME)/mach/pdp/int
|
||||
CFLAGS = $(COPTIONS) -I$(TARGET_HOME)/h -I$(TARGET_HOME)/config
|
||||
LDFLAGS = $(LDOPTIONS)
|
||||
|
||||
b=$(TARGET_HOME)/lib.bin/em22
|
||||
|
||||
all: $(INTS) eminform em
|
||||
|
||||
em: em.o
|
||||
$(CC) $(LDFLAGS) -o em em.c
|
||||
|
||||
em.o: $(SRC_DIR)/em.c
|
||||
$(CC) $(CFLAGS) -c $(SRC_DIR)/em.c
|
||||
|
||||
eminform: $(SRC_DIR)/eminform.s
|
||||
as $(SRC_DIR)/eminform.s;ld -i -o eminform a.out -lc
|
||||
|
||||
em_t---: $(SRC_DIR)/t+ $(SRC_DIR)/f- $(SRC_DIR)/c- $(SRC_DIR)/p- $(SRC_DIR)/em_int.s
|
||||
as $(SRC_DIR)/t+ $(SRC_DIR)/f- $(SRC_DIR)/c- $(SRC_DIR)/p- $(SRC_DIR)/em_int.s;ld -i -o em_t--- a.out -lc
|
||||
|
||||
em_----: $(SRC_DIR)/t- $(SRC_DIR)/f- $(SRC_DIR)/c- $(SRC_DIR)/p- $(SRC_DIR)/em_int.s
|
||||
as $(SRC_DIR)/t- $(SRC_DIR)/f- $(SRC_DIR)/c- $(SRC_DIR)/p- $(SRC_DIR)/em_int.s;ld -i -o em_---- a.out -lc
|
||||
|
||||
em_tf--: $(SRC_DIR)/t+ $(SRC_DIR)/f+ $(SRC_DIR)/c- $(SRC_DIR)/p- $(SRC_DIR)/em_int.s
|
||||
as $(SRC_DIR)/t+ $(SRC_DIR)/f+ $(SRC_DIR)/c- $(SRC_DIR)/p- $(SRC_DIR)/em_int.s;ld -i -o em_tf-- a.out -lc
|
||||
|
||||
em_t-c-: $(SRC_DIR)/t+ $(SRC_DIR)/f- $(SRC_DIR)/c+ $(SRC_DIR)/p- $(SRC_DIR)/em_int.s
|
||||
as $(SRC_DIR)/t+ $(SRC_DIR)/f- $(SRC_DIR)/c+ $(SRC_DIR)/p- $(SRC_DIR)/em_int.s;ld -i -o em_t-c- a.out -lc
|
||||
|
||||
em_t--p: $(SRC_DIR)/t+ $(SRC_DIR)/f- $(SRC_DIR)/c- $(SRC_DIR)/p+ $(SRC_DIR)/em_int.s
|
||||
as $(SRC_DIR)/t+ $(SRC_DIR)/f- $(SRC_DIR)/c- $(SRC_DIR)/p+ $(SRC_DIR)/em_int.s;ld -i -o em_t--p a.out -lc
|
||||
|
||||
install: all
|
||||
-mkdir $b
|
||||
cp em_???? $b
|
||||
cp em eminform $(TARGET_HOME)/bin
|
||||
if [ $(DO_MACHINE_INDEP) = y ] ; \
|
||||
then mk_manpage $(SRC_DIR)/em.1 $(TARGET_HOME) ; \
|
||||
mk_manpage $(SRC_DIR)/eminform.1 $(TARGET_HOME) ; \
|
||||
fi
|
||||
|
||||
cmp: all
|
||||
-cmp em_t--- $b/em_t---
|
||||
-cmp em_---- $b/em_----
|
||||
-cmp em_tf-- $b/em_tf--
|
||||
-cmp em_t-c- $b/em_t-c-
|
||||
-cmp em_t--p $b/em_t--p
|
||||
-cmp em $(TARGET_HOME)/bin/em
|
||||
-cmp eminform $(TARGET_HOME)/bin/eminform
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.old a.out em eminform $(INTS)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
pr:
|
||||
@pr $(SRC_DIR)/em.c $(SRC_DIR)/em_int.s $(SRC_DIR)/eminform.s
|
||||
@@ -1 +0,0 @@
|
||||
.test = 1
|
||||
@@ -1 +0,0 @@
|
||||
.test = 0
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
compmodule
|
||||
@@ -1,21 +0,0 @@
|
||||
SUF=o
|
||||
MAKEFILE=../../proto/libg/Makefile
|
||||
MACHDEF="MACH=pdp" "SUF=$(SUF)" "ASAR=aal"
|
||||
BCDEF="PREF=bc" "SUB=" "SRC=lang/basic/lib"
|
||||
|
||||
install:
|
||||
make -f $(MAKEFILE) $(BCDEF) $(MACHDEF) tailcp
|
||||
|
||||
cmp:
|
||||
make -f $(MAKEFILE) $(BCDEF) $(MACHDEF) tail
|
||||
-../../compare head_bc
|
||||
-../../compare tail_bc
|
||||
|
||||
clean:
|
||||
-rm -f *.old *.[ce$(SUF)] tail* head*
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
pr:
|
||||
@pr Makefile
|
||||
@@ -1,4 +0,0 @@
|
||||
if ${MACH?} -I../../../h ${MACHFL?} $1 1>&2
|
||||
then echo `basename $1 $2`.o
|
||||
else exit 1
|
||||
fi
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
compmodule
|
||||
@@ -1,50 +0,0 @@
|
||||
SUF=o
|
||||
MAKEFILE=../../proto/libg/Makefile
|
||||
MACHDEF="MACH=pdp" "SUF=$(SUF)" "ASAR=aal"
|
||||
STDIO="PREF=cc" "SUB=.1s" "SRC=lang/cem/libcc/stdio"
|
||||
GEN="PREF=cc" "SUB=.2g" "SRC=lang/cem/libcc/gen"
|
||||
MON="PREF=mon" "SRC=lang/cem/libcc/mon"
|
||||
LIBM="PREF=m" "SRC=lang/cem/libcc/math"
|
||||
LIBLN="PREF=ln" "SRC=lang/cem/libcc/libln"
|
||||
|
||||
install: cpstdio cpgen cplibm
|
||||
|
||||
cpstdio:
|
||||
make -f $(MAKEFILE) $(STDIO) $(MACHDEF) tailcp
|
||||
cpgen:
|
||||
make -f $(MAKEFILE) $(GEN) $(MACHDEF) cp
|
||||
cpmon:
|
||||
make -f $(MAKEFILE) $(MON) $(MACHDEF) tailcp
|
||||
cplibm:
|
||||
make -f $(MAKEFILE) $(LIBM) $(MACHDEF) tailcp
|
||||
cplibln:
|
||||
make -f $(MAKEFILE) $(LIBLN) $(MACHDEF) tailcp
|
||||
|
||||
cmp: cmpstdio cmpgen cmplibm
|
||||
|
||||
cmpstdio:
|
||||
make -f $(MAKEFILE) $(STDIO) $(MACHDEF) tail
|
||||
-../../compare tail_cc.1s
|
||||
cmpgen:
|
||||
make -f $(MAKEFILE) $(GEN) $(MACHDEF) head
|
||||
-../../compare head_cc
|
||||
make -f $(MAKEFILE) $(GEN) $(MACHDEF) tail
|
||||
-../../compare tail_cc.2g
|
||||
cmpmon:
|
||||
make -f $(MAKEFILE) $(MON) $(MACHDEF) tail
|
||||
-../../compare tail_mon
|
||||
cmplibm:
|
||||
make -f $(MAKEFILE) $(LIBM) $(MACHDEF) tail
|
||||
-../../compare tail_m
|
||||
cmplibln:
|
||||
make -f $(MAKEFILE) $(LIBLN) $(MACHDEF) tail
|
||||
-../../compare tail_ln
|
||||
|
||||
clean:
|
||||
-rm -f *.old *.[ce$(SUF)] tail* head*
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
pr:
|
||||
@pr Makefile
|
||||
@@ -1,4 +0,0 @@
|
||||
if ${MACH?} -I../../../h ${MACHFL?} $1 1>&2
|
||||
then echo `basename $1 $2`.o
|
||||
else exit 1
|
||||
fi
|
||||
@@ -1,2 +0,0 @@
|
||||
LIST
|
||||
libem_s.a
|
||||
@@ -1,72 +0,0 @@
|
||||
libem_s.a
|
||||
RT.s
|
||||
adf.s
|
||||
adi.s
|
||||
and.s
|
||||
cff.s
|
||||
cfi.s
|
||||
cif.s
|
||||
cii.s
|
||||
ciu.s
|
||||
cmf.s
|
||||
cmi.s
|
||||
cmi4.s
|
||||
cms.s
|
||||
cmu.s
|
||||
cmu4.s
|
||||
csa.s
|
||||
csb.s
|
||||
dup.s
|
||||
dvf.s
|
||||
dvi.s
|
||||
dvi4.s
|
||||
dvu.s
|
||||
dvu2.s
|
||||
dvu4.s
|
||||
eret.s
|
||||
exg.s
|
||||
fef.s
|
||||
fif.s
|
||||
gto.s
|
||||
iaar.s
|
||||
aar.s
|
||||
ilar.s
|
||||
inn.s
|
||||
isar.s
|
||||
lar.s
|
||||
los2.s
|
||||
mlf.s
|
||||
mli.s
|
||||
mli4.s
|
||||
mlu.s
|
||||
mlu4.s
|
||||
mon.s
|
||||
ngf.s
|
||||
ngi.s
|
||||
nop.s
|
||||
prf.s
|
||||
printf.s
|
||||
rck.s
|
||||
ret.s
|
||||
rmi.s
|
||||
rmi4.s
|
||||
rmu.s
|
||||
rmu2.s
|
||||
rmu4.s
|
||||
rol.s
|
||||
ror.s
|
||||
sar.s
|
||||
sbf.s
|
||||
sbi.s
|
||||
set.s
|
||||
setfl.s
|
||||
sim.s
|
||||
sli.s
|
||||
sri.s
|
||||
sru.s
|
||||
sto2.s
|
||||
strhp.s
|
||||
unknown.s
|
||||
trp.s
|
||||
xor.s
|
||||
save.s
|
||||
@@ -1,33 +0,0 @@
|
||||
all: head_em.o libem_o.a end.o
|
||||
|
||||
install: cp
|
||||
|
||||
cp: all
|
||||
../../install head_em.o head_em
|
||||
../../install libem_o.a tail_em
|
||||
../../install end.o end_em
|
||||
|
||||
cmp: all
|
||||
-../../compare head_em.o head_em
|
||||
-../../compare libem_o.a tail_em
|
||||
-../../compare end.o end_em
|
||||
|
||||
|
||||
head_em.o: head_em.s
|
||||
pdp -c head_em.s
|
||||
|
||||
end.o: end.s
|
||||
pdp -c end.s
|
||||
|
||||
libem_o.a: libem_s.a
|
||||
ASAR=aal ; export ASAR ; march . libem_o.a
|
||||
|
||||
clean:
|
||||
rm -f *.o libem_o.a
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
pr:
|
||||
@pr `pwd`/Makefile `pwd`/head_em.s
|
||||
@arch pv libem_s.a | pr -h `pwd`/libem_s.a
|
||||
@@ -1,33 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.define PRr2,PR2r2,PR4r2,PR6r2
|
||||
.define PRr2r4,PR2r2r4,PR4r2r4,PR6r2r4
|
||||
.define RT,RTr2,RTr2r4
|
||||
! $Id$
|
||||
|
||||
PR6r2: mov $6,r0;br PRr2
|
||||
PR4r2: mov $4,r0;br PRr2
|
||||
PR2r2: mov $2,r0
|
||||
PRr2: mov r5,r1
|
||||
mov sp,r5
|
||||
sub r0,sp
|
||||
mov r2,-(sp)
|
||||
mov r1,pc
|
||||
|
||||
PR2r2r4:mov $2,r0;br PRr2r4
|
||||
PR4r2r4:mov $4,r0;br PRr2r4
|
||||
PR6r2r4:mov $6,r0
|
||||
PRr2r4: mov r5,r1
|
||||
mov sp,r5
|
||||
sub r0,sp
|
||||
mov r2,-(sp)
|
||||
mov r4,-(sp)
|
||||
mov r1,pc
|
||||
|
||||
RTr2r4:
|
||||
mov (sp)+,r4
|
||||
RTr2:
|
||||
mov (sp)+,r2
|
||||
RT:
|
||||
mov r5,sp
|
||||
mov (sp)+,r5
|
||||
rts pc
|
||||
@@ -1,13 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define aar~
|
||||
! $Id$
|
||||
|
||||
!r0 : descriptor address
|
||||
!r1 : element number
|
||||
!base address is on stack
|
||||
aar~:
|
||||
sub (r0),r1
|
||||
mul 04(r0),r1
|
||||
add r1,02(sp)
|
||||
rts pc
|
||||
@@ -1,15 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define adf~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
!size in r0
|
||||
adf~:
|
||||
mov (sp)+,r1
|
||||
jsr pc,setfloat~
|
||||
movf (sp)+,r0
|
||||
addf (sp)+,r0
|
||||
movf r0,-(sp)
|
||||
setd
|
||||
jmp (r1)
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define adi~
|
||||
.extern unknown~
|
||||
! $Id$
|
||||
|
||||
!size in r0
|
||||
adi~:
|
||||
mov (sp)+,r1
|
||||
cmp r0,$04
|
||||
bgt 1f
|
||||
cmp r0,$02
|
||||
bgt 2f
|
||||
add (sp)+,(sp)
|
||||
jmp (r1)
|
||||
2: add (sp)+,02(sp)
|
||||
add (sp)+,02(sp)
|
||||
adc (sp)
|
||||
jmp (r1)
|
||||
1:
|
||||
jmp unknown~
|
||||
@@ -1,15 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define and~
|
||||
! $Id$
|
||||
|
||||
! size in r0
|
||||
and~:
|
||||
mov (sp)+,r3
|
||||
mov sp,r1
|
||||
add r0,r1
|
||||
asr r0
|
||||
1: com (sp)
|
||||
bic (sp)+,(r1)+
|
||||
sob r0,1b
|
||||
jmp (r3)
|
||||
@@ -1,29 +0,0 @@
|
||||
/ $Header$
|
||||
.globl blm~
|
||||
.globl save~,retu~
|
||||
|
||||
/ Size in r0
|
||||
blm~:
|
||||
jsr pc,save~
|
||||
mov (sp)+,r2
|
||||
mov (sp)+,r3
|
||||
mov r0,r1
|
||||
asr r0
|
||||
beq 2f
|
||||
/ Now avoid wrong copy.
|
||||
/ The pieces may overlap !
|
||||
cmp r3,r2
|
||||
beq 2f
|
||||
blt 3f
|
||||
1:
|
||||
mov (r3)+,(r2)+
|
||||
sob r0,1b
|
||||
2:
|
||||
jmp retu~
|
||||
3:
|
||||
add r1,r3
|
||||
add r1,r2
|
||||
4:
|
||||
mov -(r3),-(r2)
|
||||
sob r0,4b
|
||||
br 2b
|
||||
@@ -1,16 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cff~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
cff~:
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
cmp (sp)+,r0
|
||||
beq 1f
|
||||
jsr pc,setfloat~
|
||||
movof (sp)+,r0
|
||||
movf r0,-(sp)
|
||||
setd
|
||||
1: jmp (r1)
|
||||
@@ -1,16 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cfi~
|
||||
.extern setfloat~,setint~
|
||||
! $Id$
|
||||
|
||||
cfi~:
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
jsr pc,setint~
|
||||
mov (sp)+,r0
|
||||
jsr pc,setfloat~
|
||||
movf (sp)+,r0
|
||||
movfi r0,-(sp)
|
||||
setd;seti
|
||||
jmp (r1)
|
||||
@@ -1,26 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cif~,cuf~
|
||||
.extern setint~,setfloat~
|
||||
! $Id$
|
||||
|
||||
cif~:
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
jsr pc,setfloat~
|
||||
mov (sp)+,r0
|
||||
1: jsr pc,setint~
|
||||
movif (sp)+,r0
|
||||
movf r0,-(sp)
|
||||
setd;seti
|
||||
jmp (r1)
|
||||
cuf~:
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
jsr pc,setfloat~
|
||||
mov (sp)+,r0
|
||||
cmp r0,$02
|
||||
bne 1b
|
||||
clr -(sp)
|
||||
mov $04,r0
|
||||
br 1b
|
||||
@@ -1,23 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cii~
|
||||
! $Id$
|
||||
|
||||
!convert int to int
|
||||
! 1 byte -> ? : sign extension
|
||||
cii~:
|
||||
mov (sp)+,r3
|
||||
mov (sp)+,r0
|
||||
sub (sp)+,r0
|
||||
ble 1f
|
||||
asr r0
|
||||
bcc 2f
|
||||
movb (sp),r1
|
||||
mov r1,(sp)
|
||||
2: tst r0
|
||||
beq 3f
|
||||
tst (sp)
|
||||
4: sxt -(sp)
|
||||
sob r0,4b
|
||||
1: sub r0,sp ! if out of sob loop r0==0
|
||||
3: jmp (r3)
|
||||
@@ -1,15 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cuu~
|
||||
! $Id$
|
||||
|
||||
cuu~:
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
sub (sp)+,r0
|
||||
ble 1f
|
||||
asr r0
|
||||
2: clr -(sp)
|
||||
sob r0,2b
|
||||
1: sub r0,sp ! if out of sob loop r0==0
|
||||
jmp (r1)
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cmf~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
cmf~:
|
||||
jsr pc,setfloat~
|
||||
mov (sp)+,r1
|
||||
movf (sp)+,r0
|
||||
movf (sp)+,r1
|
||||
clr r0
|
||||
cmpf r0,r1
|
||||
setd
|
||||
cfcc
|
||||
beq 1f
|
||||
blt 2f
|
||||
dec r0
|
||||
jmp (r1)
|
||||
2: inc r0
|
||||
1: jmp (r1)
|
||||
@@ -1,19 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cmi~
|
||||
.extern cmi4~,unknown~
|
||||
! $Id$
|
||||
|
||||
! Size in r0
|
||||
cmi~:
|
||||
cmp r0,$02
|
||||
bne 1f
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
sub (sp)+,r0
|
||||
neg r0
|
||||
jmp (r1)
|
||||
1: cmp r0,$04
|
||||
bne 2f
|
||||
jmp cmi4~
|
||||
2: jmp unknown~
|
||||
@@ -1,22 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cmi4~
|
||||
! $Id$
|
||||
|
||||
cmi4~:
|
||||
mov (sp)+,r1
|
||||
clr r0
|
||||
cmp (sp),4(sp)
|
||||
bgt 1f
|
||||
blt 2f
|
||||
cmp 2(sp),6(sp)
|
||||
bhi 1f
|
||||
beq 3f
|
||||
2:
|
||||
inc r0
|
||||
br 3f
|
||||
1:
|
||||
dec r0
|
||||
3:
|
||||
add $010,sp
|
||||
jmp (r1)
|
||||
@@ -1,18 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cms~
|
||||
.extern save~,retu~
|
||||
! $Id$
|
||||
|
||||
cms~:
|
||||
jsr pc,save~
|
||||
mov r0,r2
|
||||
add sp,r2
|
||||
mov r2,r4
|
||||
add r0,r4
|
||||
asr r0
|
||||
2: cmp (sp)+,(r2)+
|
||||
bne 1f
|
||||
sob r0,2b
|
||||
1: mov r4,sp
|
||||
jmp retu~
|
||||
@@ -1,24 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cmu~
|
||||
.extern unknown~,cmu4~
|
||||
! $Id$
|
||||
|
||||
cmu~:
|
||||
cmp r0,$02
|
||||
bne 3f
|
||||
mov (sp)+,r1
|
||||
clr r0
|
||||
cmp (sp)+,(sp)+
|
||||
beq 2f
|
||||
bhi 1f
|
||||
inc r0
|
||||
br 2f
|
||||
1:
|
||||
dec r0
|
||||
2:
|
||||
jmp (r1)
|
||||
3: cmp r0,$04
|
||||
bne 2f
|
||||
jmp cmu4~
|
||||
2: jmp unknown~
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define cmu4~
|
||||
! $Id$
|
||||
cmu4~:
|
||||
mov (sp)+,r1
|
||||
clr r0
|
||||
cmp (sp),4(sp)
|
||||
bhi 1f
|
||||
blo 2f
|
||||
cmp 2(sp),6(sp)
|
||||
bhi 1f
|
||||
beq 3f
|
||||
2:
|
||||
inc r0
|
||||
br 3f
|
||||
1:
|
||||
dec r0
|
||||
3:
|
||||
add $010,sp
|
||||
jmp (r1)
|
||||
@@ -1,4 +0,0 @@
|
||||
if pdp -c $1 1>&2
|
||||
then echo `basename $1 $2`.o
|
||||
else exit 1
|
||||
fi
|
||||
@@ -1,23 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define csa~
|
||||
.extern fat~
|
||||
! $Id$
|
||||
|
||||
ECASE = 024
|
||||
|
||||
csa~:
|
||||
sub 02(r0),r1
|
||||
blt 1f
|
||||
cmp 04(r0),r1
|
||||
blo 1f
|
||||
asl r1
|
||||
add r1,r0
|
||||
mov 06(r0),r1
|
||||
beq 2f
|
||||
jmp (r1)
|
||||
1: mov (r0),r0
|
||||
beq 2f
|
||||
jmp (r0)
|
||||
2: mov $ECASE,-(sp)
|
||||
jmp fat~
|
||||
@@ -1,24 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define csb~
|
||||
.extern fat~
|
||||
! $Id$
|
||||
|
||||
ECASE = 024
|
||||
|
||||
csb~:
|
||||
mov (r0)+,-(sp)
|
||||
mov (r0)+,r3
|
||||
beq 1f
|
||||
3: cmp (r0)+,r1
|
||||
beq 2f
|
||||
tst (r0)+
|
||||
sob r3,3b
|
||||
1: mov (sp)+,r1
|
||||
br 4f
|
||||
2: tst (sp)+
|
||||
mov (r0),r1
|
||||
4: beq 5f
|
||||
jmp (r1)
|
||||
5: mov $ECASE,-(sp)
|
||||
jmp fat~
|
||||
@@ -1,13 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dup~
|
||||
! $Id$
|
||||
|
||||
dup~:
|
||||
mov (sp)+,r3
|
||||
mov sp,r1
|
||||
add r0,r1
|
||||
asr r0
|
||||
1: mov -(r1),-(sp)
|
||||
sob r0,1b
|
||||
jmp (r3)
|
||||
@@ -1,15 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dvf~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
dvf~:
|
||||
mov (sp)+,r1
|
||||
jsr pc,setfloat~
|
||||
movf (sp)+,r0
|
||||
movf (sp)+,r1
|
||||
divf r0,r1
|
||||
movf r1,-(sp)
|
||||
setd
|
||||
jmp (r1)
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dvi~
|
||||
.extern unknown~,dvi4~
|
||||
! $Id$
|
||||
|
||||
dvi~:
|
||||
mov (sp)+,r3
|
||||
cmp r0,$04
|
||||
bgt 1f
|
||||
beq 2f
|
||||
mov 02(sp),r1
|
||||
sxt r0
|
||||
div (sp)+,r0
|
||||
mov r0,(sp)
|
||||
br 3f
|
||||
2: jsr pc,dvi4~
|
||||
mov r1,-(sp)
|
||||
mov r0,-(sp)
|
||||
3: jmp (r3)
|
||||
1: jmp unknown~
|
||||
@@ -1,83 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dvi4~
|
||||
.extern save~,retu~
|
||||
! $Id$
|
||||
|
||||
dvi4~:
|
||||
jsr pc,save~
|
||||
mov 02(sp),r3
|
||||
sxt r4
|
||||
bpl 1f
|
||||
neg r3
|
||||
1: cmp r4,(sp)
|
||||
bne hardldiv
|
||||
mov 06(sp),r2
|
||||
mov 04(sp),r1
|
||||
bge 2f
|
||||
neg r1
|
||||
neg r2
|
||||
sbc r1
|
||||
com r4
|
||||
2: mov r4,-(sp)
|
||||
clr r0
|
||||
div r3,r0
|
||||
mov r0,-(sp)
|
||||
mov r1,r0
|
||||
mov r1,r4
|
||||
mov r2,r1
|
||||
div r3,r0
|
||||
bvc 3f
|
||||
mov r2,r1
|
||||
mov r4,r0
|
||||
sub r3,r0
|
||||
div r3,r0
|
||||
tst r1
|
||||
sxt r1
|
||||
add r1,r0
|
||||
3: mov r0,r1
|
||||
mov (sp)+,r0
|
||||
br 4f
|
||||
hardldiv:
|
||||
clr -(sp)
|
||||
mov 010(sp),r2
|
||||
mov 06(sp),r1
|
||||
bpl 5f
|
||||
com (sp)
|
||||
neg r1
|
||||
neg r2
|
||||
sbc r1
|
||||
5: clr r0
|
||||
mov 02(sp),r3
|
||||
bge 6f
|
||||
neg r3
|
||||
neg 04(sp)
|
||||
sbc r3
|
||||
com (sp)
|
||||
6: mov $16,r4
|
||||
9: clc
|
||||
rol r2
|
||||
rol r1
|
||||
rol r0
|
||||
cmp r3,r0
|
||||
bhi 7f
|
||||
bcs 8f
|
||||
cmp 04(sp),r1
|
||||
blos 8f
|
||||
7: sob r4,9b
|
||||
br 1f
|
||||
8: sub 04(sp),r1
|
||||
sbc r0
|
||||
sub r3,r0
|
||||
inc r2
|
||||
sob r4,9b
|
||||
1:
|
||||
mov r2,r1
|
||||
clr r0
|
||||
4: tst (sp)+
|
||||
beq 1f
|
||||
neg r0
|
||||
neg r1
|
||||
sbc r0
|
||||
1: add $010,sp
|
||||
jmp retu~
|
||||
@@ -1,19 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dvu~
|
||||
.extern unknown~,dvu4~,dvu2~
|
||||
! $Id$
|
||||
|
||||
dvu~:
|
||||
mov (sp)+,r3
|
||||
cmp r0,$04
|
||||
bgt 1f
|
||||
beq 2f
|
||||
jsr pc,dvu2~
|
||||
mov r0,-(sp)
|
||||
br 3f
|
||||
2: jsr pc,dvu4~
|
||||
mov r1,-(sp)
|
||||
mov r0,-(sp)
|
||||
3: jmp (r3)
|
||||
1: jmp unknown~
|
||||
@@ -1,17 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dvu2~
|
||||
! $Id$
|
||||
dvu2~:
|
||||
clr r0
|
||||
mov 04(sp),r1
|
||||
tst 02(sp)
|
||||
blt 1f
|
||||
div 02(sp),r0
|
||||
2: mov (sp)+,r1
|
||||
add $04,sp
|
||||
jmp (r1)
|
||||
1: cmp 02(sp),r1
|
||||
bhi 2b
|
||||
inc r0
|
||||
br 2b
|
||||
@@ -1,63 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define dvu4~
|
||||
.extern save~,retu~
|
||||
! $Id$
|
||||
|
||||
dvu4~:
|
||||
jsr pc,save~
|
||||
clr r0
|
||||
tst (sp)
|
||||
bne harddvu4
|
||||
tst 02(sp)
|
||||
blt harddvu4
|
||||
mov 06(sp),r2
|
||||
mov 04(sp),r1
|
||||
mov 02(sp),r3
|
||||
div r3,r0
|
||||
mov r0,-(sp)
|
||||
mov r1,r0
|
||||
mov r1,r4
|
||||
mov r2,r1
|
||||
div r3,r0
|
||||
bvc 1f
|
||||
mov r2,r1
|
||||
mov r4,r0
|
||||
sub r3,r0
|
||||
div r3,r0
|
||||
tst r1
|
||||
sxt r1
|
||||
add r1,r0
|
||||
1: mov r0,r1
|
||||
mov (sp)+,r0
|
||||
br 2f
|
||||
harddvu4:
|
||||
mov 06(sp),r2
|
||||
mov 04(sp),r1
|
||||
mov (sp),r3
|
||||
mov $17,r4
|
||||
br 3f
|
||||
6: rol r2
|
||||
rol r1
|
||||
rol r0
|
||||
3: cmp r3,r0
|
||||
bhi 4f
|
||||
blo 5f
|
||||
cmp 02(sp),r1
|
||||
blos 5f
|
||||
4: clc
|
||||
sob r4,6b
|
||||
br 7f
|
||||
5: sub 02(sp),r1
|
||||
sbc r0
|
||||
sub r3,r0
|
||||
sec
|
||||
sob r4,6b
|
||||
7: rol r2
|
||||
bcc 8f
|
||||
mov $01,r0
|
||||
br 9f
|
||||
8: clr r0
|
||||
9: mov r2,r1
|
||||
2: add $010,sp
|
||||
jmp retu~
|
||||
@@ -1,16 +0,0 @@
|
||||
.define endtext,enddata,endbss,_etext,_edata,_end
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .end ! only for declaration of _end and endbss.
|
||||
|
||||
.sect .text
|
||||
endtext:
|
||||
_etext:
|
||||
.sect .data
|
||||
enddata:
|
||||
_edata:
|
||||
.sect .end
|
||||
_end:
|
||||
endbss:
|
||||
@@ -1,10 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.define eret
|
||||
! $Id$
|
||||
|
||||
eret:
|
||||
mov r5,sp
|
||||
mov (sp)+,r5
|
||||
mov (sp)+,r4
|
||||
mov (sp)+,r2
|
||||
rts pc
|
||||
@@ -1,20 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.define exg~
|
||||
! $Id$
|
||||
|
||||
exg~: jsr pc,save~
|
||||
mov sp,r4
|
||||
sub r0,sp
|
||||
mov sp,r3
|
||||
mov r0,r1
|
||||
1:
|
||||
mov (r4)+,(r3)+
|
||||
sob r0,1b
|
||||
asr r1
|
||||
mov sp,r4
|
||||
1:
|
||||
mov (r4)+,(r3)+
|
||||
sob r1,1b
|
||||
mov r4,sp
|
||||
jmp retu~
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.define fef~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
fef~:
|
||||
mov (sp)+,r1
|
||||
jsr pc,setfloat~
|
||||
movf (sp),r0
|
||||
movei r0,-(sp)
|
||||
movie $0,r0
|
||||
movf r0,02(sp)
|
||||
setd
|
||||
jmp (r1)
|
||||
@@ -1,14 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.define fif~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
fif~:
|
||||
mov (sp)+,r1
|
||||
jsr pc,setfloat~
|
||||
movf (sp)+,r0
|
||||
modf (sp)+,r0
|
||||
movf r0,-(sp)
|
||||
movf r1,-(sp)
|
||||
setd
|
||||
jmp (r1)
|
||||
@@ -1,20 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define gto~
|
||||
! $Id$
|
||||
|
||||
gto~:
|
||||
mov (sp)+,r4
|
||||
mov 4(r4),r5
|
||||
mov 2(r4),sp
|
||||
mov (r4),pc
|
||||
!
|
||||
! mov (sp)+,r3
|
||||
!1: cmp 4(r3),r5
|
||||
! jeq 2f
|
||||
! mov 2(r5),r4
|
||||
! mov 4(r5),r2
|
||||
! mov (r5),r5
|
||||
! br 1b
|
||||
!2: mov 2(r3),sp
|
||||
! jmp *(r3)
|
||||
@@ -1,75 +0,0 @@
|
||||
#
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.define LINO_AD,FILN_AD
|
||||
.define ERANGE,ESET,EHEAP,EILLINS,ECASE
|
||||
.define hol0,trppc~,trpim~,reghp~,.limhp
|
||||
! $Header$
|
||||
|
||||
#define float 1
|
||||
#define hardfp 1
|
||||
|
||||
LINO_AD = 0
|
||||
FILN_AD = 4
|
||||
|
||||
ERANGE = 1
|
||||
ESET = 2
|
||||
EFOVFL = 4
|
||||
EFUNFL = 5
|
||||
EFDIVZ = 7
|
||||
EFUND = 011
|
||||
ECONV = 012
|
||||
EHEAP = 021
|
||||
EILLINS = 022
|
||||
ECASE = 024
|
||||
|
||||
#ifdef float
|
||||
#ifndef hardfp
|
||||
! sys 060;.data2 4,fptrap / if not commented it will appear as undefined
|
||||
#endif
|
||||
sys 060;.data2 010,sig8
|
||||
ldfps $07600
|
||||
#endif
|
||||
mov 2(sp),r0
|
||||
clr -2(r0)
|
||||
mov sp,r0
|
||||
sub $4,sp
|
||||
mov 4(sp),(sp)
|
||||
tst (r0)+
|
||||
mov r0,2(sp)
|
||||
1:
|
||||
tst (r0)+
|
||||
bne 1b
|
||||
cmp r0,*2(sp)
|
||||
blo 1f
|
||||
tst -(r0)
|
||||
1:
|
||||
mov r0,4(sp)
|
||||
jsr pc,__m_a_i_n
|
||||
! next two lines for as long as tail needs printf
|
||||
! mov r0,-(sp)
|
||||
! jsr pc,*$_exit
|
||||
sys 1
|
||||
|
||||
.sect .data
|
||||
hol0: .data2 0,0 ! line no
|
||||
.data2 0,0 ! file
|
||||
trppc~: .data2 0
|
||||
trpim~: .data2 0
|
||||
reghp~: .data2 _end
|
||||
.limhp: .data2 _end
|
||||
|
||||
.sect .text
|
||||
sig8:
|
||||
#ifdef float
|
||||
mov r0,-(sp)
|
||||
stst r0
|
||||
mov 1f(r0),-(sp)
|
||||
jsr pc,trp~
|
||||
sys 060;.data2 010,sig8
|
||||
mov (sp)+,r0
|
||||
rti
|
||||
|
||||
.sect .data
|
||||
1: .data2 EILLINS, EILLINS, EFDIVZ, ECONV, EFOVFL, EFUNFL, EFUND, EILLINS
|
||||
.sect .text
|
||||
#endif
|
||||
@@ -1,12 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define hlt~
|
||||
! $Header$
|
||||
|
||||
exit = 1
|
||||
|
||||
hlt~:
|
||||
mov (sp)+,r0
|
||||
bne 1f
|
||||
sys exit
|
||||
1: .data2 4
|
||||
@@ -1,20 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define iaar~
|
||||
.extern aar~,trp~
|
||||
! $Id$
|
||||
|
||||
EILLINS = 022
|
||||
|
||||
iaar~:
|
||||
mov (sp)+,r0
|
||||
cmp (sp)+,$02
|
||||
bne 1f
|
||||
mov 02(sp),r1
|
||||
mov r0,02(sp)
|
||||
mov (sp)+,r0
|
||||
jmp aar~
|
||||
1: mov $EILLINS,-(sp)
|
||||
jsr pc,trp~
|
||||
add $06,sp
|
||||
jmp (r0)
|
||||
@@ -1,20 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define ilar~
|
||||
.extern lar~,trp~
|
||||
! $Id$
|
||||
|
||||
EILLINS = 022
|
||||
|
||||
ilar~:
|
||||
mov (sp)+,r0
|
||||
cmp (sp)+,$02
|
||||
bne 1f
|
||||
mov 02(sp),r1
|
||||
mov r0,02(sp)
|
||||
mov (sp)+,r0
|
||||
jmp lar~
|
||||
1: mov $EILLINS,-(sp)
|
||||
jsr pc,trp~
|
||||
add $06,sp
|
||||
jmp (r0)
|
||||
@@ -1,23 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define inn~
|
||||
! $Id$
|
||||
|
||||
inn~:
|
||||
mov r0,-(sp)
|
||||
clr r0
|
||||
div $010,r0
|
||||
cmp r0,(sp)
|
||||
bcc 1f
|
||||
add sp,r0
|
||||
bitb bits(r1),4(r0)
|
||||
beq 1f
|
||||
mov $01,r0
|
||||
br 2f
|
||||
1: clr r0
|
||||
2: mov 02(sp),r1
|
||||
add (sp)+,sp
|
||||
tst (sp)+
|
||||
jmp (r1)
|
||||
.sect .data
|
||||
bits: .data1 1,2,4,010,020,040,0100,0200
|
||||
@@ -1,20 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define isar~
|
||||
.extern sar~,trp~
|
||||
! $Id$
|
||||
|
||||
EILLINS = 022
|
||||
|
||||
isar~:
|
||||
mov (sp)+,r0
|
||||
cmp (sp)+,$02
|
||||
bne 1f
|
||||
mov 02(sp),r1
|
||||
mov r0,02(sp)
|
||||
mov (sp)+,r0
|
||||
jmp sar~
|
||||
1: mov $EILLINS,-(sp)
|
||||
jsr pc,trp~
|
||||
add $06,sp
|
||||
jmp (r0)
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define lar~
|
||||
! $Id$
|
||||
|
||||
lar~:
|
||||
mov (sp)+,r3
|
||||
sub (r0),r1
|
||||
mov 04(r0),r0
|
||||
mul r0,r1
|
||||
add (sp)+,r1
|
||||
add r0,r1
|
||||
asr r0
|
||||
beq 1f
|
||||
2: mov -(r1),-(sp)
|
||||
sob r0,2b
|
||||
jmp (r3)
|
||||
1: clr r0
|
||||
bisb -(r1),r0
|
||||
mov r0,-(sp)
|
||||
jmp (r3)
|
||||
@@ -1,17 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define los2~
|
||||
! $Id$
|
||||
|
||||
los2~:
|
||||
mov (sp)+,r3
|
||||
cmp r0,$01
|
||||
bne 1f
|
||||
clr -(sp)
|
||||
bisb (r1),(sp)
|
||||
jmp (r3)
|
||||
1: add r0,r1
|
||||
asr r0
|
||||
2: mov -(r1),-(sp)
|
||||
sob r0,2b
|
||||
jmp (r3)
|
||||
@@ -1,14 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define mlf~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
mlf~:
|
||||
mov (sp)+,r1
|
||||
jsr pc,setfloat~
|
||||
movf (sp)+,r0
|
||||
mulf (sp)+,r0
|
||||
movf r0,-(sp)
|
||||
setd
|
||||
jmp (r1)
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define mli~
|
||||
.extern unknown~,mli4~
|
||||
! $Id$
|
||||
|
||||
mli~:
|
||||
cmp r0,$04
|
||||
bgt 1f
|
||||
beq 2f
|
||||
mov (sp)+,r0
|
||||
mov (sp)+,r1
|
||||
mul (sp)+,r1
|
||||
mov r1,-(sp)
|
||||
jmp (r0)
|
||||
2: mov (sp)+,r3
|
||||
jsr pc,mli4~
|
||||
mov r1,-(sp)
|
||||
mov r0,-(sp)
|
||||
jmp (r3)
|
||||
1: jmp unknown~
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define mli4~
|
||||
.extern save~,retu~
|
||||
! $Id$
|
||||
|
||||
mli4~:
|
||||
jsr pc,save~
|
||||
mov 02(sp),r2
|
||||
sxt r1
|
||||
sub (sp),r1
|
||||
mov 06(sp),r0
|
||||
sxt r3
|
||||
sub 04(sp),r3
|
||||
mul r0,r1
|
||||
mul r2,r3
|
||||
add r1,r3
|
||||
mul r2,r0
|
||||
sub r3,r0
|
||||
add $010,sp
|
||||
jmp retu~
|
||||
@@ -1,21 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define mlu~
|
||||
.extern unknown~,mlu4~
|
||||
! $Id$
|
||||
|
||||
mlu~:
|
||||
cmp r0,$04
|
||||
bgt 1f
|
||||
beq 2f
|
||||
mov (sp)+,r0
|
||||
mov (sp)+,r1
|
||||
mul (sp)+,r1
|
||||
mov r1,-(sp)
|
||||
jmp (r0)
|
||||
2: mov (sp)+,r3
|
||||
jsr pc,mlu4~
|
||||
mov r1,-(sp)
|
||||
mov r0,-(sp)
|
||||
jmp (r3)
|
||||
1: jmp unknown~
|
||||
@@ -1,23 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define mlu4~
|
||||
.extern save~,retu~
|
||||
! $Id$
|
||||
|
||||
mlu4~:
|
||||
jsr pc,save~
|
||||
clr r1
|
||||
mov 02(sp),r0
|
||||
mov 06(sp),r3
|
||||
mul r3,r0
|
||||
tst r3
|
||||
bge 1f
|
||||
add 02(sp),r0
|
||||
1: mov 02(sp),r3
|
||||
mul 04(sp),r3
|
||||
add r3,r0
|
||||
mov 06(sp),r3
|
||||
mul (sp),r3
|
||||
add r3,r0
|
||||
add $010,sp
|
||||
jmp retu~
|
||||
@@ -1,12 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
! $Id$
|
||||
.sect .text
|
||||
.define mon~
|
||||
|
||||
EBADMON = 031
|
||||
|
||||
mon~:
|
||||
mov $EBADMON,-(sp)
|
||||
jsr pc,trp~
|
||||
tst (sp)+
|
||||
rts pc
|
||||
@@ -1,11 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define ngf~
|
||||
.extern setfloat~
|
||||
! $Id$
|
||||
|
||||
ngf~:
|
||||
jsr pc,setfloat~
|
||||
negf 2(sp)
|
||||
setd
|
||||
rts pc
|
||||
@@ -1,19 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define ngi~
|
||||
.extern unknown~
|
||||
! $Id$
|
||||
|
||||
ngi~:
|
||||
mov (sp)+,r1
|
||||
cmp r0,$02
|
||||
bgt 1f
|
||||
neg (sp)
|
||||
jmp (r1)
|
||||
1: cmp r0,$04
|
||||
bgt 2f
|
||||
neg (sp)
|
||||
neg 02(sp)
|
||||
sbc (sp)
|
||||
jmp (r1)
|
||||
2: jmp unknown~
|
||||
@@ -1,14 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define nop~
|
||||
.extern hol0,prf~
|
||||
! $Id$
|
||||
|
||||
nop~:
|
||||
mov hol0,-(sp)
|
||||
mov $fmt,-(sp)
|
||||
jsr pc,prf~
|
||||
add $04,sp
|
||||
rts pc
|
||||
.sect .data
|
||||
fmt: .asciz "test %d\n"
|
||||
@@ -1,35 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define prf~
|
||||
.extern save~,retu~,hol0,printf~
|
||||
! $Id$
|
||||
|
||||
prf~:
|
||||
jsr pc,save~
|
||||
mov hol0,-(sp)
|
||||
mov hol0+4,r0
|
||||
beq 1f
|
||||
mov r0,r2
|
||||
mov $050,r1
|
||||
3: movb (r2)+,r3
|
||||
beq 2f
|
||||
cmpb r3,$0177
|
||||
bge 1f
|
||||
cmpb r3,$040
|
||||
blt 1f
|
||||
sob r1,3b
|
||||
clrb (r2)
|
||||
2: mov sp,r1
|
||||
mov r1,-(sp)
|
||||
mov r0,-(sp)
|
||||
mov $fmt,-(sp)
|
||||
jsr pc,printf~
|
||||
add $010,sp
|
||||
jsr pc,printf~
|
||||
jmp retu~
|
||||
1: mov $name,r0
|
||||
br 2b
|
||||
|
||||
.sect .data
|
||||
fmt: .asciz "\"%s\", sp = %d, line %d: "
|
||||
name: .asciz "_unknown file_"
|
||||
@@ -1,62 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define printf~
|
||||
! $Id$
|
||||
|
||||
printf~:
|
||||
mov r2,-(sp)
|
||||
mov r3,-(sp)
|
||||
mov r4,-(sp)
|
||||
mov sp,r3
|
||||
mov $buff,r4
|
||||
add $010,r3
|
||||
mov (r3)+,r2
|
||||
prloop:
|
||||
movb (r2)+,r0
|
||||
beq ready
|
||||
cmpb r0,$045
|
||||
bne 1f
|
||||
movb (r2)+,r0
|
||||
cmpb r0,$0144
|
||||
beq 2f
|
||||
cmpb r0,$0163
|
||||
beq 3f
|
||||
1: movb r0,(r4)+
|
||||
br prloop
|
||||
2: mov (r3)+,r1
|
||||
bge 4f
|
||||
movb $055,(r4)+
|
||||
neg r1
|
||||
4: jsr pc,printn
|
||||
br prloop
|
||||
printn:
|
||||
clr r0
|
||||
div $010,r0
|
||||
beq 5f
|
||||
mov r1,-(sp)
|
||||
mov r0,r1
|
||||
jsr pc,printn
|
||||
mov (sp)+,r1
|
||||
5: add $060,r1
|
||||
movb r1,(r4)+
|
||||
rts pc
|
||||
3: mov (r3)+,r1
|
||||
7: movb (r1)+,r0
|
||||
bne 6f
|
||||
br prloop
|
||||
6: movb r0,(r4)+
|
||||
br 7b
|
||||
ready:
|
||||
movb r0,(r4)+
|
||||
sub $buff,r4
|
||||
mov r4,-(sp)
|
||||
mov $buff,-(sp)
|
||||
mov $01,-(sp)
|
||||
jsr pc,WRITE
|
||||
add $06,sp
|
||||
mov (sp)+,r4
|
||||
mov (sp)+,r3
|
||||
mov (sp)+,r2
|
||||
rts pc
|
||||
.sect .bss
|
||||
buff: .space 256
|
||||
@@ -1,17 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define rck~
|
||||
.extern trp~
|
||||
! $Id$
|
||||
|
||||
ERANGE = 1
|
||||
|
||||
rck~:
|
||||
mov (sp)+,r1
|
||||
cmp (sp),(r0)
|
||||
blt 1f
|
||||
cmp (sp),02(r0)
|
||||
ble 2f
|
||||
1: mov $ERANGE,-(sp)
|
||||
jsr pc,trp~
|
||||
2: jmp (r1)
|
||||
@@ -1,28 +0,0 @@
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||
.sect .text
|
||||
.define ret~,lfr~
|
||||
.extern unknown~, retar
|
||||
! $Id$
|
||||
|
||||
! Size in r0
|
||||
ret~:
|
||||
mov r0,r1
|
||||
beq 1f
|
||||
asr r1
|
||||
add $retar,r0
|
||||
cmp r0,$retend
|
||||
bhi 9f
|
||||
3: mov (sp)+,-(r0)
|
||||
sob r1,3b
|
||||
1: mov r5,sp
|
||||
mov (sp)+,r5
|
||||
rts pc
|
||||
9: jmp unknown~
|
||||
lfr~:
|
||||
mov (sp)+,r3
|
||||
asr r0
|
||||
beq 4f
|
||||
mov $retar,r1
|
||||
5: mov (r1)+,-(sp)
|
||||
sob r0,5b
|
||||
4: jmp (r3)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user