Merge from default.
This commit is contained in:
commit
34e9573929
10
.travis.yml
10
.travis.yml
|
@ -12,13 +12,13 @@ matrix:
|
|||
sudo: false
|
||||
dist: trusty
|
||||
compiler: clang
|
||||
# -
|
||||
# os: osx
|
||||
# env: HOMEBREW_NO_AUTO_UPDATE=1
|
||||
# compiler: clang
|
||||
-
|
||||
os: osx
|
||||
env: HOMEBREW_NO_AUTO_UPDATE=1
|
||||
compiler: clang
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
depth: 1
|
||||
script:
|
||||
- make CC=$CC PREFIX=/tmp/acki +ack
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ struct mkey {
|
|||
{0, K_UNKNOWN}
|
||||
};
|
||||
|
||||
char *strcpy();
|
||||
char *sprint();
|
||||
|
||||
init_pp()
|
||||
|
|
|
@ -135,7 +135,7 @@ INSTRUCTIONS
|
|||
rst const1:ro cost(1,11).
|
||||
/* rz cost(1, 8). */
|
||||
sbb reg1:ro kills a:cc cost(1, 4).
|
||||
/* sbi const1:ro kills a:cc cost(2, 7). */
|
||||
sbi const1:ro kills a:cc cost(2, 7).
|
||||
shld label:ro cost(3,16).
|
||||
sphl cost(1, 5).
|
||||
sta label:ro cost(3,13).
|
||||
|
@ -623,37 +623,68 @@ pat sde
|
|||
/****************************************/
|
||||
|
||||
pat adi $1==2
|
||||
with hlreg dereg
|
||||
gen dad de yields hl
|
||||
with dereg hlreg
|
||||
gen dad de yields hl
|
||||
with hlreg hlreg
|
||||
gen dad hl yields hl
|
||||
with dereg dereg
|
||||
gen xchg.
|
||||
dad hl yields hl
|
||||
with hlreg dereg
|
||||
gen
|
||||
dad de
|
||||
yields hl
|
||||
with dereg hlreg
|
||||
gen
|
||||
dad de
|
||||
yields hl
|
||||
with hlreg hlreg
|
||||
gen
|
||||
dad hl
|
||||
yields hl
|
||||
with dereg dereg
|
||||
gen
|
||||
xchg.
|
||||
dad hl
|
||||
yields hl
|
||||
|
||||
pat adi $1==4
|
||||
kills ALL
|
||||
gen Call {label,".adi4"}
|
||||
kills ALL
|
||||
gen
|
||||
Call {label,".adi4"}
|
||||
|
||||
pat sbi $1==2
|
||||
with hl_or_de hl_or_de
|
||||
uses areg
|
||||
gen mov a,%2.2
|
||||
with const2 hl_or_de
|
||||
yields %2 {const2, 0-%1.num}
|
||||
leaving
|
||||
adi 2
|
||||
with smallconst2 hl_or_de
|
||||
yields %2 {smallconst2, 0-%1.num}
|
||||
leaving
|
||||
adi 2
|
||||
with hl_or_de const2
|
||||
uses areg
|
||||
gen
|
||||
mvi a, {const1, %2.num & 0xff}
|
||||
sub %1.2
|
||||
mov %1.2, a
|
||||
mvi a, {const1, %2.num >> 8}
|
||||
sbb %1.1
|
||||
mov %1.1, a
|
||||
yields %1
|
||||
with hl_or_de hl_or_de
|
||||
uses areg
|
||||
gen
|
||||
mov a,%2.2
|
||||
sub %1.2
|
||||
mov %1.2,a
|
||||
mov a,%2.1
|
||||
sbb %1.1
|
||||
mov %1.1,a yields %1
|
||||
with hl_or_de hl_or_de
|
||||
uses areg
|
||||
gen mov a,%2.2
|
||||
mov %1.1,a
|
||||
yields %1
|
||||
with hl_or_de hl_or_de
|
||||
uses areg
|
||||
gen
|
||||
mov a,%2.2
|
||||
sub %1.2
|
||||
mov %2.2,a
|
||||
mov a,%2.1
|
||||
sbb %1.1
|
||||
mov %2.1,a yields %2
|
||||
mov %2.1,a
|
||||
yields %2
|
||||
|
||||
pat sbi $1==4
|
||||
kills ALL
|
||||
|
@ -702,14 +733,33 @@ pat ngi $1==4
|
|||
kills ALL
|
||||
gen Call {label,".ngi4"}
|
||||
|
||||
pat loc sli ($1 == 8) && ($2 == 2)
|
||||
with hl_or_de
|
||||
gen move %1.2, %1.1
|
||||
mvi %1.2, {const1,0} yields %1
|
||||
pat loc sli ($1==1) && ($2==2)
|
||||
with hlreg
|
||||
gen
|
||||
dad hl
|
||||
yields hl
|
||||
|
||||
pat loc sli ($1>=2) && ($1<=7) && ($2==2)
|
||||
with hlreg
|
||||
gen
|
||||
dad hl
|
||||
yields hl
|
||||
leaving
|
||||
loc $1-1
|
||||
sli 2
|
||||
|
||||
pat loc sli ($1==8) && ($2==2)
|
||||
with hl_or_de
|
||||
gen
|
||||
mov %1.1, %1.2
|
||||
mvi %1.2, {const1, 0}
|
||||
yields %1
|
||||
|
||||
pat sli $1==2
|
||||
kills ALL
|
||||
gen Call {label,".sli2"} yields de
|
||||
kills ALL
|
||||
gen
|
||||
Call {label,".sli2"}
|
||||
yields de
|
||||
|
||||
pat sli $1==4
|
||||
kills ALL
|
||||
|
@ -761,7 +811,14 @@ kills ALL
|
|||
gen mvi a,{const1,0}
|
||||
Call {label,".dvi4"}
|
||||
|
||||
pat slu leaving sli $1
|
||||
pat loc slu ($2==2)
|
||||
leaving
|
||||
loc $1
|
||||
sli $2
|
||||
|
||||
pat slu
|
||||
leaving
|
||||
sli $1
|
||||
|
||||
pat loc sru ($1 == 8) && ($2 == 2)
|
||||
with hl_or_de
|
||||
|
@ -1791,31 +1848,91 @@ with yields {const2,$1}
|
|||
leaving bne $2
|
||||
|
||||
pat bra
|
||||
with STACK
|
||||
gen jmp {label,$1}
|
||||
with STACK
|
||||
gen
|
||||
jmp {label,$1}
|
||||
|
||||
pat blt
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen mov a,%2.2
|
||||
with const2 hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a, %2.2
|
||||
sui {const1, %1.num & 0xff}
|
||||
mov a, %2.1
|
||||
sbi {const1, %1.num >> 8}
|
||||
jm {label, $1}
|
||||
with hl_or_de const2 STACK
|
||||
uses areg
|
||||
gen
|
||||
mvi a, {const1, %2.num & 0xff}
|
||||
sub %1.2
|
||||
mvi a, {const1, %2.num >> 8}
|
||||
sbb %1.1
|
||||
jm {label, $1}
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a,%2.2
|
||||
sub %1.2
|
||||
mov a,%2.1
|
||||
sbb %1.1
|
||||
jm {label,$1}
|
||||
|
||||
pat ble
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen mov a,%1.2
|
||||
sub %2.2
|
||||
mov a,%1.1
|
||||
sbb %2.1
|
||||
pat bgt
|
||||
leaving
|
||||
exg 2
|
||||
blt $1
|
||||
|
||||
pat bge
|
||||
with const2 hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a, %2.2
|
||||
sui {const1, %1.num & 0xff}
|
||||
mov a, %2.1
|
||||
sbi {const1, %1.num >> 8}
|
||||
jp {label, $1}
|
||||
with hl_or_de const2 STACK
|
||||
uses areg
|
||||
gen
|
||||
mvi a, {const1, %2.num & 0xff}
|
||||
sub %1.2
|
||||
mvi a, {const1, %2.num >> 8}
|
||||
sbb %1.1
|
||||
jp {label, $1}
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a,%2.2
|
||||
sub %1.2
|
||||
mov a,%2.1
|
||||
sbb %1.1
|
||||
jp {label,$1}
|
||||
|
||||
pat ble
|
||||
leaving
|
||||
exg 2
|
||||
bge $1
|
||||
|
||||
pat beq
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen mov a,%2.2
|
||||
with const2 hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a, %2.2
|
||||
cpi {const1, %1.num & 0xff}
|
||||
jnz {label, 1f}
|
||||
mov a, %2.1
|
||||
cpi {const1, %1.num >> 8}
|
||||
jz {label, $1}
|
||||
1:
|
||||
with hl_or_de const2 STACK
|
||||
leaving
|
||||
exg 2
|
||||
beq $1
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a,%2.2
|
||||
cmp %1.2
|
||||
jnz {label,1f}
|
||||
mov a,%2.1
|
||||
|
@ -1824,33 +1941,29 @@ gen mov a,%2.2
|
|||
1:
|
||||
|
||||
pat bne
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen mov a,%2.2
|
||||
with const2 hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a, %2.2
|
||||
cpi {const1, %1.num & 0xff}
|
||||
jnz {label, $1}
|
||||
mov a, %2.1
|
||||
cpi {const1, %1.num >> 8}
|
||||
jnz {label, $1}
|
||||
with hl_or_de const2 STACK
|
||||
leaving
|
||||
exg 2
|
||||
beq $1
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen
|
||||
mov a,%2.2
|
||||
cmp %1.2
|
||||
jnz {label,$1}
|
||||
mov a,%2.1
|
||||
cmp %1.1
|
||||
jnz {label,$1}
|
||||
|
||||
pat bge
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen mov a,%2.2
|
||||
sub %1.2
|
||||
mov a,%2.1
|
||||
sbb %1.1
|
||||
jp {label,$1}
|
||||
|
||||
pat bgt
|
||||
with hl_or_de hl_or_de STACK
|
||||
uses areg
|
||||
gen mov a,%1.2
|
||||
sub %2.2
|
||||
mov a,%1.1
|
||||
sbb %2.1
|
||||
jm {label,$1}
|
||||
|
||||
pat zlt
|
||||
with STACK
|
||||
gen pop psw
|
||||
|
@ -2027,46 +2140,29 @@ gen 1:
|
|||
/* Group 15: Miscellaneous */
|
||||
/******************************************/
|
||||
|
||||
pat asp $1<=0-6
|
||||
with STACK
|
||||
uses hlreg={const2,$1}
|
||||
gen dad sp
|
||||
pat asp ($1<=0-12) || ($1>=12)
|
||||
with STACK
|
||||
uses hlreg={const2,$1}
|
||||
gen
|
||||
dad sp
|
||||
sphl.
|
||||
|
||||
pat asp $1==0-4
|
||||
with STACK
|
||||
gen dcx sp
|
||||
dcx sp
|
||||
dcx sp
|
||||
dcx sp
|
||||
|
||||
pat asp $1==0-2
|
||||
with STACK
|
||||
gen dcx sp
|
||||
dcx sp
|
||||
pat asp ($1<0) && ($1>0-12)
|
||||
with STACK
|
||||
gen
|
||||
push hl
|
||||
leaving
|
||||
asp $1+2
|
||||
|
||||
pat asp $1==0 /* do nothing */
|
||||
|
||||
pat asp $1==2
|
||||
with exact src1or2
|
||||
with STACK
|
||||
gen inx sp
|
||||
inx sp
|
||||
|
||||
pat asp $1==4
|
||||
with exact src1or2 leaving asp 2
|
||||
with STACK
|
||||
gen inx sp
|
||||
inx sp
|
||||
inx sp
|
||||
inx sp
|
||||
|
||||
pat asp $1>=6
|
||||
with exact src1or2 leaving asp $1-2
|
||||
with STACK
|
||||
uses hlreg={const2,$1}
|
||||
gen dad sp
|
||||
sphl.
|
||||
pat asp ($1>0) && ($1<12)
|
||||
with STACK
|
||||
uses hlreg
|
||||
gen
|
||||
pop hl
|
||||
leaving
|
||||
asp $1-2
|
||||
|
||||
pat ass $1==2
|
||||
with hlreg STACK
|
||||
|
|
|
@ -13,4 +13,6 @@ mvi X, Y : mov X, Z -> mov X, Z ;
|
|||
xchg : inx h : xchg -> inx d ;
|
||||
xchg : inx d : xchg -> inx h ;
|
||||
|
||||
cpi 0 -> ora a ;
|
||||
|
||||
%%;
|
||||
|
|
|
@ -53,7 +53,6 @@ extern short bflag; /* -b option (no optimizations) */
|
|||
#endif
|
||||
|
||||
extern char *aoutpath INIT("a.out");
|
||||
extern char temppath[50];
|
||||
|
||||
extern FILE *input;
|
||||
extern FILE *tempfile;
|
||||
|
@ -93,7 +92,6 @@ extern short listcolm; /* column on output */
|
|||
extern short listeoln INIT(1);
|
||||
/* set by endline, tested by emit1 */
|
||||
extern FILE *listfile; /* copy of source text */
|
||||
extern char listpath[50];
|
||||
#endif
|
||||
|
||||
#ifndef extern
|
||||
|
@ -155,9 +153,6 @@ void emit4(long);
|
|||
void emitx(valu_t, int);
|
||||
void emitf(int size, int negative);
|
||||
void emitstr(int);
|
||||
void ffreopen(char *, FILE *);
|
||||
FILE *ffcreat(char *);
|
||||
FILE *fftemp(char *, char *);
|
||||
void yyerror(const char *);
|
||||
void nosect(void);
|
||||
void fatal(const char *, ...);
|
||||
|
|
|
@ -32,12 +32,6 @@ static void commfinish(void);
|
|||
/* ========== Machine independent C routines ========== */
|
||||
|
||||
void stop(void) {
|
||||
#if DEBUG < 2
|
||||
unlink(temppath);
|
||||
#ifdef LISTING
|
||||
unlink(listpath);
|
||||
#endif
|
||||
#endif
|
||||
exit(nerrors != 0);
|
||||
}
|
||||
|
||||
|
@ -78,13 +72,6 @@ main(int argc, char **argv)
|
|||
fatal("-o needs filename");
|
||||
aoutpath = argv[i];
|
||||
break;
|
||||
case 'T':
|
||||
if (*p != '\0') {
|
||||
extern char *tmp_dir;
|
||||
|
||||
tmp_dir = p;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
#ifdef LISTING
|
||||
dflag = 0;
|
||||
|
@ -154,11 +141,11 @@ pass_1(int argc, char **argv)
|
|||
nbits = BITCHUNK;
|
||||
#endif
|
||||
|
||||
tempfile = fftemp(temppath, "asTXXXXXX");
|
||||
tempfile = tmpfile();
|
||||
#ifdef LISTING
|
||||
listmode = dflag;
|
||||
if (listmode & 0440)
|
||||
listfile = fftemp(listpath, "asLXXXXXX");
|
||||
listfile = tmpfile();
|
||||
#endif
|
||||
for (ip = keytab; ip->i_type; ip++)
|
||||
item_insert(ip, H_KEY+hash(ip->i_name));
|
||||
|
@ -399,7 +386,7 @@ pass_23(int n)
|
|||
#ifdef LISTING
|
||||
listmode >>= 3;
|
||||
if (listmode & 4)
|
||||
ffreopen(listpath, listfile);
|
||||
rewind(listfile);
|
||||
listeoln = 1;
|
||||
#endif
|
||||
#ifdef THREE_PASS
|
||||
|
@ -438,7 +425,7 @@ pass_23(int n)
|
|||
#ifndef ASLD
|
||||
newmodule(modulename);
|
||||
#endif /* ASLD */
|
||||
ffreopen(temppath, tempfile);
|
||||
rewind(tempfile);
|
||||
yyparse();
|
||||
commfinish();
|
||||
machfinish(n);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* miscellaneous
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include "comm0.h"
|
||||
#include "comm1.h"
|
||||
#include "y.tab.h"
|
||||
|
@ -386,39 +387,6 @@ void emitf(int size, int negative)
|
|||
con_float(stringbuf, size);
|
||||
}
|
||||
|
||||
/* ---------- Error checked file I/O ---------- */
|
||||
|
||||
void ffreopen(char* s, FILE* f)
|
||||
{
|
||||
if (freopen(s, "r", f) == NULL)
|
||||
fatal("can't reopen %s", s);
|
||||
}
|
||||
|
||||
FILE* ffcreat(char* s)
|
||||
{
|
||||
FILE* f;
|
||||
|
||||
if ((f = fopen(s, "w")) == NULL)
|
||||
fatal("can't create %s", s);
|
||||
return (f);
|
||||
}
|
||||
|
||||
#ifndef TMPDIR
|
||||
#define TMPDIR "/tmp"
|
||||
#endif
|
||||
char* tmp_dir = TMPDIR;
|
||||
|
||||
FILE* fftemp(char* path, char* tail)
|
||||
{
|
||||
char* dir;
|
||||
|
||||
if ((dir = getenv("TMPDIR")) == NULL)
|
||||
dir = tmp_dir;
|
||||
sprintf(path, "%s/%s", dir, tail);
|
||||
close(mkstemp(path));
|
||||
return (ffcreat(path));
|
||||
}
|
||||
|
||||
/* ---------- Error handling ---------- */
|
||||
|
||||
/* ARGSUSED */
|
||||
|
|
|
@ -73,7 +73,7 @@ char opdesc[] = {
|
|||
LLDEF, /* EX_REGVAR */
|
||||
};
|
||||
|
||||
string salloc(),strcpy(),strcat();
|
||||
string salloc();
|
||||
|
||||
string mycat(s1,s2) string s1,s2; {
|
||||
register string s;
|
||||
|
|
|
@ -31,7 +31,6 @@ File *C_ofp;
|
|||
#ifndef INCORE
|
||||
File *C_tfr;
|
||||
char *C_tmpfile;
|
||||
char *strcpy(), *strcat();
|
||||
char *C_ibuf = 0;
|
||||
long C_current_out;
|
||||
#endif
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
static char rcsidp5[] = "$Id$";
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include "parser.h"
|
||||
#include "Lpars.h"
|
||||
|
||||
|
@ -40,7 +41,6 @@ PRIVATE
|
|||
openofile(filename)
|
||||
char *filename;
|
||||
{
|
||||
char *strcpy(), *strcat();
|
||||
strcpy(ofilename,filename);
|
||||
strcpy(ofiletemp,filename);
|
||||
strcat(ofiletemp,".new");
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint8_t ram[0x10000];
|
||||
|
||||
|
|
|
@ -579,8 +579,6 @@ cpy(s,p,inserted) register string p; {
|
|||
return p;
|
||||
}
|
||||
|
||||
string strcpy();
|
||||
|
||||
LLmessage(d) {
|
||||
/*
|
||||
* d is either 0, in which case the current token has been deleted,
|
||||
|
|
|
@ -549,8 +549,6 @@ cpy(s,p,inserted) register string p; {
|
|||
return p;
|
||||
}
|
||||
|
||||
string strcpy();
|
||||
|
||||
LLmessage(d) {
|
||||
/*
|
||||
* d is either 0, in which case the current token has been deleted,
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#define NO 0
|
||||
#define MAYBE 2
|
||||
|
||||
#define EXTERN extern
|
||||
|
||||
#define SUFCHAR '.' /* Start of SUFFIX in file name */
|
||||
#define SPACE ' '
|
||||
#define TAB '\t'
|
||||
|
@ -55,43 +53,44 @@
|
|||
|
||||
#define NO_SCAN 0200 /* Bit set in character to defeat recogn. */
|
||||
|
||||
typedef struct {
|
||||
char *p_path; /* points to the full pathname */
|
||||
int p_keeps:1; /* The string should be thrown when unused */
|
||||
int p_keep:1; /* The file should be thrown away after use */
|
||||
} path ;
|
||||
typedef struct
|
||||
{
|
||||
char* p_path; /* points to the full pathname */
|
||||
int p_keeps : 1; /* The string should be thrown when unused */
|
||||
int p_keep : 1; /* The file should be thrown away after use */
|
||||
} path;
|
||||
|
||||
#define p_cont(elem) ((path *)l_content(elem))
|
||||
#define p_cont(elem) ((path*)l_content(elem))
|
||||
|
||||
/* Own routines */
|
||||
|
||||
/* rmach.c */
|
||||
void setlist(char *);
|
||||
extern void setlist(char*);
|
||||
|
||||
/* svars.c */
|
||||
void setsvar(char *, char *);
|
||||
void setpvar(char *, char *(*)(void));
|
||||
char *getvar(const char *);
|
||||
extern void setsvar(char*, char*);
|
||||
extern void setpvar(char*, char* (*)(void));
|
||||
extern char* getvar(const char*);
|
||||
|
||||
/* util.c */
|
||||
char *ack_basename(const char *);
|
||||
char *skipblank(char *);
|
||||
char *firstblank(char *);
|
||||
void fatal(const char *, ...);
|
||||
void vprint(const char *, ...);
|
||||
void fuerror(const char *, ...);
|
||||
void werror(const char *, ...);
|
||||
void quit(int);
|
||||
char *keeps(const char *);
|
||||
extern char* ack_basename(const char*);
|
||||
extern char* skipblank(char*);
|
||||
extern char* firstblank(char*);
|
||||
extern void fatal(const char*, ...);
|
||||
extern void vprint(const char*, ...);
|
||||
extern void fuerror(const char*, ...);
|
||||
extern void werror(const char*, ...);
|
||||
extern void quit(int);
|
||||
extern char* keeps(const char*);
|
||||
#define throws(str) free(str)
|
||||
void *getcore(size_t);
|
||||
void *changecore(void *, size_t);
|
||||
extern void* getcore(size_t);
|
||||
extern void* changecore(void*, size_t);
|
||||
#define freecore(area) free(area)
|
||||
|
||||
#define DEBUG 1 /* Allow debugging of Ack */
|
||||
|
||||
#ifndef DEBUG
|
||||
# define debug 0 /* To surprise all these 'if ( debug ) 's */
|
||||
#define debug 0 /* To surprise all these 'if ( debug ) 's */
|
||||
#else
|
||||
extern int debug ;
|
||||
extern int debug;
|
||||
#endif
|
||||
|
|
|
@ -5,16 +5,48 @@
|
|||
#include "ack.h"
|
||||
#include "list.h"
|
||||
#include "trans.h"
|
||||
|
||||
#ifndef NORCSID
|
||||
static char rcs_id[] = "$Id$" ;
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#define EXTERN
|
||||
|
||||
#include "data.h"
|
||||
|
||||
#ifndef NORCSID
|
||||
static char rcs_data[] = RCS_DATA ;
|
||||
char* stopsuffix = NULL; /* Suffix to stop at */
|
||||
char* machine = NULL; /* The machine id */
|
||||
char* callname = NULL; /* argv[0] */
|
||||
char* rts = NULL; /* The runtime-system */
|
||||
char* rtsuf = NULL; /* The runtime-system module suffix */
|
||||
char* Optlist = NULL; /* Which optimizers */
|
||||
|
||||
list_head arguments = {}; /* List of arguments */
|
||||
list_head flags = {}; /* List of flags */
|
||||
|
||||
list_head tr_list = {}; /* List of transformations */
|
||||
|
||||
list_head R_list = {}; /* List of -R flags */
|
||||
list_head head_list = {}; /* List of suffices for headers */
|
||||
list_head tail_list = {}; /* List of suffices for tails */
|
||||
|
||||
int k_flag = 0; /* Like -k of lint */
|
||||
int t_flag = 0; /* Preserve intermediate files */
|
||||
int v_flag = 0; /* Verbose */
|
||||
int w_flag = 0; /* Don't print warnings */
|
||||
int nill_flag = 0; /* Don't print file names */
|
||||
int Optlevel = 0; /* Optimizing */
|
||||
|
||||
#ifdef DEBUG
|
||||
int debug = 0; /* Debugging control */
|
||||
#endif
|
||||
|
||||
int n_error = 0; /* Number of errors encountered */
|
||||
|
||||
char* progname = NULL; /* The program call name */
|
||||
|
||||
char* outfile = NULL; /* The result file e.g. a.out */
|
||||
char template[20] = {}; /* The template for temporary file
|
||||
names */
|
||||
|
||||
trf* linker = NULL; /* Pointer to the Loader/Linker */
|
||||
trf* cpp_trafo = NULL; /* Pointer to C-preprocessor */
|
||||
|
||||
path in = {}; /* The current single input pathname */
|
||||
path out = {}; /* The current output pathname */
|
||||
path orig = {}; /* The original input path */
|
||||
char* p_basename = NULL; /* The current basename */
|
||||
const char* p_suffix = NULL; /* The current input suffix */
|
||||
|
|
|
@ -2,50 +2,52 @@
|
|||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#ifndef NORCSID
|
||||
#define RCS_DATA "$Id$"
|
||||
#endif
|
||||
|
||||
EXTERN char *stopsuffix; /* Suffix to stop at */
|
||||
EXTERN char *machine; /* The machine id */
|
||||
EXTERN char *callname; /* argv[0] */
|
||||
EXTERN char *rts; /* The runtime-system */
|
||||
EXTERN char *rtsuf; /* The runtime-system module suffix */
|
||||
EXTERN char *Optlist; /* Which optimizers */
|
||||
#ifndef DATA_H
|
||||
#define DATA_H
|
||||
|
||||
EXTERN list_head arguments; /* List of arguments */
|
||||
EXTERN list_head flags; /* List of flags */
|
||||
extern char* stopsuffix; /* Suffix to stop at */
|
||||
extern char* machine; /* The machine id */
|
||||
extern char* callname; /* argv[0] */
|
||||
extern char* rts; /* The runtime-system */
|
||||
extern char* rtsuf; /* The runtime-system module suffix */
|
||||
extern char* Optlist; /* Which optimizers */
|
||||
|
||||
EXTERN list_head tr_list; /* List of transformations */
|
||||
extern list_head arguments; /* List of arguments */
|
||||
extern list_head flags; /* List of flags */
|
||||
|
||||
EXTERN list_head R_list; /* List of -R flags */
|
||||
EXTERN list_head head_list; /* List of suffices for headers */
|
||||
EXTERN list_head tail_list; /* List of suffices for tails */
|
||||
extern list_head tr_list; /* List of transformations */
|
||||
|
||||
EXTERN int k_flag; /* Like -k of lint */
|
||||
EXTERN int t_flag; /* Preserve intermediate files */
|
||||
EXTERN int v_flag; /* Verbose */
|
||||
EXTERN int w_flag; /* Don't print warnings */
|
||||
EXTERN int nill_flag; /* Don't print file names */
|
||||
EXTERN int Optlevel; /* Optimizing */
|
||||
extern list_head R_list; /* List of -R flags */
|
||||
extern list_head head_list; /* List of suffices for headers */
|
||||
extern list_head tail_list; /* List of suffices for tails */
|
||||
|
||||
extern int k_flag; /* Like -k of lint */
|
||||
extern int t_flag; /* Preserve intermediate files */
|
||||
extern int v_flag; /* Verbose */
|
||||
extern int w_flag; /* Don't print warnings */
|
||||
extern int nill_flag; /* Don't print file names */
|
||||
extern int Optlevel; /* Optimizing */
|
||||
|
||||
#ifdef DEBUG
|
||||
EXTERN int debug; /* Debugging control */
|
||||
extern int debug; /* Debugging control */
|
||||
#endif
|
||||
|
||||
EXTERN int n_error; /* Number of errors encountered */
|
||||
extern int n_error; /* Number of errors encountered */
|
||||
|
||||
EXTERN char *progname; /* The program call name */
|
||||
extern char* progname; /* The program call name */
|
||||
|
||||
EXTERN char *outfile; /* The result file e.g. a.out */
|
||||
EXTERN char template[20]; /* The template for temporary file
|
||||
extern char* outfile; /* The result file e.g. a.out */
|
||||
extern char template[20]; /* The template for temporary file
|
||||
names */
|
||||
|
||||
EXTERN trf *linker; /* Pointer to the Loader/Linker */
|
||||
EXTERN trf *cpp_trafo; /* Pointer to C-preprocessor */
|
||||
extern trf* linker; /* Pointer to the Loader/Linker */
|
||||
extern trf* cpp_trafo; /* Pointer to C-preprocessor */
|
||||
|
||||
EXTERN path in; /* The current single input pathname */
|
||||
EXTERN path out; /* The current output pathname */
|
||||
EXTERN path orig; /* The original input path */
|
||||
EXTERN char *p_basename; /* The current basename */
|
||||
EXTERN const char *p_suffix; /* The current input suffix */
|
||||
extern path in; /* The current single input pathname */
|
||||
extern path out; /* The current output pathname */
|
||||
extern path orig; /* The original input path */
|
||||
extern char* p_basename; /* The current basename */
|
||||
extern const char* p_suffix; /* The current input suffix */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* machine dependent definitions */
|
||||
/* the following definitions are for the VAX */
|
||||
|
@ -269,17 +271,3 @@ extern short final_state;
|
|||
extern char *allocate();
|
||||
extern bucket *lookup();
|
||||
extern bucket *make_bucket();
|
||||
|
||||
|
||||
/* system variables */
|
||||
|
||||
extern int errno;
|
||||
|
||||
|
||||
/* system functions */
|
||||
|
||||
extern void free();
|
||||
extern char *calloc();
|
||||
extern char *malloc();
|
||||
extern char *realloc();
|
||||
extern char *strcpy();
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DEF_LENGTH 8
|
||||
|
||||
|
@ -184,8 +185,6 @@ char *
|
|||
Salloc(str)
|
||||
char *str;
|
||||
{
|
||||
char *strcpy();
|
||||
|
||||
if (str == 0)
|
||||
str = "";
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef DEF_LENGTH
|
||||
#define DEF_LENGTH 8
|
||||
|
@ -159,8 +160,6 @@ char *
|
|||
Salloc(str)
|
||||
char *str;
|
||||
{
|
||||
char *strcpy();
|
||||
|
||||
if (str == 0) {
|
||||
str = "";
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#incoude <string.h>
|
||||
|
||||
#define BSIZ 1024
|
||||
char *prog;
|
||||
|
@ -64,7 +65,6 @@ add_name(nm)
|
|||
char *nm;
|
||||
{
|
||||
struct namelist *nlp = nl, *lnlp = 0, *nnlp;
|
||||
char *strcpy();
|
||||
|
||||
while (nlp) {
|
||||
register i = strcmp(nm, nlp->name);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
extern char *ProgName;
|
||||
|
||||
|
@ -101,8 +102,6 @@ char *
|
|||
Salloc(str)
|
||||
char *str;
|
||||
{
|
||||
char *strcpy();
|
||||
|
||||
if (str == 0)
|
||||
str = "";
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
/* $Id$ */
|
||||
/* L E X I C A L A N A L Y Z E R */
|
||||
|
||||
#include <string.h>
|
||||
#include "idfsize.h"
|
||||
#include "numsize.h"
|
||||
#include "strsize.h"
|
||||
|
@ -26,7 +27,6 @@ int AccDefined = 0; /* accept "defined(...)" */
|
|||
int UnknownIdIsZero = 0; /* interpret unknown id as integer 0 */
|
||||
|
||||
char *string_token();
|
||||
char *strcpy();
|
||||
|
||||
PushLex()
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
/* PREPROCESSOR: INITIALIZATION ROUTINES */
|
||||
|
||||
#include <string.h>
|
||||
#include <system.h>
|
||||
#include <alloc.h>
|
||||
#include "class.h"
|
||||
|
@ -30,8 +31,6 @@ PRIVATE struct mkey {
|
|||
{0, K_UNKNOWN}
|
||||
};
|
||||
|
||||
char *strcpy();
|
||||
|
||||
EXPORT
|
||||
init_pp()
|
||||
{
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "class.h"
|
||||
#include "interface.h"
|
||||
|
||||
char *strcpy(), *strcat();
|
||||
char *long2str();
|
||||
extern int InputLevel;
|
||||
|
||||
|
|
|
@ -5,22 +5,23 @@
|
|||
*/
|
||||
/* M A P . C */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "types.h"
|
||||
#include "map.h"
|
||||
|
||||
short plength;
|
||||
short olength;
|
||||
short llength;
|
||||
short blength;
|
||||
short lplength;
|
||||
line_p *lmap;
|
||||
bblock_p *lbmap;
|
||||
proc_p *pmap ; /* dynamically allocated array that maps
|
||||
short plength = 0;
|
||||
short olength = 0;
|
||||
short llength = 0;
|
||||
short blength = 0;
|
||||
short lplength = 0;
|
||||
line_p* lmap = NULL;
|
||||
bblock_p* lbmap = NULL;
|
||||
proc_p* pmap = NULL; /* dynamically allocated array that maps
|
||||
* every proc_id to a proc_p.
|
||||
*/
|
||||
obj_p *omap; /* maps obj_id to obj_p */
|
||||
loop_p *lpmap; /* maps loop_id to loop_p */
|
||||
bblock_p *bmap; /* maps block_id to bblock_p */
|
||||
obj_p* omap = NULL; /* maps obj_id to obj_p */
|
||||
loop_p* lpmap = NULL; /* maps loop_id to loop_p */
|
||||
bblock_p* bmap = NULL; /* maps block_id to bblock_p */
|
||||
|
||||
dblock_p fdblock; /* first dblock */
|
||||
proc_p fproc; /* first proc */
|
||||
dblock_p fdblock = NULL; /* first dblock */
|
||||
proc_p fproc = NULL; /* first proc */
|
||||
|
|
|
@ -10,61 +10,61 @@
|
|||
|
||||
/******** EM Machine capacity parameters ********/
|
||||
|
||||
size wsize;
|
||||
size dwsize;
|
||||
size psize;
|
||||
long i_minsw;
|
||||
long i_maxsw;
|
||||
unsigned long i_maxuw;
|
||||
long min_off;
|
||||
long max_off;
|
||||
ptr max_addr;
|
||||
size wsizem1;
|
||||
size wsize = 0;
|
||||
size dwsize = 0;
|
||||
size psize = 0;
|
||||
long i_minsw = 0;
|
||||
long i_maxsw = 0;
|
||||
unsigned long i_maxuw = 0;
|
||||
long min_off = 0;
|
||||
long max_off = 0;
|
||||
ptr max_addr = 0;
|
||||
size wsizem1 = 0;
|
||||
|
||||
|
||||
/******** EM program parameters ********/
|
||||
|
||||
ptr ML;
|
||||
ptr HB;
|
||||
ptr DB;
|
||||
long NProc;
|
||||
long PreIgnMask;
|
||||
ptr ML = 0;
|
||||
ptr HB = 0;
|
||||
ptr DB = 0;
|
||||
long NProc = 0;
|
||||
long PreIgnMask = 0;
|
||||
|
||||
|
||||
/******** EM machine registers ********/
|
||||
|
||||
|
||||
long PI;
|
||||
ptr PC;
|
||||
long PI = 0;
|
||||
ptr PC = 0;
|
||||
|
||||
ptr HP;
|
||||
ptr SP;
|
||||
ptr LB;
|
||||
ptr AB;
|
||||
ptr HP = 0;
|
||||
ptr SP = 0;
|
||||
ptr LB = 0;
|
||||
ptr AB = 0;
|
||||
|
||||
long ES;
|
||||
int ES_def;
|
||||
long ES = 0;
|
||||
int ES_def = 0;
|
||||
|
||||
int OnTrap;
|
||||
long IgnMask;
|
||||
long TrapPI;
|
||||
int OnTrap = 0;
|
||||
long IgnMask = 0;
|
||||
long TrapPI = 0;
|
||||
|
||||
char *FRA;
|
||||
size FRALimit;
|
||||
size FRASize;
|
||||
int FRA_def;
|
||||
char *FRA = NULL;
|
||||
size FRALimit = 0;
|
||||
size FRASize = 0;
|
||||
int FRA_def = 0;
|
||||
|
||||
|
||||
/******** The EM Machine Memory ********/
|
||||
|
||||
char *text;
|
||||
char *text = NULL;
|
||||
|
||||
char *data;
|
||||
ptr HL;
|
||||
char *data = NULL;
|
||||
ptr HL = 0;
|
||||
|
||||
char *stack;
|
||||
char *stackML;
|
||||
ptr SL;
|
||||
char *stack = NULL;
|
||||
char *stackML = NULL;
|
||||
ptr SL = 0;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
|
@ -17,9 +18,6 @@
|
|||
|
||||
#ifdef LOGGING
|
||||
|
||||
extern int strlen();
|
||||
extern char *strcpy();
|
||||
|
||||
extern long mess_id; /* from io.c */
|
||||
extern FILE *fcreat_high(); /* from io.c */
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#include <em_abs.h>
|
||||
|
@ -20,10 +22,6 @@
|
|||
#include "opcode.h"
|
||||
#include "rsb.h"
|
||||
|
||||
extern int atoi();
|
||||
extern long atol();
|
||||
extern char *strcpy();
|
||||
|
||||
char mess_file[64] = "int.mess"; /* name of message file */
|
||||
|
||||
jmp_buf trapbuf;
|
||||
|
|
Loading…
Reference in a new issue