1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-04 07:43:02 +00:00

Work around a bug with negative literals in the C compiler.

If an octal literal has the sign bit set, the resulting code will try
to use MOVNI to write the value to the destination.
This commit is contained in:
Lars Brinkhoff
2021-09-15 14:26:33 +02:00
parent f5e288805f
commit c288505517
2 changed files with 11 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ static int encrypt;
static int verbose;
static int user;
static int loser;
static int dsk_device DSK;
/**********************************************************************
@@ -36,7 +37,7 @@ main (argc, argv) char *argv[];
user = rsuset (UXUNAME);
loser = rsuset (UOPTION) & 10000000000;
fparse (argv[0], &pakfil);
pakfil.dev = DSK;
pakfil.dev = dsk_device;
if (pakfil.fn2 == 0) pakfil.fn2 = csto6 ("-IPAK-");
if (argc < 2) s = "l";
else s = argv[1];
@@ -396,7 +397,7 @@ updatfile (dp, in, out, delflg) desc *dp;
int xopen (fp, mode) filespec *fp; int mode;
{if (fp->dev == 0) fp->dev = DSK;
{if (fp->dev == 0) fp->dev = dsk_device;
if (fp->dir == 0) fp->dir = rsname();
return (open (fp, mode));
}

View File

@@ -86,6 +86,8 @@ int argc; /* # of arguments to built-in commands */
char *argv[max_args]; /* parsed args to built-in commands */
tag restart; /* restart loc for ^G interrupt */
static int ts_file _TS_;
static int dsk_device _DSK_;
static int default_device _DSK_;
struct _command {
@@ -310,7 +312,7 @@ more: while (incnt>0)
filespec fs;
char buf[100];
uname = rsuset (UXUNAME);
fs.dev = _DSK_;
fs.dev = dsk_device;
fs.dir = csto6 ("(INIT)");
fs.fn1 = uname;
fs.fn2 = csto6 ("SHELL_");
@@ -857,7 +859,7 @@ int _login ()
else
{int ch;
filespec ff;
ff.dev = _DSK_;
ff.dev = dsk_device;
ff.dir = oldname;
ff.fn1 = _FILE_;
ff.fn2 = _PDIRP_;
@@ -1356,7 +1358,7 @@ int findprog (fp)
if (fp->fn1 == _GREATER_ || fp->fn1 == _LESS_) return (-1000);
fp->fn2 = fp->fn1;
fp->fn1 = _TS_;
fp->fn1 = ts_file;
if (!fp->dev) fp->dev = default_device;
if (fp->dir) return (tryprog (fp));
@@ -1379,7 +1381,7 @@ int tryprog (fp)
{int oldn2, fd;
fp->fn1 = _TS_;
fp->fn1 = ts_file;
if ((fd = open (fp, BII)) >= 0)
return (j_cload (fd, fp->fn2));
fp->fn1 = _ZZ_;
@@ -1387,7 +1389,7 @@ int tryprog (fp)
fp->fn2 = rj6 (fp->fn2);
if ((fd = open (fp, BII)) >= 0)
return (j_cload (fd, oldn2));
fp->fn1 = _TS_;
fp->fn1 = ts_file;
fp->fn2 = oldn2;
return (-1000);
}
@@ -1574,7 +1576,7 @@ doinit ()
filespec fs;
char buf[100];
uname = rsuset (UXUNAME);
fs.dev = _DSK_;
fs.dev = dsk_device;
fs.dir = csto6 ("(INIT)");
fs.fn1 = uname;
fs.fn2 = csto6 ("_SHELL");