commit ec9f99ab985b1212424fa125ece5d6724ed7193a
parent 3380db547599afc1fdcee187bf82e14ac4aefeba
Author: Commit-Bot <unknown>
Date: Wed, 19 May 2010 19:01:19 +0000
Automatic commit from picoLisp.tgz, From: Wed, 19 May 2010 16:01:19 GMT
Diffstat:
27 files changed, 413 insertions(+), 363 deletions(-)
diff --git a/doc/refH.html b/doc/refH.html
@@ -13,11 +13,8 @@
<dt><a name="*Hup"><code>*Hup</code></a>
<dd>Global variable holding a (possibly empty) <code>prg</code> body, which will
-be executed when a SIGHUP signal is sent to the current process. Note that this
-mechanism is "unreliable", in the way that when a second signal (it may be
-SIGINT, SIGUSR1/2, SIGALRM or SIGTERM) arrives before the first signal's
-<code>prg</code> is running, the first signal will be lost. See also <code><a
-href="refA.html#alarm">alarm</a></code>, <code><a
+be executed when a SIGHUP signal is sent to the current process. See also
+<code><a href="refA.html#alarm">alarm</a></code>, <code><a
href="refR.html#*Run">*Run</a></code>, <code><a
href="refS.html#*Sig1">*Sig[12]</a></code> and <code><a
href="refE.html#*Err">*Err</a></code>.
diff --git a/doc/refS.html b/doc/refS.html
@@ -29,10 +29,7 @@ href="refS.html#scl">scl</a></code>.
<dt><a name="*Sig2"><code>*Sig2</code></a>
<dd>Global variables holding (possibly empty) <code>prg</code> bodies, which
will be executed when a SIGUSR1 signal (or a SIGUSR2 signal, respectively) is
-sent to the current process. Note that this mechanism is "unreliable", in the
-way that when a second signal (it may be SIGHUP, SIGINT, another SIGUSR1/2,
-SIGALRM or SIGTERM) arrives before the first signal's <code>prg</code> is
-running, the first signal will be lost. See also <code><a
+sent to the current process. See also <code><a
href="refA.html#alarm">alarm</a></code>, <code><a
href="refR.html#*Run">*Run</a></code>, <code><a
href="refH.html#*Hup">*Hup</a></code> and <code><a
diff --git a/doc64/asm b/doc64/asm
@@ -1,4 +1,4 @@
-# 11may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
@@ -101,6 +101,8 @@
sub dst src # Subtract 'src' from 'dst'
subc dst src # Subtract 'src' from 'dst' with Carry
+ inc dst # Increment byte 'dst' [z..]
+ dec dst # Increment byte 'dst' [z..]
not dst # One's complement negation of 'dst'
neg dst # Two's complement negation of 'dst'
diff --git a/lib/tags b/lib/tags
@@ -25,16 +25,16 @@ $ (2662 . "@src64/flow.l")
>> (2306 . "@src64/big.l")
abs (2396 . "@src64/big.l")
accept (139 . "@src64/net.l")
-adr (511 . "@src64/main.l")
-alarm (455 . "@src64/main.l")
+adr (531 . "@src64/main.l")
+alarm (475 . "@src64/main.l")
all (772 . "@src64/sym.l")
and (1637 . "@src64/flow.l")
any (3758 . "@src64/io.l")
append (1329 . "@src64/subr.l")
apply (581 . "@src64/apply.l")
-arg (1879 . "@src64/main.l")
-args (1855 . "@src64/main.l")
-argv (2500 . "@src64/main.l")
+arg (1899 . "@src64/main.l")
+args (1875 . "@src64/main.l")
+argv (2520 . "@src64/main.l")
as (146 . "@src64/flow.l")
asoq (2938 . "@src64/subr.l")
assoc (2903 . "@src64/subr.l")
@@ -65,7 +65,7 @@ call (2793 . "@src64/flow.l")
car (5 . "@src64/subr.l")
case (1978 . "@src64/flow.l")
catch (2478 . "@src64/flow.l")
-cd (2255 . "@src64/main.l")
+cd (2275 . "@src64/main.l")
cdaaar (464 . "@src64/subr.l")
cdaadr (487 . "@src64/subr.l")
cdaar (179 . "@src64/subr.l")
@@ -87,7 +87,7 @@ chop (1093 . "@src64/sym.l")
circ (816 . "@src64/subr.l")
clip (1784 . "@src64/subr.l")
close (4146 . "@src64/io.l")
-cmd (2482 . "@src64/main.l")
+cmd (2502 . "@src64/main.l")
cnt (1279 . "@src64/apply.l")
commit (1503 . "@src64/db.l")
con (725 . "@src64/subr.l")
@@ -97,9 +97,9 @@ connect (201 . "@src64/net.l")
cons (747 . "@src64/subr.l")
copy (1216 . "@src64/subr.l")
ctl (4086 . "@src64/io.l")
-ctty (2280 . "@src64/main.l")
+ctty (2300 . "@src64/main.l")
cut (1795 . "@src64/sym.l")
-date (1994 . "@src64/main.l")
+date (2014 . "@src64/main.l")
dbck (2092 . "@src64/db.l")
de (551 . "@src64/flow.l")
dec (2004 . "@src64/big.l")
@@ -109,15 +109,15 @@ del (1850 . "@src64/sym.l")
delete (1392 . "@src64/subr.l")
delq (1443 . "@src64/subr.l")
diff (2561 . "@src64/subr.l")
-dir (2413 . "@src64/main.l")
+dir (2433 . "@src64/main.l")
dm (563 . "@src64/flow.l")
do (2152 . "@src64/flow.l")
e (2623 . "@src64/flow.l")
echo (4166 . "@src64/io.l")
-env (523 . "@src64/main.l")
+env (543 . "@src64/main.l")
eof (3317 . "@src64/io.l")
eol (3308 . "@src64/io.l")
-errno (1206 . "@src64/main.l")
+errno (1226 . "@src64/main.l")
eval (208 . "@src64/flow.l")
ext (4853 . "@src64/io.l")
ext? (1034 . "@src64/sym.l")
@@ -125,7 +125,7 @@ extern (900 . "@src64/sym.l")
extra (1280 . "@src64/flow.l")
extract (1084 . "@src64/apply.l")
fifo (1961 . "@src64/sym.l")
-file (2360 . "@src64/main.l")
+file (2380 . "@src64/main.l")
fill (3165 . "@src64/subr.l")
filter (1027 . "@src64/apply.l")
fin (2018 . "@src64/subr.l")
@@ -143,7 +143,7 @@ free (2034 . "@src64/db.l")
from (3336 . "@src64/io.l")
full (1066 . "@src64/subr.l")
fun? (734 . "@src64/sym.l")
-gc (378 . "@src64/gc.l")
+gc (380 . "@src64/gc.l")
ge0 (2372 . "@src64/big.l")
get (2748 . "@src64/sym.l")
getd (742 . "@src64/sym.l")
@@ -151,7 +151,7 @@ getl (3030 . "@src64/sym.l")
glue (1232 . "@src64/sym.l")
gt0 (2383 . "@src64/big.l")
head (1805 . "@src64/subr.l")
-heap (481 . "@src64/main.l")
+heap (501 . "@src64/main.l")
hear (3058 . "@src64/io.l")
host (184 . "@src64/net.l")
id (1034 . "@src64/db.l")
@@ -162,7 +162,7 @@ ifn (1878 . "@src64/flow.l")
in (3982 . "@src64/io.l")
inc (1937 . "@src64/big.l")
index (2609 . "@src64/subr.l")
-info (2317 . "@src64/main.l")
+info (2337 . "@src64/main.l")
intern (875 . "@src64/sym.l")
ipid (2905 . "@src64/flow.l")
isa (976 . "@src64/flow.l")
@@ -216,10 +216,10 @@ n== (2072 . "@src64/subr.l")
nT (2183 . "@src64/subr.l")
name (499 . "@src64/sym.l")
nand (1672 . "@src64/flow.l")
-native (1214 . "@src64/main.l")
+native (1234 . "@src64/main.l")
need (918 . "@src64/subr.l")
new (850 . "@src64/flow.l")
-next (1862 . "@src64/main.l")
+next (1882 . "@src64/main.l")
nil (1755 . "@src64/flow.l")
nond (1955 . "@src64/flow.l")
nor (1693 . "@src64/flow.l")
@@ -233,7 +233,7 @@ onOff (1611 . "@src64/sym.l")
one (1644 . "@src64/sym.l")
open (4108 . "@src64/io.l")
opid (2921 . "@src64/flow.l")
-opt (2603 . "@src64/main.l")
+opt (2623 . "@src64/main.l")
or (1653 . "@src64/flow.l")
out (4002 . "@src64/io.l")
pack (1144 . "@src64/sym.l")
@@ -260,24 +260,24 @@ prog (1773 . "@src64/flow.l")
prog1 (1781 . "@src64/flow.l")
prog2 (1798 . "@src64/flow.l")
prop (2779 . "@src64/sym.l")
-protect (471 . "@src64/main.l")
+protect (491 . "@src64/main.l")
prove (3412 . "@src64/subr.l")
push (1686 . "@src64/sym.l")
push1 (1722 . "@src64/sym.l")
put (2696 . "@src64/sym.l")
putl (2948 . "@src64/sym.l")
-pwd (2244 . "@src64/main.l")
+pwd (2264 . "@src64/main.l")
queue (1918 . "@src64/sym.l")
-quit (927 . "@src64/main.l")
+quit (947 . "@src64/main.l")
quote (141 . "@src64/flow.l")
rand (2640 . "@src64/big.l")
range (988 . "@src64/subr.l")
rank (2966 . "@src64/subr.l")
-raw (433 . "@src64/main.l")
+raw (453 . "@src64/main.l")
rd (4870 . "@src64/io.l")
read (2498 . "@src64/io.l")
replace (1490 . "@src64/subr.l")
-rest (1908 . "@src64/main.l")
+rest (1928 . "@src64/main.l")
reverse (1665 . "@src64/subr.l")
rewind (4836 . "@src64/io.l")
rollback (1885 . "@src64/db.l")
@@ -316,7 +316,7 @@ text (1270 . "@src64/sym.l")
throw (2504 . "@src64/flow.l")
tick (2873 . "@src64/flow.l")
till (3403 . "@src64/io.l")
-time (2127 . "@src64/main.l")
+time (2147 . "@src64/main.l")
touch (1049 . "@src64/sym.l")
trim (1746 . "@src64/subr.l")
try (1187 . "@src64/flow.l")
@@ -325,13 +325,13 @@ udp (268 . "@src64/net.l")
unify (3810 . "@src64/subr.l")
unless (1914 . "@src64/flow.l")
until (2098 . "@src64/flow.l")
-up (610 . "@src64/main.l")
+up (630 . "@src64/main.l")
upp? (3228 . "@src64/sym.l")
uppc (3292 . "@src64/sym.l")
use (1586 . "@src64/flow.l")
-usec (2232 . "@src64/main.l")
+usec (2252 . "@src64/main.l")
val (1461 . "@src64/sym.l")
-version (2617 . "@src64/main.l")
+version (2637 . "@src64/main.l")
wait (2982 . "@src64/io.l")
when (1897 . "@src64/flow.l")
while (2074 . "@src64/flow.l")
diff --git a/src/flow.c b/src/flow.c
@@ -1,4 +1,4 @@
-/* 19apr10abu
+/* 19may10abu
* (c) Software Lab. Alexander Burger
*/
@@ -1548,7 +1548,7 @@ any doCall(any ex) {
while (waitpid(pid, &res, WUNTRACED) < 0) {
if (errno != EINTR)
err(ex, NULL, "wait pid");
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
tcsetpgrp(0,getpgrp());
diff --git a/src/gc.c b/src/gc.c
@@ -1,4 +1,4 @@
-/* 04may09abu
+/* 19may10abu
* (c) Software Lab. Alexander Burger
*/
@@ -32,7 +32,7 @@ static void gc(long c) {
} while (h = h->next);
/* Mark */
mark(Nil+1);
- mark(Alarm), mark(Line), mark(Zero), mark(One);
+ mark(Alarm), mark(Sigio), mark(Line), mark(Zero), mark(One);
for (i = 0; i < IHASH; ++i)
mark(Intern[i]), mark(Transient[i]);
mark(ApplyArgs), mark(ApplyBody);
diff --git a/src/io.c b/src/io.c
@@ -1,4 +1,4 @@
-/* 12may10abu
+/* 19may10abu
* (c) Software Lab. Alexander Burger
*/
@@ -127,7 +127,7 @@ int slow(inFile *p, bool nb) {
return -1;
if (errno != EINTR)
return 0;
- if (Signal)
+ if (*Signal)
sighandler(NULL);
}
}
@@ -149,7 +149,7 @@ int rdBytes(int fd, byte *p, int cnt, bool nb) {
while ((n = read(fd, p, cnt)) <= 0) {
if (!n || errno != EINTR)
return 0;
- if (Signal)
+ if (*Signal)
sighandler(NULL);
}
}
@@ -160,7 +160,7 @@ int rdBytes(int fd, byte *p, int cnt, bool nb) {
return -1;
if (errno != EINTR)
return 0;
- if (Signal)
+ if (*Signal)
sighandler(NULL);
}
}
@@ -175,7 +175,7 @@ bool wrBytes(int fd, byte *p, int cnt) {
return NO;
else if (errno != EINTR)
writeErr("bytes");
- if (Signal)
+ if (*Signal)
sighandler(NULL);
} while (cnt);
return YES;
@@ -634,7 +634,7 @@ void rdOpen(any ex, any x, inFrame *f) {
while ((f->fd = open(nm+1, O_APPEND|O_CREAT|O_RDWR, 0666)) < 0) {
if (errno != EINTR)
openErr(ex, nm);
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
initInFile(f->fd, strdup(nm+1));
@@ -643,7 +643,7 @@ void rdOpen(any ex, any x, inFrame *f) {
while ((f->fd = open(nm, O_RDONLY)) < 0) {
if (errno != EINTR)
openErr(ex, nm);
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
initInFile(f->fd, strdup(nm));
@@ -712,7 +712,7 @@ void wrOpen(any ex, any x, outFrame *f) {
while ((f->fd = open(nm+1, O_APPEND|O_CREAT|O_WRONLY, 0666)) < 0) {
if (errno != EINTR)
openErr(ex, nm);
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
}
@@ -720,7 +720,7 @@ void wrOpen(any ex, any x, outFrame *f) {
while ((f->fd = open(nm, O_CREAT|O_TRUNC|O_WRONLY, 0666)) < 0) {
if (errno != EINTR)
openErr(ex, nm);
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
}
@@ -776,7 +776,7 @@ void ctOpen(any ex, any x, ctlFrame *f) {
while ((f->fd = open(nm+1, O_CREAT|O_RDWR, 0666)) < 0) {
if (errno != EINTR)
openErr(ex, nm);
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
lockFile(f->fd, F_SETLKW, F_RDLCK);
@@ -785,7 +785,7 @@ void ctOpen(any ex, any x, ctlFrame *f) {
while ((f->fd = open(nm, O_CREAT|O_RDWR, 0666)) < 0) {
if (errno != EINTR)
openErr(ex, nm);
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
lockFile(f->fd, F_SETLKW, F_WRLCK);
@@ -856,7 +856,7 @@ void popInFiles(void) {
while (waitpid(Env.inFrames->pid, NULL, 0) < 0) {
if (errno != EINTR)
closeErr();
- if (Signal)
+ if (*Signal)
sighandler(NULL);
}
}
@@ -876,7 +876,7 @@ void popOutFiles(void) {
while (waitpid(Env.outFrames->pid, NULL, 0) < 0) {
if (errno != EINTR)
closeErr();
- if (Signal)
+ if (*Signal)
sighandler(NULL);
}
}
@@ -1361,7 +1361,7 @@ long waitFd(any ex, int fd, long ms) {
val(Run) = Nil;
selectErr(ex);
}
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
if (tp) {
@@ -1446,7 +1446,7 @@ long waitFd(any ex, int fd, long ms) {
}
}
}
- if (Signal)
+ if (*Signal)
sighandler(ex);
} while (ms && fd >= 0 && !isSet(fd, &rdSet));
Env.task = taskSave;
@@ -1482,7 +1482,7 @@ any doSync(any ex) {
p += n, cnt -= n;
else if (errno != EINTR)
writeErr("sync");
- if (Signal)
+ if (*Signal)
sighandler(ex);
} while (cnt);
Sync = NO;
@@ -2056,7 +2056,7 @@ any doOpen(any ex) {
while ((fd = open(nm, O_CREAT|O_RDWR, 0666)) < 0) {
if (errno != EINTR)
return Nil;
- if (Signal)
+ if (*Signal)
sighandler(ex);
}
closeOnExec(ex, fd);
@@ -2225,7 +2225,7 @@ void print(any x) {
}
void print1(any x) {
- if (Signal)
+ if (*Signal)
sighandler(NULL);
if (isNum(x))
outNum(x);
@@ -2304,7 +2304,7 @@ void prin(any x) {
}
void prin1(any x) {
- if (Signal)
+ if (*Signal)
sighandler(NULL);
if (!isNil(x)) {
if (isNum(x))
diff --git a/src/main.c b/src/main.c
@@ -1,11 +1,11 @@
-/* 26apr10abu
+/* 19may10abu
* (c) Software Lab. Alexander Burger
*/
#include "pico.h"
/* Globals */
-int Signal, Repl, Chr, Slot, Spkr, Mic, Hear, Tell, Children, ExtN;
+int Repl, Chr, Slot, Spkr, Mic, Hear, Tell, Children, ExtN;
char **AV, *AV0, *Home;
child *Child;
heap *Heaps;
@@ -19,11 +19,13 @@ outFile *OutFile, **OutFiles;
int (*getBin)(void);
void (*putBin)(int);
any TheKey, TheCls, Thrown;
-any Alarm, Line, Zero, One, Intern[IHASH], Transient[IHASH], Extern[EHASH];
+any Alarm, Sigio, Line, Zero, One;
+any Intern[IHASH], Transient[IHASH], Extern[EHASH];
any ApplyArgs, ApplyBody, DbVal, DbTail;
any Nil, DB, Meth, Quote, T;
any Solo, PPid, Pid, At, At2, At3, This, Dbg, Zap, Ext, Scl, Class;
any Run, Hup, Sig1, Sig2, Up, Err, Msg, Uni, Led, Tsm, Adr, Fork, Bye;
+sig_atomic_t Signal[SIGIO+1];
static int TtyPid;
static word2 USec;
@@ -79,32 +81,41 @@ void sighandler(any ex) {
if (!Env.protect) {
Env.protect = 1;
- switch (Signal) {
- case SIGHUP:
- Signal = 0, run(val(Hup));
- break;
- case SIGINT:
- Signal = 0;
- if (Repl < 2)
- brkLoad(ex ?: Nil);
- break;
- case SIGUSR1:
- Signal = 0, run(val(Sig1));
- break;
- case SIGUSR2:
- Signal = 0, run(val(Sig2));
- break;
- case SIGALRM:
- Signal = 0, run(Alarm);
- break;
- case SIGTERM:
- for (flg = NO, i = 0; i < Children; ++i)
- if (Child[i].pid && kill(Child[i].pid, SIGTERM) == 0)
- flg = YES;
- if (!flg)
- Signal = 0, bye(0);
- break;
- }
+ do {
+ if (Signal[SIGIO]) {
+ --Signal[0], --Signal[SIGIO];
+ /* ... */
+ }
+ else if (Signal[SIGUSR1]) {
+ --Signal[0], --Signal[SIGUSR1];
+ run(val(Sig1));
+ }
+ else if (Signal[SIGUSR2]) {
+ --Signal[0], --Signal[SIGUSR2];
+ run(val(Sig2));
+ }
+ else if (Signal[SIGALRM]) {
+ --Signal[0], --Signal[SIGALRM];
+ run(Alarm);
+ }
+ else if (Signal[SIGINT]) {
+ --Signal[0], --Signal[SIGINT];
+ if (Repl < 2)
+ brkLoad(ex ?: Nil);
+ }
+ else if (Signal[SIGHUP]) {
+ --Signal[0], --Signal[SIGHUP];
+ run(val(Hup));
+ }
+ else if (Signal[SIGTERM]) {
+ for (flg = NO, i = 0; i < Children; ++i)
+ if (Child[i].pid && kill(Child[i].pid, SIGTERM) == 0)
+ flg = YES;
+ if (flg)
+ break;
+ Signal[0] = 0, bye(0);
+ }
+ } while (*Signal);
Env.protect = 0;
}
}
@@ -113,14 +124,14 @@ static void sig(int n) {
if (TtyPid)
kill(TtyPid, n);
else
- Signal = n;
+ ++Signal[n], ++Signal[0];
}
static void sigTerm(int n) {
if (TtyPid)
kill(TtyPid, n);
else
- Signal = SIGTERM;
+ ++Signal[SIGTERM], ++Signal[0];
}
static void sigChld(int n __attribute__((unused))) {
@@ -700,7 +711,7 @@ static any evList2(any foo, any ex) {
for (;;) {
if (isNil(val(foo)))
undefined(foo,ex);
- if (Signal)
+ if (*Signal)
sighandler(ex);
if (isNum(foo = val(foo))) {
foo = evSubr(foo,ex);
@@ -722,7 +733,7 @@ any evList(any ex) {
if (!isSym(foo = car(ex))) {
if (isNum(foo))
return ex;
- if (Signal)
+ if (*Signal)
sighandler(ex);
if (isNum(foo = evList(foo)))
return evSubr(foo,ex);
@@ -731,7 +742,7 @@ any evList(any ex) {
for (;;) {
if (isNil(val(foo)))
undefined(foo,ex);
- if (Signal)
+ if (*Signal)
sighandler(ex);
if (isNum(foo = val(foo)))
return evSubr(foo,ex);
@@ -1117,7 +1128,7 @@ static void init(int ac, char *av[]) {
Env.put = putStdout;
initOutFile(STDERR_FILENO);
OutFile = initOutFile(STDOUT_FILENO);
- Env.task = Alarm = Line = Nil;
+ Env.task = Alarm = Sigio = Line = Nil;
setrlimit(RLIMIT_STACK, &ULim);
Tio = tcgetattr(STDIN_FILENO, &OrgTermio) == 0;
ApplyArgs = cons(cons(consSym(Nil,Nil), Nil), Nil);
@@ -1130,6 +1141,7 @@ static void init(int ac, char *av[]) {
iSignal(SIGUSR2, sig);
iSignal(SIGALRM, sig);
iSignal(SIGTERM, sig);
+ iSignal(SIGIO, sig);
signal(SIGCHLD, sigChld);
signal(SIGPIPE, SIG_IGN);
signal(SIGTTIN, SIG_IGN);
diff --git a/src/pico.h b/src/pico.h
@@ -1,4 +1,4 @@
-/* 26apr10abu
+/* 19may10abu
* (c) Software Lab. Alexander Burger
*/
@@ -236,7 +236,7 @@ typedef struct catchFrame {
#define Touch(ex,x) if (isExt(x)) db(ex,x,2)
/* Globals */
-extern int Signal, Repl, Chr, Slot, Spkr, Mic, Hear, Tell, Children, ExtN;
+extern int Repl, Chr, Slot, Spkr, Mic, Hear, Tell, Children, ExtN;
extern char **AV, *AV0, *Home;
extern child *Child;
extern heap *Heaps;
@@ -250,11 +250,13 @@ extern outFile *OutFile, **OutFiles;
extern int (*getBin)(void);
extern void (*putBin)(int);
extern any TheKey, TheCls, Thrown;
-extern any Alarm, Line, Zero, One, Intern[IHASH], Transient[IHASH], Extern[EHASH];
+extern any Alarm, Sigio, Line, Zero, One;
+extern any Intern[IHASH], Transient[IHASH], Extern[EHASH];
extern any ApplyArgs, ApplyBody, DbVal, DbTail;
extern any Nil, DB, Meth, Quote, T;
extern any Solo, PPid, Pid, At, At2, At3, This, Dbg, Zap, Ext, Scl, Class;
extern any Run, Hup, Sig1, Sig2, Up, Err, Msg, Uni, Led, Tsm, Adr, Fork, Bye;
+extern sig_atomic_t Signal[SIGIO+1]; // SIGIO is highest used signal number
/* Prototypes */
void *alloc(void*,size_t);
diff --git a/src64/arch/x86-64.l b/src64/arch/x86-64.l
@@ -1,4 +1,4 @@
-# 11may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# Byte order
@@ -319,6 +319,16 @@
(prinst "sbb" Src (car Dst))
(prinst "sbb" "%r12" (cdr Dst)) ) )
+(asm inc (Dst D)
+ (if (pre? "%" (setq Dst (dst Dst D)))
+ (prinst "inc" Dst)
+ (prinst "incq" Dst) ) )
+
+(asm dec (Dst D)
+ (if (pre? "%" (setq Dst (dst Dst D)))
+ (prinst "dec" Dst)
+ (prinst "decq" Dst) ) )
+
(asm not (Dst D)
(if (pre? "%" (setq Dst (dst Dst D)))
(prinst "not" Dst)
diff --git a/src64/big.l b/src64/big.l
@@ -1,4 +1,4 @@
-# 10may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
### Destructive primitives ###
@@ -1082,7 +1082,7 @@
shr A 4 # Normalize
end
do
- add C 1 # Increment counter
+ inc C # Increment counter
shr A 1 # More bits?
until z # No
# Subtract divisor's bit count
@@ -1090,7 +1090,7 @@
if nz # Yes
shr E 4 # Normalize
do
- sub C 1 # Decrement counter
+ dec C # Decrement counter
shr E 1 # More bits?
until z # No
else
@@ -1109,12 +1109,12 @@
shr E 4 # Normalize
end
do
- sub C 1 # Decrement counter
+ dec C # Decrement counter
shr E 1 # More bits?
until z # No
end
push C # <L -I> Shift offsets
- add C 1
+ inc C
push C # <L -II>
sub (L -I) 1 # Any shift?
if ns # Yes
@@ -1158,7 +1158,7 @@
add B (hex "10") # Increment short
ld (L III) A
else
- add (A DIG) 1 # Increment digit
+ inc (A DIG) # Increment digit
end
end
ld A (L I) # Divisor
@@ -1446,7 +1446,7 @@
pop C
test (L -III) 1 # Fraction?
if nz # Yes
- sub (L -I) 1 # Decrement Scale
+ dec (L -I) # Decrement Scale
end
end
end
@@ -1634,14 +1634,14 @@
ld E A
ld A (Y) # Length of highest word
do
- add E 1 # Increment length
+ inc E # Increment length
ld C 0 # Divide by 10
div 10
null A # Done?
until z # Yes
test (L -III) 1 # Sign?
if nz # Yes
- add E 1 # Space for '-'
+ inc E # Space for '-'
end
shl E 4 # Make short number
or E CNT
@@ -1667,7 +1667,7 @@
div 10
null A # Done?
while nz # No
- add E 1 # Increment length
+ inc E # Increment length
loop
pop C # Restore name index
sub E (L -I) # Scale
@@ -1680,7 +1680,7 @@
do
cmp (L -I) -1 # Scale
while lt
- add (L -I) 1 # Increment scale
+ inc (L -I) # Increment scale
ld B (char "0") # Ouput zeroes
call byteSymBCX_CX
loop
@@ -1762,7 +1762,7 @@
end
end
end
- sub (L -I) 1 # Decrement scale
+ dec (L -I) # Decrement scale
ret
# (format 'num ['cnt ['sym1 ['sym2]]]) -> sym
@@ -2082,7 +2082,7 @@
test E SIGN
if nz
off E SIGN
- add B 1
+ inc B
end
link
push ZERO # <L II> Safe
@@ -2139,7 +2139,7 @@
test E SIGN
if nz
off E SIGN
- add B 1
+ inc B
end
link
push ZERO # <L II> Safe
@@ -2204,7 +2204,7 @@
test E SIGN
if nz
off E SIGN
- add B 1
+ inc B
end
link
push ZERO # <L II> Safe
@@ -2330,7 +2330,7 @@
call shruA_A # Non-destructive
ld (L I) A
do
- sub (L -I) 1 # Shift count?
+ dec (L -I) # Shift count?
while nz
call halfA_A # Shift right (destructive)
ld (L I) A
@@ -2339,7 +2339,7 @@
call shluA_A # Non-destructive
ld (L I) A
do
- add (L -I) 1 # Shift count?
+ inc (L -I) # Shift count?
while nz
call twiceA_A # Shift left (destructive)
ld (L I) A
@@ -2672,7 +2672,7 @@
push E # Save it
ld Y (Y CDR) # Second arg
call evCntXY_FE # Get cnt2
- add E 1 # Seed % (cnt2 + 1 - cnt1) + cnt1
+ inc E # Seed % (cnt2 + 1 - cnt1) + cnt1
sub E (S)
ld A (Seed 4) # Get high halfword
ld C 0
diff --git a/src64/db.l b/src64/db.l
@@ -1,4 +1,4 @@
-# 05may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# 6 bytes in little endian format
@@ -469,7 +469,7 @@
ld X A # Keep 'free' in X
ld C (DbFile)
shl A (C II) # Shift 'free'
- sub (C VII) 1 # Decrement 'fluse'
+ dec (C VII) # Decrement 'fluse'
ld E A # Read 'free' link
ld C BLK
call blkPeekCEZ # into 'Buf'
@@ -499,7 +499,7 @@
ret
(code 'newIdEX_X)
- sub E 1 # Zero-based
+ dec E # Zero-based
shl E 6 # 'dbFile' index
cmp E (DBs) # In Range?
jge dbfErrX # No
@@ -507,7 +507,7 @@
ld (DbFile) E # Set current
null (DbLog) # Transaction log?
if z # No
- add (EnvProtect) 1 # Protect the operation
+ inc (EnvProtect) # Protect the operation
end
call wrLockDb # Write lock DB
null (DbJnl) # Journal?
@@ -527,7 +527,7 @@
call rwUnlockDbA # Unlock
null (DbLog) # Transaction log?
if z # No
- sub (EnvProtect) 1 # Unprotect
+ dec (EnvProtect) # Unprotect
end
ret
@@ -639,7 +639,7 @@
pop A # Retrieve count
cmp A BLKTAG # Max reached?
if ne # No
- add A 1 # Increment count
+ inc A # Increment count
end
call setAdrAZ # Store in new current block
add Z BLK # Point to block data
@@ -650,7 +650,7 @@
pop A # Retrieve byte
end
ld (Z) B # Store byte
- add Z 1 # Increment pointer
+ inc Z # Increment pointer
ret
# (pool ['sym1 ['lst] ['sym2] ['sym3]]) -> T
@@ -970,7 +970,7 @@
end
add B (char "@") # Make ASCII letter
ld (C) B # Store in buffer
- add C 1
+ inc C
ret
# (journal 'any ..) -> T
@@ -1053,7 +1053,7 @@
call xCntEX_FE # Eval object ID
ld C E # into C
pop E # Get file number
- sub E 1 # Zero-based
+ dec E # Zero-based
end
call extNmCE_X # Build external symbol name
call externX_E # New external symbol
@@ -1075,7 +1075,7 @@
cmp Y Nil # Return only object ID?
ldz E C # Yes
if ne # No
- add A 1 # File is zero-based
+ inc A # File is zero-based
shl A 4 # Make short file number
or A CNT
call cons_E # Return (file . id)
@@ -1265,7 +1265,7 @@
do
shr X 8 # More bytes?
while nz # Yes
- add A 1 # Increment count
+ inc A # Increment count
loop
ret
end
@@ -1279,7 +1279,7 @@
shr X 4 # Any significant bits in short name/number?
40 if nz # Yes
do
- add A 1 # Increment count
+ inc A # Increment count
shr X 8 # More bytes?
until z # No
end
@@ -1307,7 +1307,7 @@
while ne # No
cmp X (S I) # Circular?
if eq # Yes
- add (S) 1 # Increment count once more
+ inc (S) # Increment count once more
break T
end
atom X # Atomic CDR?
@@ -1513,7 +1513,7 @@
link
null (DbLog) # Transaction log?
if z # No
- add (EnvProtect) 1 # Protect the operation
+ inc (EnvProtect) # Protect the operation
end
call wrLockDb # Write lock DB
null (DbJnl) # Journal?
@@ -1566,7 +1566,7 @@
set (C (+ IV 1)) 1 # Set dirty flag
rcl Y 2 # Deleted?
if nc # No
- add (C VII) 1 # Increment 'fluse'
+ inc (C VII) # Increment 'fluse'
end
end
pop Y
@@ -1867,7 +1867,7 @@
call rwUnlockDbA # Unlock all
null (DbLog) # Transaction log?
if z # No
- sub (EnvProtect) 1 # Unprotect
+ dec (EnvProtect) # Unprotect
end
ld E (DbFiles) # Iterate DB files
ld C (DBs) # Count
@@ -1994,7 +1994,7 @@
cmp E (X V) # Greater or equal to mark vector size?
if ge # Yes
push E # Save byte position
- add E 1 # New size
+ inc E # New size
ld Y E # Keep in Y
ld A (X VI) # Get mark bit vector
call allocAE_A # Increase to new size
@@ -2038,7 +2038,7 @@
ld X E
ld E ((E CDR)) # Eval 'cnt'
call evCntEX_FE
- sub E 1 # File is zero-based
+ dec E # File is zero-based
shl E 6 # 'dbFile' index
cmp E (DBs) # Local file?
jge dbfErrX # No
@@ -2114,7 +2114,7 @@
push E # <S III> 'flg'
push ZERO # <S II> 'syms'
push ZERO # <S I> 'blks'
- add (EnvProtect) 1 # Protect the operation
+ inc (EnvProtect) # Protect the operation
call wrLockDb # Write lock DB
null (DbJnl) # Journal?
if nz # Yes
@@ -2190,7 +2190,7 @@
end
cmp X BLKTAG # Less than maximum?
if lt # Yes
- add X 1 # Increment
+ inc X # Increment
end
loop
pop X
@@ -2237,7 +2237,7 @@
end
ld A (hex "10000") # Length 1
call rwUnlockDbA # Unlock
- sub (EnvProtect) 1 # Unprotect
+ dec (EnvProtect) # Unprotect
pop Z
pop Y
pop X
diff --git a/src64/err.l b/src64/err.l
@@ -1,4 +1,4 @@
-# 08mar10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# Debug print routine
@@ -81,6 +81,7 @@
ld (ExtN) 0
ld (EnvBrk) 0
ld (Alarm) Nil
+ ld (Sigio) Nil
ld (LineX) ZERO
ld (LineC) -1
lea Y (S 240) # Pointer to outFrame
@@ -180,22 +181,22 @@
ld E 0 # 'n'
ld Z Y # Bindings in Z
do
- add E 1 # Increment 'n'
- add A 1 # Done?
+ inc E # Increment 'n'
+ inc A # Done?
while nz # No
ld Z ((Z) I) # Follow link
null Z # Any?
while nz # Yes
cmp (Z -I) A # Env swap nesting?
if lt # Yes
- sub A 1 # Adjust
+ dec A # Adjust
end
loop
do
ld A E # Get 'n'
ld Z Y # Bindings
do
- sub A 1 # 'n-1' times
+ dec A # 'n-1' times
while nz
ld Z ((Z) I) # Follow link
loop
@@ -212,7 +213,7 @@
cmp A Z # More?
until lt # No
end
- sub E 1 # Decrement 'n'
+ dec E # Decrement 'n'
until z # Done
end
cmp Y (X III) # Reached last bind frame?
diff --git a/src64/ext.l b/src64/ext.l
@@ -1,4 +1,4 @@
-# 05mar10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
### Soundex Algorithm ###
@@ -102,7 +102,7 @@ bytes (
else
cmp A (S) # Same as last?
if ne # No
- sub E 1 # Decrement count
+ dec E # Decrement count
break z
ld (S) A # Save last character
xchg C (S II) # Swap status
@@ -149,7 +149,7 @@ bytes (
test A (hex "8000")
while z
add A A # Double 'tmp'
- sub C 1 # Decrement exponent
+ dec C # Decrement exponent
until z
ld A C # Get exponent
add A 3 # plus 3
diff --git a/src64/flow.l b/src64/flow.l
@@ -1,4 +1,4 @@
-# 19apr10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
(code 'redefMsgEC)
@@ -235,7 +235,7 @@
ld Y (EnvBind) # and bindings
do
ld A (Y) # End of bindings in A
- add (L -II) 1 # Increment 'n'
+ inc (L -II) # Increment 'n'
sub (Y -I) (L -I) # Decrement 'eswp' by 'cnt'
if c # First pass
add Y I
@@ -247,7 +247,7 @@
until eq # No
cmp X At # Lambda frame?
if eq # Yes
- sub C 1 # Decrement local 'cnt'
+ dec C # Decrement local 'cnt'
break z # Done
end
end
@@ -279,7 +279,7 @@
add Y II
cmp Y A # More?
until eq # No
- sub C 1 # Traversed 'n' frames?
+ dec C # Traversed 'n' frames?
while nz # No
ld Y (A I) # Bind link
null Y # More bindings?
@@ -307,7 +307,7 @@
ld A C # in A
ld Y (EnvBind) # Bindings
do
- sub A 1 # 'n-1' times
+ dec A # 'n-1' times
while nz
ld Y ((Y) I) # Follow link
loop
@@ -321,7 +321,7 @@
cmp A Y # More?
until lt # No
end
- sub C 1 # Decrement 'n'
+ dec C # Decrement 'n'
until z # Done
pop Y
drop
@@ -366,7 +366,7 @@
ld Y (EnvBind) # and bindings
do
ld A (Y) # End of bindings in A
- add (L -II) 1 # Increment 'n'
+ inc (L -II) # Increment 'n'
sub (Y -I) (L -I) # Decrement 'eswp' by 'cnt'
if c # First pass
add Y I
@@ -378,7 +378,7 @@
until eq # No
cmp X At # Lambda frame?
if eq # Yes
- sub C 1 # Decrement local 'cnt'
+ dec C # Decrement local 'cnt'
break z # Done
end
end
@@ -415,7 +415,7 @@
add Y II
cmp Y A # More?
until eq # No
- sub C 1 # Traversed 'n' frames?
+ dec C # Traversed 'n' frames?
while nz # No
ld Y (A I) # Bind link
null Y # More bindings?
@@ -448,7 +448,7 @@
ld A C # in A
ld Y (EnvBind) # Bindings
do
- sub A 1 # 'n-1' times
+ dec A # 'n-1' times
while nz
ld Y ((Y) I) # Follow link
loop
@@ -462,7 +462,7 @@
cmp A Y # More?
until lt # No
end
- sub C 1 # Decrement 'n'
+ dec C # Decrement 'n'
until z # Done
pop Y
drop
@@ -2168,7 +2168,7 @@
ld Y X # Loop body
call loopY_FE
while nz
- sub (S) 1 # Decrement count
+ dec (S) # Decrement count
until z
pop A # Drop count
else
@@ -2676,7 +2676,7 @@
ld Y (X) # Get 'sym|lst'
ld X (X CDR)
ld Z (X CDR) # Get 'prg'
- add (EnvTrace) 1 # Increment trace level
+ inc (EnvTrace) # Increment trace level
ld C (EnvTrace) # Get it
call traceCY # Print trace information
ld C trc1 # Print " :"
@@ -2717,7 +2717,7 @@
ld (OutFile) ((OutFiles) II) # Set output channel again
ld (EnvPutB) putStdoutB
ld C (EnvTrace) # Get trace level
- sub (EnvTrace) 1 # Decrement it
+ dec (EnvTrace) # Decrement it
call traceCY # Print trace information
ld C trc2 # Print " = "
call outStringC
@@ -2844,7 +2844,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne waitPidErrX # No
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -3110,7 +3110,7 @@
do
sub A VI # Decrement pointer
ld (A) 0 # Clear 'pid'
- sub E 1 # Done?
+ dec E # Done?
until z # Yes
pop E # Get 'pid'
end
diff --git a/src64/gc.l b/src64/gc.l
@@ -1,4 +1,4 @@
-# 13oct09abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# Mark data
@@ -57,7 +57,7 @@
null A # Enough free cells?
jeq gc # No: Collect garbage
ld A (A)
- sub C 1
+ dec C
until z
ret
@@ -85,7 +85,7 @@
do
or (X CDR) 1 # Set mark bit
add X II # Next cell
- sub C 1 # Done?
+ dec C # Done?
until z # Yes
ld X (X) # Next heap
null X # Done?
@@ -93,6 +93,8 @@
### Mark ###
ld E (Alarm) # Mark globals
call markE
+ ld E (Sigio)
+ call markE
ld E (LineX)
call markE
ld E (Intern) # Mark internal symbols
@@ -322,7 +324,7 @@
if nz # Yes
ld (Z) X # Link avail
ld X Z
- sub C 1
+ dec C
end
sub Z II
cmp Z Y # Done?
@@ -348,7 +350,7 @@
if nz # Yes
ld (Z) X # Link avail
ld X Z
- sub C 1
+ dec C
end
sub Z II
cmp Z Y # Done?
diff --git a/src64/glob.l b/src64/glob.l
@@ -1,4 +1,4 @@
-# 12may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
(data 'Globals 0)
@@ -46,6 +46,7 @@
: StrX word 0 # String status
: StrC word 0
: Alarm word Nil # Alarm handler
+: Sigio word Nil # Sigio handler
: LineX word ZERO # Console line
: LineC word -1
: GcCount word CELLS # Collector count
@@ -56,6 +57,9 @@
: Penv word Nil # Pilog environment
: Pnl word Nil
+# Signals
+: Signal skip (* I SIGNALS)
+
# Database
: DBs word 0 # Scaled number of DB files
: DbFile word 0 # DB file
@@ -551,7 +555,6 @@ initData
:: _dot_ asciz "."
# Bytes
-:: Signal byte 0 # Signal flag
:: Tio byte 0 # Terminal I/O
:: Flg byte 0 # General flag value
diff --git a/src64/ht.l b/src64/ht.l
@@ -1,4 +1,4 @@
-# 01apr10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
### Hypertext I/O functions ###
@@ -38,7 +38,7 @@ align 8 asciz "<hr>"
ld B (X) # Compare bytes
cmp B (Y) # Equal?
while eq # Yes
- add X 1 # End of HtOk string?
+ inc X # End of HtOk string?
nul (X)
if z # Yes: Found
slen C Y # Length of the remaining string
@@ -50,7 +50,7 @@ align 8 asciz "<hr>"
pop X
ret # 'z' or 'nz'
end
- add Y 1 # End of data?
+ inc Y # End of data?
nul (Y)
until z # Yes
pop Y
@@ -89,7 +89,7 @@ align 8 asciz "<hr>"
do
ld B (Y) # Output partial string
call envPutB
- add Y 1 # till end pointer in E
+ inc Y # till end pointer in E
cmp Y E
until eq
else
@@ -127,12 +127,12 @@ align 8 asciz "<hr>"
call envPutB # Output it
test C (hex "80") # Double byte?
if nz # Yes
- add Y 1 # Next
+ inc Y # Next
ld B (Y) # Output second byte
call envPutB
test C (hex "20") # Triple byte?
if nz # Yes
- add Y 1 # Next
+ inc Y # Next
ld B (Y) # Output third byte
call envPutB
end
@@ -142,7 +142,7 @@ align 8 asciz "<hr>"
end
end
end
- add Y 1 # Increment string pointer
+ inc Y # Increment string pointer
end
loop
ld S Z # Drop buffer
@@ -339,7 +339,7 @@ align 8 asciz "<hr>"
(code 'headCX_FX 0) # E
ld E X # Save X
do
- add C 1 # Point to next char
+ inc C # Point to next char
nul (C) # Any?
while nz # Yes
ld A ((X) TAIL) # Get next character symbol
@@ -456,10 +456,10 @@ align 8 asciz "<hr>"
call getChar_A # Read first char
cmp A 128 # Double byte?
if ge # Yes
- sub E 1 # Decrement count
+ dec E # Decrement count
cmp A 2048 # Triple byte?
if ge # Yes
- sub E 1 # Decrement count
+ dec E # Decrement count
end
end
sub E 1 # Less than zero?
@@ -486,10 +486,10 @@ align 8 asciz "<hr>"
call getChar_A
cmp A 128 # Double byte?
if ge # Yes
- sub E 1 # Decrement count
+ dec E # Decrement count
cmp A 2048 # Triple byte?
if ge # Yes
- sub E 1 # Decrement count
+ dec E # Decrement count
end
end
sub E 1 # Less than zero?
@@ -601,7 +601,7 @@ skip CHUNK # <Y III> Chunk buffer
else
ld A (Y I) # Call saved 'get'
call (A)
- sub (Y) 1 # Decrement count
+ dec (Y) # Decrement count
if z
ld A (Y I) # Call saved 'get'
call (A)
@@ -666,8 +666,8 @@ skip CHUNK # <Y III> Chunk buffer
do
ld B (X) # Next byte from chunk buffer
call envPutB # Output
- add X 1 # Increment pointer
- sub (Y) 1 # Decrement 'Cnt'
+ inc X # Increment pointer
+ dec (Y) # Decrement 'Cnt'
until z
ld B 13 # Output 'return'
call envPutB
@@ -684,7 +684,7 @@ skip CHUNK # <Y III> Chunk buffer
lea X (Y III) # X on chunk buffer
add X (Y) # Count index
ld (X) B # Store byte
- add (Y) 1 # Increment count
+ inc (Y) # Increment count
cmp (Y) CHUNK # Max reached?
if eq # Yes
call wrChunkY # Write buffer
diff --git a/src64/io.l b/src64/io.l
@@ -1,4 +1,4 @@
-# 12may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# Close file descriptor
@@ -199,7 +199,7 @@
setz # Return 'z'
ret
end
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -232,7 +232,7 @@
setz # Return 'z'
ret
end
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -248,7 +248,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne Retz # No: Return 'z'
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -285,7 +285,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne Retz # No: Return 'z'
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -301,7 +301,7 @@
end
cmp A EINTR # Interrupted?
jne Retz # No: Return 'z'
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -326,7 +326,7 @@
cmp A EINTR # Interrupted?
jne wrBytesErr # No
end
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -434,7 +434,7 @@
jz retc # EOF (c)
ld A 0 # 'ix'
end
- add (Z I) 1 # Increment 'ix'
+ inc (Z I) # Increment 'ix'
add A Z # Fetch byte (nc)
ld B (A VII) # from buffer
ret # nc
@@ -565,7 +565,7 @@
call (GetBinZ_FB) # Next byte?
jc 90 # No
call byteNumBCX_CX
- sub E 1 # Decrement count
+ dec E # Decrement count
until z
call (GetBinZ_FB) # Next count?
jc 90 # No
@@ -580,7 +580,7 @@
call (GetBinZ_FB) # Next byte?
jc 90 # No
call byteNumBCX_CX # (B is zero (not DOT) if Zero)
- sub E 1 # Decrement count
+ dec E # Decrement count
until z
20 ld E (L I) # Get result
big X # Big number?
@@ -600,7 +600,7 @@
call (GetBinZ_FB) # Next byte?
jc 90 # No
call byteSymBCX_CX
- sub E 1 # Decrement count
+ dec E # Decrement count
until z
call (GetBinZ_FB) # Next count?
jc 90 # No
@@ -615,7 +615,7 @@
call (GetBinZ_FB) # Next byte?
jc 90 # No
call byteSymBCX_CX
- sub E 1 # Decrement count
+ dec E # Decrement count
until z
30 ld X (L I) # Get name
pop A # Get tag
@@ -676,7 +676,7 @@
ld A E # Output next byte
call (PutBinBZ)
shr E 8 # Shift to next
- sub C 1 # Decrement count
+ dec C # Decrement count
ret
# Binary print short number
@@ -694,7 +694,7 @@
ld A E # Next data byte
shr E 8
call (PutBinBZ) # Output data byte
- sub C 1 # More?
+ dec C # More?
until z # No
ret
@@ -734,7 +734,7 @@
addc E E # Any significant bits in short number?
if nz # Yes
do
- add A 1 # Increment count
+ inc A # Increment count
shr E 8 # More bytes?
until z # No
end
@@ -748,7 +748,7 @@
call (PutBinBZ) # Output tag byte
do
call prByteCEXY # Output next data bye
- sub (S) 1 # More?
+ dec (S) # More?
until z # No
else
sub A 63 # Adjust count
@@ -758,7 +758,7 @@
push 63 # <S> and first 63 data bytes
do
call prByteCEXY # Output next data bye
- sub (S) 1 # More?
+ dec (S) # More?
until z # No
do
cmp (S I) 255 # Count greater or equal 255?
@@ -768,7 +768,7 @@
call (PutBinBZ) # Output count byte
do
call prByteCEXY # Output next data bye
- sub (S) 1 # More?
+ dec (S) # More?
until z # No
sub (S I) 255 # Decrement counter
loop
@@ -851,7 +851,7 @@
shr E 4 # Any significant bits in short name?
if nz # Yes
do
- add A 1 # Increment count
+ inc A # Increment count
shr E 8 # More bytes?
until z # No
end
@@ -865,7 +865,7 @@
do
call symByteCX_FACX # Next data byte
call (PutBinBZ) # Output it
- sub E 1 # More?
+ dec E # More?
until z # No
else
ld A (* 4 63) # Output first tag byte
@@ -878,7 +878,7 @@
do
call symByteCX_FACX # Next data byte
call (PutBinBZ) # Output it
- sub E 1 # More?
+ dec E # More?
until z # No
do
cmp (S) 255 # Count greater or equal 255?
@@ -889,7 +889,7 @@
do
call symByteCX_FACX # Next data byte
call (PutBinBZ) # Output it
- sub E 1 # More?
+ dec E # More?
until z # No
sub (S) 255 # Decrement counter
loop
@@ -946,7 +946,7 @@
# Family IPC
(code 'putTellBZ 0)
ld (Z) B # Store byte
- add Z 1 # Increment pointer
+ inc Z # Increment pointer
lea A ((TellBuf) (- PIPE_BUF 1)) # Reached (TellBuf + PIPE_BUF - 1)?
cmp Z A
jeq tellErr # Yes
@@ -956,14 +956,14 @@
ld (TellBuf) Z # Set global buffer
add Z 2 # 2 bytes space for count
set (Z) BEG # Begin a list
- add Z 1
+ inc Z
ret
(code 'tellEndZ)
push X
push Y
set (Z) END # Close list
- add Z 1
+ inc Z
ld X (TellBuf) # Get buffer
ld E Z # Calculate total size
sub E X
@@ -1078,7 +1078,7 @@
call symByteCX_FACX
while nz
ld (Z) B # Store next byte
- add Z 1
+ inc Z
test Z 7 # Buffer full?
if z # Yes
sub S 8 # Extend buffer
@@ -1107,14 +1107,14 @@
cmp B (char "+") # Plus?
if eq
ld (Z) B # Store "+"
- add Z 1
+ inc Z
call symByteCX_FACX # Second byte
end
cmp B (char "@") # Home path?
if ne
do
ld (Z) B # Store byte
- add Z 1
+ inc Z
test Z 7 # Buffer full?
if z # Yes
sub S 8 # Extend buffer
@@ -1131,14 +1131,14 @@
do
ld B (E)
ld (Z) B # Store next byte
- add Z 1
+ inc Z
test Z 7 # Buffer full?
if z # Yes
sub S 8 # Extend buffer
movm (S) (S 8) (Z)
sub Z 8 # Reset buffer pointer
end
- add E 1
+ inc E
nul (E) # More?
until z # No
end
@@ -1147,7 +1147,7 @@
call symByteCX_FACX
while nz
ld (Z) B # Store next byte
- add Z 1
+ inc Z
test Z 7 # Buffer full?
if z # Yes
sub S 8 # Extend buffer
@@ -1294,7 +1294,7 @@
ld C (C) # Next frame
null C # Any?
jz badFdErrEX # No
- sub A 1 # Found frame?
+ dec A # Found frame?
until z # Yes
ld A (C I) # Get fd from frame
end
@@ -1325,7 +1325,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne openErrEX # No
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -1434,7 +1434,7 @@
ld C (C) # Next frame
null C # Any?
jz badFdErrEX # No
- sub A 1 # Found frame?
+ dec A # Found frame?
until z # Yes
ld A (C I) # Get fd from frame
end
@@ -1465,7 +1465,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne openErrEX # No
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -1579,7 +1579,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne openErrEX # No
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -1615,12 +1615,12 @@
jz 90 # Return -1
ld A 0 # 'ix'
end
- add (Z I) 1 # Increment 'ix'
+ inc (Z I) # Increment 'ix'
add A Z # Fetch byte
ld B (A VII) # from buffer
cmp B 10 # Newline?
if eq # Yes
- add (Z IV) 1 # Increment line
+ inc (Z IV) # Increment line
end
zxt # Extend into A
else
@@ -1686,7 +1686,7 @@
if nz # Yes
zxt # Return next byte
else
- sub A 1 # Return -1
+ dec A # Return -1
end
end
ld (Chr) A
@@ -1752,7 +1752,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne closeErrX
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -1805,7 +1805,7 @@
call errno_A
cmp A EINTR # Interrupted?
jne closeErrX
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -2633,7 +2633,7 @@
st4 (S) # Store 'fd'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- add Z 1 # Increment count
+ inc Z # Increment count
end
end
ld Y (Run) # Get '*Run'
@@ -2671,7 +2671,7 @@
st4 (S) # Store 'fd'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- add Z 1 # Increment count
+ inc Z # Increment count
end
end
end
@@ -2692,7 +2692,7 @@
st4 (S) # Store 'Hear'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- add Z 1 # Increment count
+ inc Z # Increment count
end
end
end
@@ -2704,7 +2704,7 @@
st4 (S) # Store 'Spkr'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- add Z 1 # Increment count
+ inc Z # Increment count
end
ld Y (Child) # Iterate children
ld E (Children) # Count
@@ -2718,7 +2718,7 @@
st4 (S)
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- add Z 1 # Increment count
+ inc Z # Increment count
null (Y IV) # Child's buffer count?
if nz # Yes
sub S POLLFD # Create 'poll' structure
@@ -2726,7 +2726,7 @@
st4 (S)
ld A POLLOUT # Poll output
st2 (S POLL_EVENTS) # Store 'events'
- add Z 1 # Increment count
+ inc Z # Increment count
end
end
add Y VI # Increment by sizeof(child)
@@ -2743,7 +2743,7 @@
ld (Run) Nil # Clear '*Run'
jmp selectErrX
end
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -2948,7 +2948,7 @@
20 ld Y (Y CDR)
loop
pop X # Restore context
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -3038,7 +3038,7 @@
cmp A EINTR # Interrupted?
jne wrSyncErrX # No
end
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -3364,7 +3364,7 @@
add C (Z IV) # Index
cmp B (C) # Bytes match?
if eq # Yes
- add (Z IV) 1 # Increment index
+ inc (Z IV) # Increment index
nul (C 1) # End of string?
break nz # No
call (EnvGet_A) # Skip next input byte
@@ -3375,11 +3375,11 @@
break z # Yes
lea C (Z (+ V 1)) # Offset pointer to second byte
do
- sub (Z IV) 1 # Decrement index
+ dec (Z IV) # Decrement index
while nz
cmpn (Z V) (C) (Z IV) # Compare stack buffer
while nz
- add C 1 # Increment offset
+ inc C # Increment offset
loop
loop
ld Z (Z) # Next in chain
@@ -3539,7 +3539,7 @@
pop C
shr E 4 # Normalize
do
- sub E 1 # Decrement count
+ dec E # Decrement count
while nz
call (EnvGet_A) # Get next
call eolA_F # End of line?
@@ -3590,7 +3590,7 @@
eval # Eval next arg
shr E 4 # Normalize
do
- sub E 1 # Decrement count
+ dec E # Decrement count
while nz
call (EnvGet_A) # Get next
call eolA_F # End of line?
@@ -4122,7 +4122,7 @@
ld E Nil # Return NIL
jmp 90
end
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandlerX
end
@@ -4265,7 +4265,7 @@
add C (Z IV) # Index
cmp B (C) # Bytes match?
if eq # Yes
- add (Z IV) 1 # Increment index
+ inc (Z IV) # Increment index
nul (C 1) # End of string?
if nz # No
null X # Current max?
@@ -4285,7 +4285,7 @@
while ge # No
ld B (C)
call (EnvPutB) # Output bytes
- add C 1
+ inc C
sub E 1
loop
end
@@ -4297,11 +4297,11 @@
break z # Yes
lea C (Z (+ V 1)) # Offset pointer to second byte
do
- sub (Z IV) 1 # Decrement index
+ dec (Z IV) # Decrement index
while nz
cmpn (Z V) (C) (Z IV) # Compare stack buffer
while nz
- add C 1 # Increment offset
+ inc C # Increment offset
loop
cmp X Z # On current max?
if eq # Yes
@@ -4336,8 +4336,8 @@
do
ld B (C)
call (EnvPutB) # Output bytes
- add C 1
- sub E 1 # Done?
+ inc C
+ dec E # Done?
until z # Yes
pop E
pop A
@@ -4349,10 +4349,10 @@
lea C (Y V) # Buffer of output max
sub E (X IV) # Diff to current max index
do # Done?
- while ge # No
+ while ge # No
ld B (C)
call (EnvPutB) # Output bytes
- add C 1
+ inc C
sub E 1
loop
end
@@ -4395,7 +4395,7 @@
end
add X E # Buffer index
ld (X) B # Store byte
- add E 1 # Increment ix
+ inc E # Increment ix
ld (Y I) E # Store 'ix'
cmp B 10 # Linefeed?
if eq # Yes
@@ -4485,7 +4485,7 @@
(code 'outStringC)
do
ld B (C) # Next char
- add C 1
+ inc C
or B B # Null?
while ne # No
call (EnvPutB)
@@ -4517,7 +4517,7 @@
ret
(code 'printE 0)
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -4697,7 +4697,7 @@
ret
(code 'prinE 0)
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
call sighandler0
end
@@ -4923,7 +4923,7 @@
ld B (Y) # Next byte from buffer
call byteNumBCX_CX
add Y Z # Add direction offset
- sub (S) 1 # Decrement count
+ dec (S) # Decrement count
until z
ld E (L I) # Get result
big E # Bignum?
diff --git a/src64/lib/asm.l b/src64/lib/asm.l
@@ -1,4 +1,4 @@
-# 05may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# *LittleEndian *Registers optimize
@@ -394,6 +394,7 @@
(cmpn (destination) "*Mode" (source) "*Mode" (source) "*Mode")
(cnt (source) "*Mode")
(dbg)
+ (dec (destination) "*Mode")
(div (source) "*Mode")
(drop)
(eval)
@@ -401,6 +402,7 @@
(eval/ret)
(exec (reg (read)))
(hx2 (read))
+ (inc (destination) "*Mode")
(initCode)
(initData)
(initSym (read) (read) (operand (read)))
diff --git a/src64/main.l b/src64/main.l
@@ -1,4 +1,4 @@
-# 12may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
### Global return labels ###
@@ -55,7 +55,7 @@
if ne # No
10 sub Z Y # Length
ld C Z # Keep in Z
- add C 1 # Space for null byte
+ inc C # Space for null byte
cc malloc(C)
ld (Home) A # Set 'Home'
movn (A) (Y) Z # Copy path including "/"
@@ -118,6 +118,8 @@
call iSignalCE # for SIGALRM
ld C SIGTERM
call iSignalCE # for SIGTERM
+ ld C SIGIO
+ call iSignalCE # for SIGIO
ld E sigTerm # Install terminating signal handler for SIGINT
ld C SIGINT
call iSignalCE
@@ -255,71 +257,86 @@
ld (EnvProtect) 1
push A
push C
- ld B (Signal) # Which signal?
- cmp B SIGHUP
- if eq
- set (Signal) 0 # Clear signal
- ld E (Hup) # Run 'Hup'
- call execE
- else
- cmp B SIGINT
- if eq
- set (Signal) 0 # Clear signal
- nul (PRepl) # Child of REPL process?
- if z # No
- null E # Runtime expression?
- ldz E Nil # No: Default to NIL
- call brkLoadE_E # Enter debug breakpoint
- end
+ do
+ null (Signal (* I SIGIO)) # Test signals
+ if nz
+ dec (Signal) # Decrement signal counters
+ dec (Signal (* I SIGIO))
+ ld E (Sigio) # Run 'Sigio'
+ call execE
else
- cmp B SIGUSR1
- if eq
- set (Signal) 0 # Clear signal
+ null (Signal (* I SIGUSR1))
+ if nz
+ dec (Signal)
+ dec (Signal (* I SIGUSR1))
ld E (Sig1) # Run 'Sig1'
call execE
else
- cmp B SIGUSR2
- if eq
- set (Signal) 0 # Clear signal
+ null (Signal (* I SIGUSR2))
+ if nz
+ dec (Signal)
+ dec (Signal (* I SIGUSR2))
ld E (Sig2) # Run 'Sig2'
call execE
else
- cmp B SIGALRM
- if eq
- set (Signal) 0 # Clear signal
+ null (Signal (* I SIGALRM))
+ if nz
+ dec (Signal)
+ dec (Signal (* I SIGALRM))
ld E (Alarm) # Run 'Alarm'
call execE
else
- cmp B SIGTERM
- if eq
- push X
- ld X (Child) # Iterate children
- ld C (Children) # Count
- ld E 0 # Flag
- do
- sub C VI # More?
- while ge # Yes
- null (X) # 'pid'?
- if nz # Yes
- cc kill((X) SIGTERM) # Try to terminate
- nul4 # OK?
- ldz E 1 # Yes: Set flag
- end
- add X VI # Increment by sizeof(child)
- loop
- pop X
- null E # Still terminated any child?
+ null (Signal (* I SIGINT))
+ if nz
+ dec (Signal)
+ dec (Signal (* I SIGINT))
+ nul (PRepl) # Child of REPL process?
if z # No
- set (Signal) 0
- ld E 0 # Exit OK
- jmp byeE
+ null E # Runtime expression?
+ ldz E Nil # No: Default to NIL
+ call brkLoadE_E # Enter debug breakpoint
+ end
+ else
+ null (Signal (* I SIGHUP))
+ if nz
+ dec (Signal)
+ dec (Signal (* I SIGHUP))
+ ld E (Hup) # Run 'Hup'
+ call execE
+ else
+ null (Signal (* I SIGTERM))
+ if nz
+ push X
+ ld X (Child) # Iterate children
+ ld C (Children) # Count
+ ld E 0 # Flag
+ do
+ sub C VI # More?
+ while ge # Yes
+ null (X) # 'pid'?
+ if nz # Yes
+ cc kill((X) SIGTERM) # Try to terminate
+ nul4 # OK?
+ ldz E 1 # Yes: Set flag
+ end
+ add X VI # Increment by sizeof(child)
+ loop
+ pop X
+ null E # Still terminated any child?
+ if z # No
+ ld (Signal) 0
+ ld E 0 # Exit OK
+ jmp byeE
+ end
+ end
end
end
end
end
end
end
- end
+ null (Signal) # More signals?
+ until z # No
pop C
pop A
ld (EnvProtect) 0
@@ -332,7 +349,9 @@
if nz # Yes
cc kill((TtyPid) A)
else
- ld (Signal) B
+ shl A 3 # Signal index
+ inc (A Signal)
+ inc (Signal)
end
return 1
@@ -342,7 +361,8 @@
if nz # Yes
cc kill((TtyPid) SIGTERM)
else
- set (Signal) SIGTERM
+ inc (Signal (* I SIGTERM))
+ inc (Signal)
end
return 0
@@ -471,9 +491,9 @@
(code 'doProtect 2)
push X
ld X (E CDR) # Get 'prg'
- add (EnvProtect) 1
+ inc (EnvProtect)
prog X # Run 'prg'
- sub (EnvProtect) 1
+ dec (EnvProtect)
pop X
ret
@@ -497,7 +517,7 @@
do
null C # Any?
while nz # Yes
- add A 1 # Increment count
+ inc A # Increment count
ld C (C) # Follow link
loop
div CELLS # (C is zero)
@@ -633,7 +653,7 @@
cmp X (Y) # Found symbol?
if eq # Yes
lea Z (Y I) # Point to saved value
- sub C 1 # Decrement count
+ dec C # Decrement count
jz 10 # Done
end
add Y II
@@ -1092,7 +1112,7 @@
sym C # Symbol?
if nz # Yes
10 do # C is a symbol
- nul (Signal) # Signal?
+ null (Signal) # Signal?
if nz # Yes
push E
call sighandlerE
@@ -1155,14 +1175,14 @@
if eq # Yes
ld C Y # Keep pointer to slash
end
- add Y 1 # Increment buffer pointer
+ inc Y # Increment buffer pointer
loop
cmp Y Z # At start of buffer?
jz 90 # Yes
nul (Y 1) # At end of buffer?
jz 90 # Yes
set (Y) 0 # Replace colon with null byte
- add Y 1 # Point to token
+ inc Y # Point to token
null C # Contained '/'?
ld C S # Pointer to lib name
if z # No
@@ -1176,7 +1196,7 @@
null A
if nz # Yes
do
- add A 1 # Find end
+ inc A # Find end
nul (A)
until z
sub A (Home) # Calculate length
@@ -1354,7 +1374,7 @@
sub C 1 # Done?
while ns # No
ld (Z) B # Store byte in buffer
- add Z 1 # Increment buffer pointer
+ inc Z # Increment buffer pointer
loop
break T
end
@@ -1363,8 +1383,8 @@
ld A (E) # Next byte value
shr A 4 # in B
ld (Z) B # Store in buffer
- add Z 1 # Increment buffer pointer
- sub C 1 # Buffer full?
+ inc Z # Increment buffer pointer
+ dec C # Buffer full?
until z # Yes
pop E # Get allocated memory
end
@@ -1498,7 +1518,7 @@
null C # Pointer?
if nz # Yes
ld B (C)
- add C 1 # Size of byte
+ inc C # Size of byte
end
zxt # Byte
ld E A
@@ -1527,7 +1547,7 @@
if nz
shr Z 4 # Normalize
do
- sub Z 1 # Decrement count
+ dec Z # Decrement count
while nz
ld E (X) # Repeat last type
call natRetACE_CE # Next item
@@ -1569,7 +1589,7 @@
zxt
or B B # Any?
if nz # Yes
- add C 1
+ inc C
cmp B 128 # Single byte?
if ge # No
test B (hex "20") # Two bytes?
@@ -1583,7 +1603,7 @@
push A
ld B (C) # Fetch second byte
zxt
- add C 1
+ inc C
and B (hex "3F") # 10xxxxxx
or A (S) # Combine
shl A 6 # xxxxxxxxxx000000
@@ -1591,7 +1611,7 @@
end
ld B (C) # Fetch last byte
zxt
- add C 1
+ inc C
and B (hex "3F") # 10xxxxxx
or (S) A # Combine
pop A # Get result
@@ -1628,7 +1648,7 @@
do
ld B (E)
call byteSymBCX_CX # Pack byte
- add E 1 # Next byte
+ inc E # Next byte
nul (E) # Any?
until z
ld X (S VI) # Get name
@@ -1923,7 +1943,7 @@
ld4 (C TM_MDAY) # Get day
ld X A
ld4 (C TM_MON) # month
- add A 1
+ inc A
ld Y A
ld4 (C TM_YEAR) # and year
add A 1900
@@ -2069,7 +2089,7 @@
if lt # Yes
add Y 3 # month += 3
else
- add Z 1 # Increment year
+ inc Z # Increment year
sub Y 9 # month -= 9
end
shl X 4 # Make short day
@@ -2373,7 +2393,7 @@
until ne
push Z
ld Z E # Pointer to rest
- sub Z 1 # without slash in Z
+ dec Z # without slash in Z
call mkStrE_E # Make string
call consE_C # Cons
ld (C) E
@@ -2490,7 +2510,7 @@
push Z
call bufStringE_SZ # Write to stack buffer
slen C S # String length in C
- add C 1 # plus null byte
+ inc C # plus null byte
movn ((AV0)) (S) C # Copy to system buffer
ld S Z # Drop buffer
pop Z
diff --git a/src64/net.l b/src64/net.l
@@ -1,4 +1,4 @@
-# 05may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# (port ['T] 'cnt|(cnt . cnt) ['var]) -> cnt
@@ -55,7 +55,7 @@
cc bind(C Addr SOCKADDR_IN) # Try to bind socket
nul4 # OK?
while s # No
- add E 1 # Next port in range
+ inc E # Next port in range
cmp E (S) # Exceeded limit?
if gt # Yes
cc close(C) # Close socket
@@ -129,7 +129,7 @@
ret
end
cc usleep(100000) # Sleep 100 milliseconds
- sub C 1 # Done?
+ dec C # Done?
until z # Yes
cc fcntl(E F_SETFL pop) # Restore socket status flags
setz # Return 'z'
@@ -329,7 +329,7 @@
cmp Z (BufEnd) # End of buffer data?
jeq udpOvflErr # Yes
ld (Z) B # Store byte
- add Z 1 # Increment pointer
+ inc Z # Increment pointer
ret
# vi:et:ts=3:sw=3
diff --git a/src64/subr.l b/src64/subr.l
@@ -1,4 +1,4 @@
-# 15feb10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# (car 'var) -> any
@@ -866,7 +866,7 @@
ld Y (L I) # Retrieve 'lst'
ld X (Y) # Keep CAR
do
- sub E 1 # Decrement count
+ dec E # Decrement count
while nz
ld Y (Y CDR) # Next cell?
atom Y
@@ -941,7 +941,7 @@
atom Y # Find end of 'lst'
while z
ld Y (Y CDR)
- sub X 1 # Decrement 'cnt'
+ dec X # Decrement 'cnt'
loop
do
sub X 1 # 'cnt' > 0?
@@ -963,12 +963,12 @@
ld Y (E CDR) # Find last cell
atom Y
while z
- add X 1 # Increment 'cnt'
+ inc X # Increment 'cnt'
ld E Y
loop
end
do
- add X 1 # Increment 'cnt'
+ inc X # Increment 'cnt'
while s
call cons_A # Cons 'any' with NIL
ld (A) (L I)
@@ -1275,7 +1275,7 @@
ld E Nil
else
do
- sub C 1 # nth
+ dec C # nth
while nz
ld E (E CDR)
loop
@@ -1303,7 +1303,7 @@
else
ld C (L II) # Get list
do
- sub E 1 # nth
+ dec E # nth
while nz
ld C (C CDR)
loop
@@ -1723,7 +1723,7 @@
ld (C CDR) (X CDR) # Swap first two cells
ld (X CDR) C
do
- sub E 1 # Done?
+ dec E # Done?
while nz # No
ld A (C CDR) # More cells?
atom A
@@ -1854,7 +1854,7 @@
if s # Yes
ld Y E
do
- add X 1 # Increment 'cnt' by length
+ inc X # Increment 'cnt' by length
ld Y (Y CDR)
atom Y
until nz
@@ -1870,7 +1870,7 @@
tuck Y # <L I> Result
link
do
- sub X 1 # Counted down?
+ dec X # Counted down?
while nz # No
ld E (E CDR) # List done?
atom E
@@ -1943,12 +1943,12 @@
if s # Yes
do
ld E (E CDR)
- add X 1 # Take -nth
+ inc X # Take -nth
until z
else
ld Y (E CDR) # Traverse CDR
do
- sub X 1 # Decrement 'cnt'
+ dec X # Decrement 'cnt'
while nz
atom Y # End of list?
while z # No
@@ -2634,7 +2634,7 @@
or E CNT
jmp 90 # Found
end
- add C 1 # Increment result
+ inc C # Increment result
ld Y (Y CDR) # Next item
cmp Z Y # Hit head?
until eq # Yes
@@ -2661,7 +2661,7 @@
do
atom E # Any?
while z # Yes
- add C 1 # Increment result
+ inc C # Increment result
ld A X # Get 'lst1'
push E
call equalAE_F # Same rest?
@@ -2985,7 +2985,7 @@
ld Z 0 # Calculate length in Z
ld Y X
do
- add Z 1 # Increment length
+ inc Z # Increment length
ld Y (Y CDR) # Next cell?
atom Y
until nz # No
@@ -3002,7 +3002,7 @@
ld Y X # Offset Y
do
ld Y (Y CDR)
- sub C 1
+ dec C
until z
ld A ((Y)) # Compare CAAR
ld E (L II) # with 'any'
@@ -3028,7 +3028,7 @@
ld Y X # Offset Y
do
ld Y (Y CDR)
- sub C 1
+ dec C
until z
ld A ((Y)) # Compare CAAR
ld E (L II) # with 'any'
@@ -3496,7 +3496,7 @@
ld X E
ld C 0 # Index count
do
- add C 1 # Increment
+ inc C # Increment
ld A ((L IV)) # Found car(alt)?
ld E (X)
ld X (X CDR)
diff --git a/src64/sym.l b/src64/sym.l
@@ -1,4 +1,4 @@
-# 23feb10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
### Compare long names ###
@@ -627,7 +627,7 @@
do
ld B (E)
call byteSymBCX_CX # Pack byte
- add E 1 # Next byte
+ inc E # Next byte
nul (E) # Any?
until z
call cons_E # Cons symbol
@@ -651,7 +651,7 @@
call byteSymBCX_CX # Pack byte
cmp E Z # Reached Z?
while ne # No
- add E 1 # Next byte
+ inc E # Next byte
nul (E) # Any?
until z
call cons_A # Cons symbol
@@ -1825,7 +1825,7 @@
ld C (C CDR) # More elements?
atom C
while z # Yes
- sub Y 1 # Count?
+ dec Y # Count?
while nz # Yes
call cons_A # Copy next cell
ld (A) (C)
@@ -2521,7 +2521,7 @@
if nc # Yes
jz retNil # Return NIL if zero
do
- sub C 1 # nth
+ dec C # nth
jz retE_E
ld E (E CDR)
loop
@@ -2529,7 +2529,7 @@
# Key is negative
do
ld E (E CDR)
- sub C 1 # nth
+ dec C # nth
until z
ret
end
diff --git a/src64/sys/linux.code.l b/src64/sys/linux.code.l
@@ -1,4 +1,4 @@
-# 02oct09abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# System macros
@@ -26,7 +26,7 @@
(code 'wifsignaledS_F 0) # WIFSIGNALED
ld A (S I) # Get status
and B `(hex "7F") # (((status) & 0x7f) + 1) >> 1) > 0)
- add B 1
+ inc B
shr B 1
ret
diff --git a/src64/sys/linux.defs.l b/src64/sys/linux.defs.l
@@ -1,4 +1,4 @@
-# 09sep09abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
# errno
@@ -96,6 +96,8 @@
(equ SIGTSTP 20)
(equ SIGTTIN 21)
(equ SIGTTOU 22)
+(equ SIGIO 29)
+(equ SIGNALS 30) # Highest used signal number plus 1
# wait
(equ WNOHANG 1)
diff --git a/src64/version.l b/src64/version.l
@@ -1,6 +1,6 @@
-# 18may10abu
+# 19may10abu
# (c) Software Lab. Alexander Burger
-(de *Version 3 0 2 22)
+(de *Version 3 0 2 23)
# vi:et:ts=3:sw=3