picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 6afaa8d9002f9c99045df9884432e3d872692e4c
parent f39a126cb370b1d182890e91b89346a8a0236ceb
Author: Alexander Burger <abu@software-lab.de>
Date:   Sat, 23 Mar 2013 19:29:51 +0100

'lisp' calls from 'native' in emulator were missing
Diffstat:
MCHANGES | 1+
Msrc64/arch/emu.l | 54+++++++++++++++++++++++++++++++-----------------------
Msrc64/tags | 126++++---------------------------------------------------------------------------
3 files changed, 38 insertions(+), 143 deletions(-)

diff --git a/CHANGES b/CHANGES @@ -1,4 +1,5 @@ * DDmar13 picoLisp-3.1.2 + 'lisp' calls from 'native' in emulator '<layout>' function 'fold' analog to 'lowc' / 'uppc' 'fold' second arg default zero diff --git a/src64/arch/emu.l b/src64/arch/emu.l @@ -1,4 +1,4 @@ -# 07feb13abu +# 23mar13abu # (c) Software Lab. Alexander Burger # Byte order @@ -80,7 +80,7 @@ (pack "void fun" @ - "(int a, int c, int e, int x, int y, int z) {begin(" + "(long a, long c, long e, long x, long y, long z) {begin(" @ ", a, c, e, x, y, z);}" ) ) (pack "(void(*)())fun" @) ) @@ -1184,7 +1184,7 @@ "extern int Carry;" "extern void mul2(uint64_t);" "extern void div2(uint64_t);" - "extern void begin(int,int,int,int,int,int,int);" + "extern uint64_t begin(int,long,long,long,long,long,long);" "extern void *argv(int,ptr);" "extern void retv(int,ptr);" NIL @@ -1259,26 +1259,30 @@ " }" "}" NIL - "void begin(int i, int a, int c, int e, int x, int y, int z) {" - " S.p -= 8, *(uint16_t**)S.p = PC;" - " S.p -= 8, ((ptr)S.p)->l = Carry;" - " S.p -= 8, ((ptr)S.p)->n = Result;" - " S.p -= 8, *(ptr)S.p = Z, Z.n = z;" - " S.p -= 8, *(ptr)S.p = Y, Y.n = y;" - " S.p -= 8, *(ptr)S.p = X, X.n = x;" - " S.p -= 8, *(ptr)S.p = E, E.n = e;" - " S.p -= 8, *(ptr)S.p = C, C.n = c;" - " S.p -= 8, *(ptr)S.p = A, A.n = a;" - " run(i);" - " A = *(ptr)S.p, S.p += 8;" - " C = *(ptr)S.p, S.p += 8;" - " E = *(ptr)S.p, S.p += 8;" - " X = *(ptr)S.p, S.p += 8;" - " Y = *(ptr)S.p, S.p += 8;" - " Z = *(ptr)S.p, S.p += 8;" - " Result = ((ptr)S.p)->n, S.p += 8;" - " Carry = ((ptr)S.p)->l, S.p += 8;" - " PC = *(uint16_t**)S.p, S.p += 8;" + "uint64_t begin(int i, long a, long c, long e, long x, long y, long z) {" + " uint64_t res;" + NIL + " S.p -= 8, *(uint16_t**)S.p = PC;" + " S.p -= 8, ((ptr)S.p)->l = Carry;" + " S.p -= 8, ((ptr)S.p)->n = Result;" + " S.p -= 8, *(ptr)S.p = Z, Z.n = z;" + " S.p -= 8, *(ptr)S.p = Y, Y.n = y;" + " S.p -= 8, *(ptr)S.p = X, X.n = x;" + " S.p -= 8, *(ptr)S.p = E, E.n = e;" + " S.p -= 8, *(ptr)S.p = C, C.n = c;" + " S.p -= 8, *(ptr)S.p = A, A.n = a;" + " run(i);" + " res = A.n;" + " A = *(ptr)S.p, S.p += 8;" + " C = *(ptr)S.p, S.p += 8;" + " E = *(ptr)S.p, S.p += 8;" + " X = *(ptr)S.p, S.p += 8;" + " Y = *(ptr)S.p, S.p += 8;" + " Z = *(ptr)S.p, S.p += 8;" + " Result = ((ptr)S.p)->n, S.p += 8;" + " Carry = ((ptr)S.p)->l, S.p += 8;" + " PC = *(uint16_t**)S.p, S.p += 8;" + " return res;" "}" NIL "void *argv(int i, ptr p) {" @@ -1400,6 +1404,10 @@ (for I 24 (link (pack "fun" (absCode (pack "cbl" I)))) ) ) ) "};" ) + (prinl) + (prinl "long lisp(char *p, long a, long b, long c, long d, long e) {") + (prinl " return (long)begin(" (absCode "lisp") ", (long)p, a, b, c, d, e);") + (prinl "}") (prinl) ) (prinl (and *FPic "static ") diff --git a/src64/tags b/src64/tags @@ -48,120 +48,6 @@ CHAR_LETTER63,1499 CHAR_DIGIT64,1520 -sys/x86-64.linux.defs.l,1959 -ENOENT5,59 -EINTR6,108 -EBADF7,155 -EAGAIN8,194 -EACCES9,227 -EPIPE10,268 -ECONNRESET11,303 -O_RDONLY14,365 -O_WRONLY15,382 -O_RDWR16,399 -O_CREAT17,414 -O_EXCL18,431 -O_TRUNC19,448 -O_APPEND20,466 -F_GETFD21,486 -F_SETFD22,502 -FD_CLOEXEC23,518 -BUFSIZ26,546 -PIPE_BUF27,564 -MAXPATHLEN29,585 -RTLD_LAZY32,613 -RTLD_GLOBAL33,631 -FLOCK36,662 -L_TYPE37,702 -L_WHENCE38,722 -L_START39,744 -L_LEN40,760 -L_PID41,775 -SEEK_SET42,790 -SEEK_CUR43,807 -F_RDLCK44,824 -F_WRLCK45,840 -F_UNLCK46,856 -F_GETFL47,872 -F_SETFL48,888 -F_GETLK49,904 -F_SETLK50,920 -F_SETLKW51,936 -F_SETOWN52,953 -O_NONBLOCK53,970 -O_ASYNC54,992 -STAT57,1019 -ST_MODE58,1061 -ST_SIZE59,1083 -ST_MTIME60,1100 -S_IFMT61,1118 -S_IFDIR62,1144 -TMS65,1180 -TMS_UTIME66,1214 -TMS_STIME67,1232 -TERMIOS70,1261 -C_IFLAG71,1304 -C_LFLAG72,1320 -C_CC73,1337 -ISIG74,1351 -VMIN75,1364 -VTIME76,1377 -TCSADRAIN77,1391 -SIGACTION80,1419 -SIGSET_T81,1462 -SA_HANDLER82,1481 -SA_MASK83,1500 -SA_FLAGS84,1516 -SIG_DFL86,1536 -SIG_IGN87,1552 -SIG_UNBLOCK88,1568 -SIGHUP90,1589 -SIGINT91,1615 -SIGUSR192,1630 -SIGUSR293,1647 -SIGPIPE94,1664 -SIGALRM95,1681 -SIGTERM96,1698 -SIGCHLD97,1715 -SIGCONT98,1732 -SIGSTOP99,1749 -SIGTSTP100,1766 -SIGTTIN101,1783 -SIGTTOU102,1800 -SIGIO103,1817 -SIGNALS104,1832 -WNOHANG107,1894 -WUNTRACED108,1910 -FD_SET111,1938 -TM_SEC114,1975 -TM_MIN115,1990 -TM_HOUR116,2005 -TM_MDAY117,2021 -TM_MON118,2038 -TM_YEAR119,2054 -D_NAME122,2078 -SOCK_STREAM125,2105 -SOCK_DGRAM126,2125 -AF_UNSPEC127,2144 -AF_INET6128,2162 -SOL_SOCKET129,2180 -SO_REUSEADDR130,2199 -IPPROTO_IPV6131,2220 -IPV6_V6ONLY132,2242 -INET6_ADDRSTRLEN133,2263 -NI_MAXHOST135,2290 -NI_NAMEREQD136,2312 -SOCKADDR_IN6138,2333 -SIN6_FAMILY139,2355 -SIN6_PORT140,2375 -SIN6_ADDR141,2393 -ADDRINFO143,2412 -AI_FAMILY144,2430 -AI_SOCKTYPE145,2448 -AI_ADDRLEN146,2468 -AI_ADDR147,2488 -AI_NEXT148,2505 - ./glob.l,4310 Data4,51 AV7,77 @@ -1252,9 +1138,9 @@ sys/x86-64.linux.defs.l,1959 getUdpZ_FB373,9872 putUdpBZ380,10017 -sys/x86-64.linux.code.l,94 -errno_A5,67 -errnoC10,169 -wifstoppedS_F16,287 -wifsignaledS_F21,413 -wtermsigS_A28,568 +sys/emu.code.l,95 +errno_A8,134 +errnoC16,260 +wifstoppedS_F24,409 +wifsignaledS_F32,570 +wtermsigS_A40,725