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 96e24fbc73b24994b996680cde1b63d5d024cbfc
parent 87daff78e218066737357eebc883228f180393c8
Author: Alexander Burger <abu@software-lab.de>
Date:   Thu, 25 Oct 2012 18:30:21 +0200

emu64 continued
Diffstat:
Mdoc64/asm | 3++-
Mlib/map | 42+++++++++++++++++++++---------------------
Msrc64/arch/emu.l | 12+++++++-----
Msrc64/arch/ppc64.l | 4+++-
Msrc64/arch/x86-64.l | 4+++-
Msrc64/lib/asm.l | 3++-
Msrc64/main.l | 3++-
Msrc64/tags | 140++++++++++++++++++++++++++++++++++++++++----------------------------------------
8 files changed, 110 insertions(+), 101 deletions(-)

diff --git a/doc64/asm b/doc64/asm @@ -1,4 +1,4 @@ -# 07oct12abu +# 24oct12abu # (c) Software Lab. Alexander Burger @@ -192,6 +192,7 @@ initData # Init runtime data initCode # Init runtime code initMain # Command in X, arguments in Y, last pointer in Z + initLib # Library function pointer in A ======================================================================== diff --git a/lib/map b/lib/map @@ -32,9 +32,9 @@ and (1613 . "@src64/flow.l") any (3965 . "@src64/io.l") append (1338 . "@src64/subr.l") apply (713 . "@src64/apply.l") -arg (2367 . "@src64/main.l") -args (2343 . "@src64/main.l") -argv (2990 . "@src64/main.l") +arg (2368 . "@src64/main.l") +args (2344 . "@src64/main.l") +argv (2991 . "@src64/main.l") as (139 . "@src64/flow.l") asoq (3008 . "@src64/subr.l") assoc (2973 . "@src64/subr.l") @@ -65,7 +65,7 @@ call (3079 . "@src64/flow.l") car (5 . "@src64/subr.l") case (1954 . "@src64/flow.l") catch (2456 . "@src64/flow.l") -cd (2742 . "@src64/main.l") +cd (2743 . "@src64/main.l") cdaaar (464 . "@src64/subr.l") cdaadr (487 . "@src64/subr.l") cdaar (179 . "@src64/subr.l") @@ -88,7 +88,7 @@ circ (816 . "@src64/subr.l") circ? (2402 . "@src64/subr.l") clip (1799 . "@src64/subr.l") close (4378 . "@src64/io.l") -cmd (2972 . "@src64/main.l") +cmd (2973 . "@src64/main.l") cnt (1413 . "@src64/apply.l") co (2537 . "@src64/flow.l") commit (1498 . "@src64/db.l") @@ -99,9 +99,9 @@ connect (224 . "@src64/net.l") cons (747 . "@src64/subr.l") copy (1225 . "@src64/subr.l") ctl (4251 . "@src64/io.l") -ctty (2767 . "@src64/main.l") +ctty (2768 . "@src64/main.l") cut (1922 . "@src64/sym.l") -date (2481 . "@src64/main.l") +date (2482 . "@src64/main.l") dbck (2113 . "@src64/db.l") de (532 . "@src64/flow.l") dec (2323 . "@src64/big.l") @@ -111,7 +111,7 @@ del (1977 . "@src64/sym.l") delete (1401 . "@src64/subr.l") delq (1452 . "@src64/subr.l") diff (2589 . "@src64/subr.l") -dir (2902 . "@src64/main.l") +dir (2903 . "@src64/main.l") dm (545 . "@src64/flow.l") do (2130 . "@src64/flow.l") e (2911 . "@src64/flow.l") @@ -120,7 +120,7 @@ env (599 . "@src64/main.l") eof (3524 . "@src64/io.l") eol (3515 . "@src64/io.l") err (4231 . "@src64/io.l") -errno (1370 . "@src64/main.l") +errno (1371 . "@src64/main.l") eval (175 . "@src64/flow.l") ext (5143 . "@src64/io.l") ext? (1157 . "@src64/sym.l") @@ -128,7 +128,7 @@ extern (1023 . "@src64/sym.l") extra (1258 . "@src64/flow.l") extract (1218 . "@src64/apply.l") fifo (2088 . "@src64/sym.l") -file (2849 . "@src64/main.l") +file (2850 . "@src64/main.l") fill (3243 . "@src64/subr.l") filter (1161 . "@src64/apply.l") fin (2033 . "@src64/subr.l") @@ -166,7 +166,7 @@ ifn (1854 . "@src64/flow.l") in (4191 . "@src64/io.l") inc (2256 . "@src64/big.l") index (2637 . "@src64/subr.l") -info (2804 . "@src64/main.l") +info (2805 . "@src64/main.l") intern (998 . "@src64/sym.l") ipid (3198 . "@src64/flow.l") isa (961 . "@src64/flow.l") @@ -183,7 +183,7 @@ lieu (1157 . "@src64/db.l") line (3699 . "@src64/io.l") lines (3852 . "@src64/io.l") link (1172 . "@src64/subr.l") -lisp (2039 . "@src64/main.l") +lisp (2040 . "@src64/main.l") list (887 . "@src64/subr.l") listen (157 . "@src64/net.l") lit (150 . "@src64/flow.l") @@ -222,10 +222,10 @@ n== (2087 . "@src64/subr.l") nT (2198 . "@src64/subr.l") name (502 . "@src64/sym.l") nand (1648 . "@src64/flow.l") -native (1378 . "@src64/main.l") +native (1379 . "@src64/main.l") need (919 . "@src64/subr.l") new (835 . "@src64/flow.l") -next (2350 . "@src64/main.l") +next (2351 . "@src64/main.l") nil (1731 . "@src64/flow.l") nond (1931 . "@src64/flow.l") nor (1669 . "@src64/flow.l") @@ -239,7 +239,7 @@ onOff (1738 . "@src64/sym.l") one (1771 . "@src64/sym.l") open (4335 . "@src64/io.l") opid (3214 . "@src64/flow.l") -opt (3093 . "@src64/main.l") +opt (3094 . "@src64/main.l") or (1629 . "@src64/flow.l") out (4211 . "@src64/io.l") pack (1270 . "@src64/sym.l") @@ -272,7 +272,7 @@ push (1813 . "@src64/sym.l") push1 (1849 . "@src64/sym.l") put (2835 . "@src64/sym.l") putl (3113 . "@src64/sym.l") -pwd (2731 . "@src64/main.l") +pwd (2732 . "@src64/main.l") queue (2045 . "@src64/sym.l") quit (1085 . "@src64/main.l") quote (134 . "@src64/flow.l") @@ -283,7 +283,7 @@ raw (451 . "@src64/main.l") rd (5160 . "@src64/io.l") read (2656 . "@src64/io.l") replace (1499 . "@src64/subr.l") -rest (2396 . "@src64/main.l") +rest (2397 . "@src64/main.l") reverse (1678 . "@src64/subr.l") rewind (5126 . "@src64/io.l") rollback (1898 . "@src64/db.l") @@ -309,7 +309,7 @@ stem (1989 . "@src64/subr.l") str (4019 . "@src64/io.l") str? (1136 . "@src64/sym.l") strip (1576 . "@src64/subr.l") -struct (1830 . "@src64/main.l") +struct (1831 . "@src64/main.l") sub? (1569 . "@src64/sym.l") sum (1460 . "@src64/apply.l") super (1214 . "@src64/flow.l") @@ -325,7 +325,7 @@ text (1398 . "@src64/sym.l") throw (2482 . "@src64/flow.l") tick (3166 . "@src64/flow.l") till (3610 . "@src64/io.l") -time (2614 . "@src64/main.l") +time (2615 . "@src64/main.l") touch (1172 . "@src64/sym.l") trim (1759 . "@src64/subr.l") try (1168 . "@src64/flow.l") @@ -338,9 +338,9 @@ up (693 . "@src64/main.l") upp? (3393 . "@src64/sym.l") uppc (3460 . "@src64/sym.l") use (1562 . "@src64/flow.l") -usec (2719 . "@src64/main.l") +usec (2720 . "@src64/main.l") val (1588 . "@src64/sym.l") -version (3107 . "@src64/main.l") +version (3108 . "@src64/main.l") wait (3150 . "@src64/io.l") when (1873 . "@src64/flow.l") while (2050 . "@src64/flow.l") diff --git a/src64/arch/emu.l b/src64/arch/emu.l @@ -1,4 +1,4 @@ -# 24oct12abu +# 25oct12abu # (c) Software Lab. Alexander Burger # Byte order @@ -214,9 +214,7 @@ (cons "X" ~(as *Dbg (pack - "fprintf(stderr, \"%d: %s\\n\", PC-" - (if *FPic "LibCode" "Code") - "-1, \"" + "fprintf(stderr, \"%d: %s\\n\", Code<=PC && PC<Code+32767? PC-Code-1 : 0, \"" (fmtInstruction "X") "\");" ) ) (mapcar '((S) (apply text "Args" S)) "Body") ) ) @@ -975,6 +973,10 @@ (asm initMain ()) # Done explicitly in 'main' +(asm initLib () + (genCode NIL '(initLib) NIL + "A.p = *(uint8_t**)A.p;" ) ) + ### Optimizer ### # Replace the the next 'cnt' elements with 'lst' (de optimize (Lst)) #> (cnt . lst) @@ -1268,7 +1270,7 @@ (prinl "};") (prinl) (when *FPic - (for S (idx '*Labels) + (for S (by val sort (idx '*Labels)) (unless (pre? "." S) # Omit local labels (prinl "uint16_t *" S " = LibCode + " (val S) ";") ) ) (prinl) ) diff --git a/src64/arch/ppc64.l b/src64/arch/ppc64.l @@ -1,4 +1,4 @@ -# 19oct12abu +# 24oct12abu # (c) Software Lab. Alexander Burger # Byte order @@ -1553,6 +1553,8 @@ (prinst "sldi" 3 3 3) (prinst "add" 18 4 3) ) +(asm initLib ()) + ### Optimizer ### # Replace the the next 'cnt' elements with 'lst' (de optimize (Lst) #> (cnt . lst) diff --git a/src64/arch/x86-64.l b/src64/arch/x86-64.l @@ -1,4 +1,4 @@ -# 20oct12abu +# 24oct12abu # (c) Software Lab. Alexander Burger # Byte order @@ -964,6 +964,8 @@ (prinst "lea" "8(%rsi)" "%r14") # argument vector in Y (prinst "lea" "-8(%rsi,%rdi,8)" "%r15") ) # pointer to last argument in Z +(asm initLib ()) + ### Optimizer ### # Replace the the next 'cnt' elements with 'lst' (de optimize (Lst)) #> (cnt . lst) diff --git a/src64/lib/asm.l b/src64/lib/asm.l @@ -1,4 +1,4 @@ -# 17oct12abu +# 24oct12abu # (c) Software Lab. Alexander Burger # *LittleEndian *AlignedCode *Registers optimize @@ -427,6 +427,7 @@ (initCode) (initData) (initFun (file) (read) (read) (operand (read))) + (initLib) (initMain) (initSym (file) (read) (read) (operand (read))) (jc (address) "*Mode") diff --git a/src64/main.l b/src64/main.l @@ -1,4 +1,4 @@ -# 02oct12abu +# 24oct12abu # (c) Software Lab. Alexander Burger (code 'Code) @@ -1353,6 +1353,7 @@ cc dlsym(A Y) # Find dynamic symbol null A # OK? if nz # Yes + initLib ? *AlignedCode or A CNT # Make short number = diff --git a/src64/tags b/src64/tags @@ -425,12 +425,12 @@ badFdErrEX err.l 531 badInputErrB err.l 551 balanceCEY sym.l 910 balanceXY sym.l 892 -begString main.l 2305 +begString main.l 2306 binPrintEZ io.l 731 binReadZ_FE io.l 520 blkPeekCEZ db.l 392 blkPokeCEZ db.l 403 -boxE_E main.l 2273 +boxE_E main.l 2274 boxNumA_A gc.l 872 boxNumE_E gc.l 886 boxNum_A gc.l 824 @@ -446,31 +446,31 @@ byteNumBCX_CX io.l 464 byteSymBCX_CX io.l 1292 caseDataA_AC sym.l 3366 caught flow.l 2472 -cbl main.l 1908 -cbl1 main.l 1941 -cbl10 main.l 1977 -cbl11 main.l 1981 -cbl12 main.l 1985 -cbl13 main.l 1989 -cbl14 main.l 1993 -cbl15 main.l 1997 -cbl16 main.l 2001 -cbl17 main.l 2005 -cbl18 main.l 2009 -cbl19 main.l 2013 -cbl2 main.l 1945 -cbl20 main.l 2017 -cbl21 main.l 2021 -cbl22 main.l 2025 -cbl23 main.l 2029 -cbl24 main.l 2033 -cbl3 main.l 1949 -cbl4 main.l 1953 -cbl5 main.l 1957 -cbl6 main.l 1961 -cbl7 main.l 1965 -cbl8 main.l 1969 -cbl9 main.l 1973 +cbl main.l 1909 +cbl1 main.l 1942 +cbl10 main.l 1978 +cbl11 main.l 1982 +cbl12 main.l 1986 +cbl13 main.l 1990 +cbl14 main.l 1994 +cbl15 main.l 1998 +cbl16 main.l 2002 +cbl17 main.l 2006 +cbl18 main.l 2010 +cbl19 main.l 2014 +cbl2 main.l 1946 +cbl20 main.l 2018 +cbl21 main.l 2022 +cbl22 main.l 2026 +cbl23 main.l 2030 +cbl24 main.l 2034 +cbl3 main.l 1950 +cbl4 main.l 1954 +cbl5 main.l 1958 +cbl6 main.l 1962 +cbl7 main.l 1966 +cbl8 main.l 1970 +cbl9 main.l 1974 charSymACX_CX io.l 1257 checkVarAX err.l 371 checkVarEX err.l 387 @@ -532,7 +532,7 @@ ctOpenEXY io.l 1671 currFdX_C io.l 1334 currFd_C io.l 1338 cutLocalCX flow.l 2824 -dateXYZ_E main.l 2420 +dateXYZ_E main.l 2421 dbAEX db.l 1331 dbFetchEX db.l 1319 dbFileBlkY_AC db.l 246 @@ -562,9 +562,9 @@ doAnd flow.l 1613 doAny io.l 3965 doAppend subr.l 1338 doApply apply.l 713 -doArg main.l 2367 -doArgs main.l 2343 -doArgv main.l 2990 +doArg main.l 2368 +doArgs main.l 2344 +doArgv main.l 2991 doArrow subr.l 3916 doAs flow.l 139 doAsoq subr.l 3008 @@ -600,7 +600,7 @@ doCall flow.l 3079 doCar subr.l 5 doCase flow.l 1954 doCatch flow.l 2456 -doCd main.l 2742 +doCd main.l 2743 doCdaaar subr.l 464 doCdaadr subr.l 487 doCdaar subr.l 179 @@ -623,7 +623,7 @@ doCirc subr.l 816 doCircQ subr.l 2402 doClip subr.l 1799 doClose io.l 4378 -doCmd main.l 2972 +doCmd main.l 2973 doCnt apply.l 1413 doCo flow.l 2537 doCol sym.l 3051 @@ -635,9 +635,9 @@ doConnect net.l 224 doCons subr.l 747 doCopy subr.l 1225 doCtl io.l 4251 -doCtty main.l 2767 +doCtty main.l 2768 doCut sym.l 1922 -doDate main.l 2481 +doDate main.l 2482 doDbck db.l 2113 doDe flow.l 532 doDec big.l 2323 @@ -647,7 +647,7 @@ doDel sym.l 1977 doDelete subr.l 1401 doDelq subr.l 1452 doDiff subr.l 2589 -doDir main.l 2902 +doDir main.l 2903 doDiv big.l 2513 doDm flow.l 545 doDo flow.l 2130 @@ -661,7 +661,7 @@ doEq0 subr.l 2173 doEqT subr.l 2181 doEqual subr.l 2115 doErr io.l 4231 -doErrno main.l 1370 +doErrno main.l 1371 doEval flow.l 175 doExt io.l 5143 doExtQ sym.l 1157 @@ -669,7 +669,7 @@ doExtern sym.l 1023 doExtra flow.l 1258 doExtract apply.l 1218 doFifo sym.l 2088 -doFile main.l 2849 +doFile main.l 2850 doFill subr.l 3243 doFilter apply.l 1161 doFin subr.l 2033 @@ -710,7 +710,7 @@ doIfn flow.l 1854 doIn io.l 4191 doInc big.l 2256 doIndex subr.l 2637 -doInfo main.l 2804 +doInfo main.l 2805 doIntern sym.l 998 doIpid flow.l 3198 doIsa flow.l 961 @@ -728,7 +728,7 @@ doLieu db.l 1157 doLine io.l 3699 doLines io.l 3852 doLink subr.l 1172 -doLisp main.l 2039 +doLisp main.l 2040 doList subr.l 887 doListen net.l 157 doLit flow.l 150 @@ -771,10 +771,10 @@ doNEqT subr.l 2198 doNEqual subr.l 2144 doName sym.l 502 doNand flow.l 1648 -doNative main.l 1378 +doNative main.l 1379 doNeed subr.l 919 doNew flow.l 835 -doNext main.l 2350 +doNext main.l 2351 doNil flow.l 1731 doNond flow.l 1931 doNor flow.l 1669 @@ -788,7 +788,7 @@ doOnOff sym.l 1738 doOne sym.l 1771 doOpen io.l 4335 doOpid flow.l 3214 -doOpt main.l 3093 +doOpt main.l 3094 doOr flow.l 1629 doOut io.l 4211 doPack sym.l 1270 @@ -822,7 +822,7 @@ doPush sym.l 1813 doPush1 sym.l 1849 doPut sym.l 2835 doPutl sym.l 3113 -doPwd main.l 2731 +doPwd main.l 2732 doQueue sym.l 2045 doQuit main.l 1085 doQuote flow.l 134 @@ -834,7 +834,7 @@ doRd io.l 5160 doRead io.l 2656 doRem big.l 2572 doReplace subr.l 1499 -doRest main.l 2396 +doRest main.l 2397 doReverse subr.l 1678 doRewind io.l 5126 doRollback db.l 1898 @@ -863,7 +863,7 @@ doStem subr.l 1989 doStr io.l 4019 doStrQ sym.l 1136 doStrip subr.l 1576 -doStruct main.l 1830 +doStruct main.l 1831 doSub big.l 2209 doSubQ sym.l 1569 doSum apply.l 1460 @@ -880,7 +880,7 @@ doText sym.l 1398 doThrow flow.l 2482 doTick flow.l 3166 doTill io.l 3610 -doTime main.l 2614 +doTime main.l 2615 doTouch sym.l 1172 doTrace flow.l 2950 doTrim subr.l 1759 @@ -894,9 +894,9 @@ doUp main.l 693 doUppQ sym.l 3393 doUppc sym.l 3460 doUse flow.l 1562 -doUsec main.l 2719 +doUsec main.l 2720 doVal sym.l 1588 -doVersion main.l 3107 +doVersion main.l 3108 doWait io.l 3150 doWhen flow.l 1873 doWhile flow.l 2050 @@ -909,7 +909,7 @@ doYield flow.l 2706 doYoke subr.l 1196 doZap sym.l 1186 doZero sym.l 1756 -endString_E main.l 2316 +endString_E main.l 2317 eofErr err.l 540 eolA_F io.l 3684 equalAE_F main.l 772 @@ -918,15 +918,15 @@ errEXYZ err.l 33 errnoC sys/x86-64.linux.code.l 10 errnoEXY err.l 24 errno_A sys/x86-64.linux.code.l 5 -evCntEX_FE main.l 2244 -evCntXY_FE main.l 2242 +evCntEX_FE main.l 2245 +evCntXY_FE main.l 2243 evExprCE_E main.l 1103 evListE_E main.l 1247 evMethodACXYZ_E flow.l 645 -evSymE_E main.l 2219 -evSymX_E main.l 2214 -evSymY_E main.l 2217 -execE main.l 2128 +evSymE_E main.l 2220 +evSymX_E main.l 2215 +evSymY_E main.l 2218 +execE main.l 2129 execErrS main.l 187 extErrEX err.l 440 extNmCE_X db.l 64 @@ -936,7 +936,7 @@ fdRdSetCZL io.l 2718 fdSetCL_X io.l 2706 fdSetC_Y io.l 3309 fdWrSetCZL io.l 2725 -fetchCharC_AC main.l 1873 +fetchCharC_AC main.l 1874 fileObjE_AC db.l 237 fileObjX_AC db.l 211 fillE_FE subr.l 3261 @@ -954,7 +954,7 @@ fmtWordACX_CX big.l 2046 forkErrX err.l 521 forkLispX_FE flow.l 3266 fsyncDB db.l 932 -funqE_FE main.l 2152 +funqE_FE main.l 2153 gc gc.l 65 getAdrZ_A db.l 6 getBinaryZ_FB io.l 448 @@ -996,7 +996,7 @@ isaCE_F flow.l 1012 jnlErrX err.l 624 jnlFileno_A db.l 344 joinLocalCX flow.l 2837 -lisp main.l 2082 +lisp main.l 2083 loadAllX_E main.l 162 loadBEX_E io.l 4072 lockErr err.l 613 @@ -1020,7 +1020,7 @@ methodEY_FCYZ flow.l 791 mkCharA_A sym.l 573 mkStrEZ_A sym.l 650 mkStrE_E sym.l 623 -msec_A main.l 2330 +msec_A main.l 2331 msgErrAX err.l 494 msgErrEX err.l 496 msgErrYX err.l 492 @@ -1029,8 +1029,8 @@ nameA_A sym.l 469 nameE_E sym.l 477 nameX_X sym.l 485 nameY_Y sym.l 493 -natBufACZ_CZ main.l 1582 -natRetACE_CE main.l 1681 +natBufACZ_CZ main.l 1583 +natRetACE_CE main.l 1682 needC gc.l 54 needSymAX err.l 329 needSymEX err.l 341 @@ -1088,7 +1088,7 @@ putACE sym.l 2491 putBlockBZ db.l 612 putSrcEC_E flow.l 25 putStdoutB io.l 4622 -putStringB main.l 2293 +putStringB main.l 2294 putTellBZ io.l 997 putUdpBZ net.l 377 rdAtomBY_E io.l 2118 @@ -1125,7 +1125,7 @@ retnc err.l 716 retnz err.l 722 retz err.l 719 rewindLog db.l 928 -runE_E main.l 2140 +runE_E main.l 2141 rwUnlockDbA db.l 269 selectErrX err.l 564 serverCEY_FE net.l 273 @@ -1174,8 +1174,8 @@ tellErr err.l 652 tenfoldA_A big.l 157 testEscA_F io.l 2051 throwErrZX flow.l 2507 -tmDateC_E main.l 2410 -tmTimeY_E main.l 2597 +tmDateC_E main.l 2411 +tmTimeY_E main.l 2598 tokenCE_E io.l 2522 trSyncErrX err.l 608 traceCY flow.l 3022 @@ -1216,10 +1216,10 @@ wrOpenEXY io.l 1496 wrSetCL_F io.l 2737 wrSyncErrX err.l 581 wtermsigS_A sys/x86-64.linux.code.l 28 -xCntAX_FA main.l 2264 -xCntCX_FC main.l 2255 -xCntEX_FE main.l 2246 -xSymE_E main.l 2221 +xCntAX_FA main.l 2265 +xCntCX_FC main.l 2256 +xCntEX_FE main.l 2247 +xSymE_E main.l 2222 xoruAE_A big.l 465 yieldErrEX err.l 488 yieldErrX err.l 486