*** empty log message ***
This commit is contained in:
11
mach/s2650/as/mach0.c
Normal file
11
mach/s2650/as/mach0.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#define DUK
|
||||
#define RCSID0 "$Header$"
|
||||
|
||||
/*
|
||||
* Signetics 2650 options
|
||||
*/
|
||||
#define LISTING
|
||||
#define BYTES_REVERSED
|
||||
#define THREE_PASS
|
||||
#define RELOCATION
|
||||
#define NOLD
|
||||
20
mach/s2650/as/mach1.c
Normal file
20
mach/s2650/as/mach1.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#define RCSID1 "$Header$"
|
||||
|
||||
/*
|
||||
* Signetics 2650 register names
|
||||
*/
|
||||
|
||||
#define R0 0
|
||||
#define R1 1
|
||||
#define R2 2
|
||||
#define R3 3
|
||||
|
||||
#define low7(z) (z & 0x7F)
|
||||
#define low13(z) (z & 0x1FFF)
|
||||
|
||||
#define fit7(z) (low7(z) == z)
|
||||
#define fit13(z) (low13(z) == z)
|
||||
|
||||
extern expr_t par_exp;
|
||||
extern unsigned p_indirect;
|
||||
extern int p_indexed;
|
||||
23
mach/s2650/as/mach2.c
Normal file
23
mach/s2650/as/mach2.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#define RCSID2 "$Header$"
|
||||
|
||||
/*
|
||||
* Signetics 2650 tokens
|
||||
*/
|
||||
%token <y_word> REG
|
||||
%token <y_word> NOOP
|
||||
%token <y_word> CC
|
||||
%token <y_word> INDE
|
||||
%token <y_word> ZERO
|
||||
%token <y_word> ZEROX
|
||||
%token <y_word> IMMED
|
||||
%token <y_word> REL
|
||||
%token <y_word> ABSO
|
||||
%token <y_word> PSWM
|
||||
%token <y_word> RET
|
||||
%token <y_word> BRANCR
|
||||
%token <y_word> BRANCRX
|
||||
%token <y_word> BRANCA
|
||||
%token <y_word> BRANCAX
|
||||
%token <y_word> BRANRA
|
||||
%token <y_word> ZBRR
|
||||
%token <y_word> BXSA
|
||||
90
mach/s2650/as/mach3.c
Normal file
90
mach/s2650/as/mach3.c
Normal file
@@ -0,0 +1,90 @@
|
||||
#define RCSID3 "$Header$"
|
||||
|
||||
/*
|
||||
* Signetics 2650 keywords
|
||||
*/
|
||||
0, REG, R0, "r0",
|
||||
0, REG, R1, "r1",
|
||||
0, REG, R2, "r2",
|
||||
0, REG, R3, "r3",
|
||||
0, CC, 0, "eq",
|
||||
0, CC, 0, "z",
|
||||
0, CC, 1, "gt",
|
||||
0, CC, 2, "lt",
|
||||
0, CC, 3, "un",
|
||||
0, INDE, 0x6000, "i",
|
||||
0, ZERO, 0x0, "lodz",
|
||||
0, ZERO, 0x80, "addz",
|
||||
0, ZERO, 0xA0, "subz",
|
||||
0, ZERO, 0x94, "dar",
|
||||
0, ZEROX, 0x40, "andz",
|
||||
0, ZERO, 0x60, "iorz",
|
||||
0, ZERO, 0x20, "eorz",
|
||||
0, ZERO, 0xE0, "comz",
|
||||
0, ZERO, 0xF0, "wrtd",
|
||||
0, ZERO, 0x70, "redd",
|
||||
0, ZERO, 0xB0, "wrtc",
|
||||
0, ZERO, 0x30, "redc",
|
||||
0, ZERO, 0x50, "rrr",
|
||||
0, ZERO, 0xD0, "rrl",
|
||||
0, ZEROX, 0xC0, "strz",
|
||||
0, IMMED, 0x04, "lodi",
|
||||
0, IMMED, 0x84, "addi",
|
||||
0, IMMED, 0xA4, "subi",
|
||||
0, IMMED, 0x44, "andi",
|
||||
0, IMMED, 0x64, "iori",
|
||||
0, IMMED, 0x24, "eori",
|
||||
0, IMMED, 0xE4, "comi",
|
||||
0, IMMED, 0xD4, "wrte",
|
||||
0, IMMED, 0x54, "rede",
|
||||
0, IMMED, 0xF4, "tmi",
|
||||
0, NOOP, 0x1E, "halt",
|
||||
0, NOOP, 0xC0, "nop",
|
||||
0, NOOP, 0x92, "lpsu",
|
||||
0, NOOP, 0x93, "lpsl",
|
||||
0, NOOP, 0x12, "spsu",
|
||||
0, NOOP, 0x13, "spsl",
|
||||
0, REL, 0x08, "lodr",
|
||||
0, REL, 0xC8, "strr",
|
||||
0, REL, 0x98, "addr",
|
||||
0, REL, 0xA8, "subr",
|
||||
0, REL, 0x48, "andr",
|
||||
0, REL, 0x68, "iorr",
|
||||
0, REL, 0x28, "eorr",
|
||||
0, REL, 0xE8, "comr",
|
||||
0, ABSO, 0x0C, "loda",
|
||||
0, ABSO, 0xCC, "stra",
|
||||
0, ABSO, 0x8C, "adda",
|
||||
0, ABSO, 0xAC, "suba",
|
||||
0, ABSO, 0x4C, "anda",
|
||||
0, ABSO, 0x6C, "iora",
|
||||
0, ABSO, 0x2C, "eora",
|
||||
0, ABSO, 0xEC, "coma",
|
||||
0, PSWM, 0x74, "cpsu",
|
||||
0, PSWM, 0x75, "cpsl",
|
||||
0, PSWM, 0x76, "ppsu",
|
||||
0, PSWM, 0x77, "ppsl",
|
||||
0, PSWM, 0xB4, "tpsu",
|
||||
0, PSWM, 0xB5, "tpsl",
|
||||
0, RET, 0x14, "retc",
|
||||
0, RET, 0x34, "rete",
|
||||
0, BRANCR, 0x18, "bctr",
|
||||
0, BRANCRX, 0x98, "bcfr",
|
||||
0, REL, 0x58, "brnr",
|
||||
0, REL, 0xD8, "birr",
|
||||
0, REL, 0xF8, "bdrr",
|
||||
0, BRANCR, 0x38, "bstr",
|
||||
0, BRANCRX, 0xB8, "bsfr",
|
||||
0, REL, 0x78, "bsnr",
|
||||
0, BRANCA, 0x1E, "bcta",
|
||||
0, BRANCAX, 0x9E, "bcfa",
|
||||
0, BRANRA, 0x5E, "brna",
|
||||
0, BRANRA, 0xDE, "bira",
|
||||
0, BRANRA, 0xFE, "bdra",
|
||||
0, BRANCA, 0x3E, "bsta",
|
||||
0, BRANCAX, 0xBE, "bsfa",
|
||||
0, BRANRA, 0x7E, "bsna",
|
||||
0, ZBRR, 0x9B, "zbrr",
|
||||
0, ZBRR, 0xBB, "zbsr",
|
||||
0, BXSA, 0x9F, "bxa",
|
||||
0, BXSA, 0xBF, "bsxa",
|
||||
139
mach/s2650/as/mach4.c
Normal file
139
mach/s2650/as/mach4.c
Normal file
@@ -0,0 +1,139 @@
|
||||
#define RCSID4 "$Header$"
|
||||
|
||||
/*
|
||||
* (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: Leo van Moergestel */
|
||||
|
||||
/*
|
||||
* Signetics 2650 parsing rules
|
||||
*/
|
||||
operation:
|
||||
NOOP
|
||||
{ emit1($1);}
|
||||
|
|
||||
ZERO ',' REG
|
||||
{ emit1($1 | $3); }
|
||||
|
|
||||
IMMED ',' REG expr
|
||||
{ emit1($1 | $3); page();
|
||||
#ifdef RELOCATION
|
||||
newrelo($4.typ, RELO1);
|
||||
#endif
|
||||
emit1($4.val);
|
||||
}
|
||||
|
|
||||
REL ',' REG expr
|
||||
{ emit1($1 | $3); rela($4, 0);}
|
||||
|
|
||||
REL ',' REG '*' expr
|
||||
{ emit1($1 | $3); rela($5, 0x80);}
|
||||
|
|
||||
ZEROX ',' REG
|
||||
{ if ($3 == R0)
|
||||
serror("register error");
|
||||
emit1($1 | $3);
|
||||
}
|
||||
|
|
||||
ABSO ',' REG param
|
||||
{ emit1($1 | $3);
|
||||
absoa(par_exp, p_indexed, p_indirect);
|
||||
}
|
||||
|
|
||||
PSWM expr
|
||||
{ emit1($1); page();
|
||||
#ifdef RELOCATION
|
||||
newrelo($2.typ, RELO1);
|
||||
#endif
|
||||
emit1($2.val);
|
||||
}
|
||||
|
|
||||
RET ',' CC
|
||||
{ emit1($1 | $3);}
|
||||
|
|
||||
BRANCR ',' CC expr
|
||||
{ emit1($1 | $3); rela($4, 0);}
|
||||
|
|
||||
BRANCR ',' CC '*' expr
|
||||
{ emit1($1 | $3); rela($5, 0x80);}
|
||||
|
|
||||
BRANCRX ',' CC expr
|
||||
{ if($3 == 3)
|
||||
serror("wrong condition");
|
||||
emit1($1 | $3); rela($4, 0);}
|
||||
|
|
||||
BRANCRX ',' CC '*' expr
|
||||
{ if($3 == 3)
|
||||
serror("wrong condition");
|
||||
emit1($1 | $3); rela($5, 0x80);}
|
||||
|
|
||||
BRANCA ',' CC expr
|
||||
{ emit1($1 | $3); absob($4, 0);}
|
||||
|
|
||||
BRANCA ',' CC '*' expr
|
||||
{ emit1($1 | $3); absob($5, 0x8000);}
|
||||
|
|
||||
BRANCAX ',' CC expr
|
||||
{ if($3 == 3)
|
||||
serror("wrong condition");
|
||||
emit1($1 | $3); absob($4, 0);}
|
||||
|
|
||||
BRANCAX ',' CC '*' expr
|
||||
{ if($3 == 3)
|
||||
serror("wrong condition");
|
||||
emit1($1 | $3); absob($5, 0x8000);}
|
||||
|
|
||||
BRANRA ',' REG expr
|
||||
{ emit1($1 | $3); absob($4, 0);}
|
||||
|
|
||||
BRANRA ',' REG '*' expr
|
||||
{ emit1($1 | $3); absob($5, 0x8000);}
|
||||
|
|
||||
ZBRR expr
|
||||
{ emit1($1); rela($2, 0);}
|
||||
|
|
||||
ZBRR '*' expr
|
||||
{ emit1($1); rela($3, 0x80);}
|
||||
|
|
||||
BXSA expr
|
||||
{ emit1($1); absob($2, 0);}
|
||||
|
|
||||
BXSA '*' expr
|
||||
{ emit1($1); absob($3, 0x8000);}
|
||||
;
|
||||
|
||||
param:
|
||||
indir_opt
|
||||
{ p_indexed = 0;}
|
||||
|
|
||||
indir_opt ',' INDE
|
||||
{ p_indexed = 0x6000;}
|
||||
|
|
||||
indir_opt ',' '+'
|
||||
{ p_indexed = 0x2000;}
|
||||
|
|
||||
indir_opt ',' '-'
|
||||
{ p_indexed = 0x4000;}
|
||||
;
|
||||
|
||||
indir_opt:
|
||||
expr
|
||||
{ par_exp = $1; p_indirect = 0;}
|
||||
|
|
||||
'*' expr
|
||||
{ par_exp = $2; p_indirect = 0x8000;}
|
||||
;
|
||||
86
mach/s2650/as/mach5.c
Normal file
86
mach/s2650/as/mach5.c
Normal file
@@ -0,0 +1,86 @@
|
||||
#define RCSID5 "$Header$"
|
||||
|
||||
/*
|
||||
* Signetics 2650 special routines
|
||||
*/
|
||||
|
||||
#define MASK 0x6000
|
||||
#define MASK1 0x1FFF
|
||||
#define MASK2 0x1FFE
|
||||
|
||||
page()
|
||||
{
|
||||
if(((DOTVAL - 1) & MASK1) == MASK1)
|
||||
serror("page violation");
|
||||
}
|
||||
|
||||
pag2()
|
||||
{
|
||||
if(((DOTVAL - 1) & MASK1) >= MASK2)
|
||||
serror("page violation");
|
||||
}
|
||||
|
||||
rela(exp,ind)
|
||||
expr_t exp;
|
||||
int ind;
|
||||
{
|
||||
int c, d;
|
||||
page();
|
||||
if(pass == PASS_3){
|
||||
#ifdef ASLD
|
||||
if((DOTVAL & MASK) != (exp.val & MASK))
|
||||
serror("relative address outside page");
|
||||
#endif
|
||||
d = low13(DOTVAL);
|
||||
c = low13(exp.val);
|
||||
#ifdef ASLD
|
||||
/*
|
||||
* I (Duk Bekema) think the next two if's are meant to
|
||||
* handle wrap around, but the original author didn't give
|
||||
* any comment here and I don't know anything about the
|
||||
* Signetics 2650.
|
||||
*/
|
||||
if(c - d > 0x1F80)
|
||||
d |= 0x2000;
|
||||
if(d - c > 0x1F80)
|
||||
c |= 0x2000;
|
||||
#endif
|
||||
c -= d + 1;
|
||||
fit(fit7(c));
|
||||
}
|
||||
#ifdef RELOCATION
|
||||
newrelo(exp.typ, RELPC | RELO1);
|
||||
#endif
|
||||
emit1(low7(c) | ind);
|
||||
}
|
||||
|
||||
absoa(exp, ix, ind)
|
||||
expr_t exp;
|
||||
int ix;
|
||||
unsigned ind;
|
||||
{
|
||||
pag2();
|
||||
#ifdef ASLD
|
||||
if(pass == PASS_3 && (exp.val & MASK) != (DOTVAL & MASK))
|
||||
serror("page violation");
|
||||
#endif
|
||||
#ifdef RELOCATION
|
||||
newrelo(exp.typ, RELO2 | RELBR);
|
||||
#endif
|
||||
emit2(low13(exp.val) | ind | ix);
|
||||
}
|
||||
|
||||
absob(exp, ind)
|
||||
expr_t exp;
|
||||
unsigned ind;
|
||||
{
|
||||
pag2();
|
||||
#ifdef ASLD
|
||||
if (exp.val < 0)
|
||||
serror("branch to nonexistent memory");
|
||||
#endif
|
||||
#ifdef RELOCATION
|
||||
newrelo(exp.typ, RELO2 | RELBR);
|
||||
#endif
|
||||
emit2(exp.val | ind);
|
||||
}
|
||||
Reference in New Issue
Block a user