Commit graph

201 commits

Author SHA1 Message Date
crc
be7b1ad007 nga-c: add unix:execute
FossilOrigin-Name: d3e589e1fe696182ca97ddbd6065b693459781a074f34899eb3809ef9eedf62e
2021-06-18 13:39:57 +00:00
crc
e8d09ec1ec nga-c-wip: start work on setting up a single struct to hold the system state (#67)
FossilOrigin-Name: ca0e3ee3d97c7188edbb9ef4a86ede7ae2cc141d5d8ed20c33c9ca7a0f400c02
2021-06-11 19:51:42 +00:00
crc
ac848b05f5 nga-c: add retro-wip.c for implementation changes from issue #66
FossilOrigin-Name: 6a36e1b939d5b12e9b5a7a40221a34302ea550abb879efc22460b42075a3dbcc
2021-06-11 19:36:38 +00:00
crc
89570c12b2 nga-c: fix bug in ha instruction
FossilOrigin-Name: b832dc786f8f87be737d11f979d1646675b50d572c154a72d3422a3114160e09
2021-06-09 00:09:05 +00:00
crc
c8a5b047bd image: rename s:index-of, s:index-of-string, a:index-of, a:index-of-string
FossilOrigin-Name: 88416f7a177a6171739a75db5ad4d399735ecd29836424897629ca1787d776d2
2021-06-04 18:34:59 +00:00
crc
06ee9705a8 image: rename some words
s:contains-char?  to  s:contains/char?
s:contains-string? to s:contains/string?
a:contains-string? to a:contains/string?

old names are now deprecated and will be removed after 2021.7.

FossilOrigin-Name: 5a19d7aac514c5ba87963c5f0645f3daa8a8e3dc04546c0627fa046479ecd8dd
2021-06-04 13:54:21 +00:00
crc
ae55f1cd45 image: sigil:: is now a hook point
FossilOrigin-Name: 3f5f0a6728041ad5465a46269d358b64a98d1b4424b5a8376c9ff8e592e419dd
2021-06-04 13:37:42 +00:00
crc
db64b92476 image: use inline assembly for n:inc and n:dec
FossilOrigin-Name: 3e31ec7bcd7ae0c6c415a8dab10709d8525f9b1a369e7a6f7dd9157c18ca06d3
2021-06-04 12:20:10 +00:00
crc
41b3c18145 image: move hook related words to earlier in the image to allow more words to become hooks
FossilOrigin-Name: 15ce16aec360a493a709294e696af8d60fd32a1f36a215430d014dfc40a265f8
2021-06-04 12:07:06 +00:00
crc
fb82418d88 nga-c: fix an issue with script:current-line
specifically, script:current-line was not working. this patch
isn't fully tested, but does fix issues in my test case. it
makes `script:current-line` immediate (so references inside a
definition will actually make sense) and fixes an issue that
was causing indented lines to be counted twice.

since this now skips indention, it should cut down on the
number of evaluations on empty tokens, which will save a little
time when running programs.

FossilOrigin-Name: 0393f609b505ec2a364831078f36ec44b633ea579e7bc0b74a9665c07f08d7ce
2021-06-03 14:07:29 +00:00
crc
edfa9d4a6a image: fix sigil:& to return 0 as expected if name not found (bug identified by rick)
FossilOrigin-Name: 1e0bc9ce4023e9ab03cf73446bcab27a4811571fc102ca14a35bfb5b8413aaed
2021-06-02 03:51:31 +00:00
crc
413ccb3ac8 glossary: clarify that sigil:& returns 0 if word not found
FossilOrigin-Name: e949baafbacd0f29c688b55207db750d5abf80293d35dc045b192e1dee1d9a41
2021-06-02 03:38:07 +00:00
crc
5d37b57745 image: fix buffer overflow in n:to-string
FossilOrigin-Name: 34b4036e1a1de88c059168442b122400e6623917ba44b01758ae59cda1d4b89d
2021-06-02 03:23:12 +00:00
crc
0307e57fdc add test images for each instruction excluding i/o
the tests now include a small muri assembly file for each
instruction. if your vm runs these successfully and supports
basic i/o, it should be sufficient to run a full retro system.

FossilOrigin-Name: b80eaeb75ee2b4476f5b5a4aa62adf76da3ed11ac3b2f493f77d9bd4366f8ea9
2021-06-01 19:00:48 +00:00
crc
91aa668160 retro-compiler: fix a duplicate #define
FossilOrigin-Name: 3a84e4797f2d2e039c029607ee2e39d09a1e16ec6622e6a931169444411e4603
2021-06-01 13:44:53 +00:00
crc
aa99e1b54a nga-c: -t now takes a command line argument for the file name
this closes #63. rick noted that -t is not consistent with -f,
the changes here address this. -f now loads code blocks from a
file, and -t will load both code and test blocks.

FossilOrigin-Name: b32065ff68714f4c6b86e17da44c4778a0ce9ceb7db81a3466edd3da312d47e0
2021-06-01 13:42:30 +00:00
crc
cfd4e9ea15 floating point: increase precision in f:E and f:PI
FossilOrigin-Name: bd213f06612c3c2c2a71cb1bce2fe55d991ef8801f81152e354981f407602c5b
2021-05-31 00:14:34 +00:00
crc
b2c21faca4 image: under 1024 cells again
FossilOrigin-Name: 06bfab86c32a1b9271c726667d79d8b985b5c4a106b21c630468699fe4f90f78
2021-05-30 22:01:54 +00:00
crc
0235d20ad5 image: correct a comment; reduce footprint by 1 cell
FossilOrigin-Name: 5494777637dca11853168e79222ffebf3d9e6c2022ec5978b154fa4fc74537c6
2021-05-30 21:49:28 +00:00
crc
c1f00b2458 nga-c: dump stack if execution returns to main after interactive or run image mode
FossilOrigin-Name: e9539243b7437f60d823ad012a3fea63a504203781f0ae4f1802375a883da8f6
2021-05-28 19:24:16 +00:00
crc
f9d0e9e603 nga-c: fix -r command line handling
FossilOrigin-Name: ef0817e9ffea751d0ad511abaf2e862c6058a0b0432564b9715a5cc37519c998
2021-05-28 19:12:33 +00:00
crc
e906676d22 retro-unix: the old TIB was hard coded, use the stored pointer at address 7 now.
this fixes a buffer overrun that caused the `err:notfound` header to be messed up.

i also policed some whitespace and removed obsolete comments in a few files.

FossilOrigin-Name: 4db7040fbc6a4f73e7da6a32de89de915aca6d33137afd04f8d5b3368612b214
2021-05-28 18:58:21 +00:00
crc
c2b9016d86 c:get is now vectored
FossilOrigin-Name: 29f8192c8a5290592bf646704ac339a807e8cc8de8776c3b9c4a089bf06a002e
2021-05-28 11:07:40 +00:00
crc
9e767e0a10 forgot to include aliases for the deprecated words
FossilOrigin-Name: 3f2761d7ce1c4d062e4dddc57a8908989acc900355f6822313ffa599d3bb7d04
2021-05-25 17:22:21 +00:00
crc
13ecc59a18 deprecate s:split, s:split-on-string. Use s:split/char and s:split/string instead.
FossilOrigin-Name: 8514ad5c60cc7c2f34ffd651bd74f477a582d04609b3bba546a1c702963fae94
2021-05-25 14:35:26 +00:00
crc
c3adf4c594 reduce kernel by 3 cells
FossilOrigin-Name: e551008a2d0fddeb2c5a85c0434c1f6b201e800f590a9f1ff26f1612ae4ca29d
2021-05-18 19:59:11 +00:00
crc
cb22c59b5a add support multiple bases
This set of patches:

- adds a `Base` variable
- adds `decimal`, `hex`, `octal`, and `binary`
- extends `s:to-number` to support `Base`
- extends `n:to-string` to support `Base`
- updates the glossary to cover these

Additionally:

- removes the 1024 cell limit for the kernel
- adds a header cell (7) for the start of the text input buffer
- adds a header cell (8) for the end of the text input buffer
- updates most Nga implementations that use the text input buffer to look at
  this instead of hard coding the address

FossilOrigin-Name: 391ad6fc0187e5ff3089d5c42d5d5e1c18fd0b2379c90a148ba44bb66145f020
2021-05-18 19:42:35 +00:00
crc
4a63074a63 nga-c: include stdint.h
FossilOrigin-Name: acf4dbeadd2cea4c7fd55d58f2b0cdde5b5d64171fe4bda1554d1baf82371381
2021-05-18 13:46:28 +00:00
crc
c45816157f work on the retro-compiler
specifically:

- remove old runtime implementation
- use the standard retro.c as basis of new runtime
- remove old files
- update Makefile

this does not address issue #3.

FossilOrigin-Name: 959bab6910c41cd3ce24bf46d3b9b61bb83864edb25afc5148e7023ffd58fbf5
2021-05-18 12:42:15 +00:00
crc
27c074fa00 in which many things change...
- the basic image now contains a minimal listener
- new repl.c uses the embedded listener rather than
  implementing the listener in C
- removed barebones.c as it's no longer needed (overlapped
  w/repl.c)
- removed retro-unix.c (use retro.c instead)
- removed retro-windows.c (use retro.c instead)
- removed retro-image.c (use image.c instead)

FossilOrigin-Name: 21cea9bf556aef732fd9248de2debaf00dce24304a426c56392d503723728f43
2021-05-17 17:18:27 +00:00
crc
8aaff8c471 nga-c: small cleanups to i/o instruction handlers
FossilOrigin-Name: f2e489705e6cdc757e5aa3dba3cc1cb0fa592806209a9861452352264a6dde61
2021-05-17 14:15:28 +00:00
crc
f5bcba0fb9 nga-c: avoid a multiplication in the shift instruction
FossilOrigin-Name: de286be9c667c2f531b210f4f6b9a67b0adb7510a6f439b3890f2273e8fb90f2
2021-05-17 14:10:25 +00:00
crc
5509f7acdb nga-c: retro.c now uses new image changes to avoid needing to add in dictionary searches
FossilOrigin-Name: 7cea93908f51dd1803de48216833e0887719882783ed104a93cfa6069b203144
2021-05-17 13:16:56 +00:00
crc
0c3af65b97 image: address 6 now holds a pointer to err:notfound
FossilOrigin-Name: 25bd5c151592e0aa1ad4a6d8c326e33d2610836f21c0b587a8080a418e04bfe3
2021-05-17 13:09:52 +00:00
crc
ec2d0b13c9 retro.muri: address 5 is now a pointer to interpret
FossilOrigin-Name: 22ed95c6a44f68e92ddbc6e53cea8a6057a78f84e63d509c5e295db20b56afb3
2021-05-12 14:01:59 +00:00
crc
8c441b820f whitespace cleanups, add back -h startup option
FossilOrigin-Name: aa18384826a4134b64001c9b64b15bfd84f1d1326e1613da8dbdcc6c7a3a3631
2021-04-30 15:09:01 +00:00
crc
763f06ac4c add if: and -if:
FossilOrigin-Name: 04cd5d82ce6ea0c9c98f05580bcb7cc2598c27accd6a648cacb98b063d72e1a5
2021-04-28 13:23:07 +00:00
crc
770f492359 prepare to begin work on 2021.7
FossilOrigin-Name: 95216e8fb2f2f27d6867ce34183b758eda029646f846ab982abf6e10997318c8
2021-04-28 13:06:30 +00:00
crc
e82794ec72 nga-c: 64-bit builds should be working again
FossilOrigin-Name: 3a2a50361818026ba8b7e6d3082c6c44ae170b51801f329caf037aad0db1e9c9
2021-04-22 13:45:32 +00:00
crc
f90f4d02a2 nga-c: undefine NEEDS_STRL when building on macOS (should fix remaining part of #58)
FossilOrigin-Name: 02868ee48d5ab194f7a754bcc24c44664a4054571f4a3f41fd55562676b0ca9c
2021-04-21 12:00:17 +00:00
crc
3e3dfa9ddc nga-c: more fixes related to issue #58
FossilOrigin-Name: 20fcceb6ce817b2c94f11ca78e795923701d0c944049662597ab70cc0cc7dc03
2021-04-21 11:48:47 +00:00
crc
d183ac683e nga-c: work on fixing 64-bit builds (#58)
FossilOrigin-Name: e0cc2eb948780a910ec1dfe9d34783c8e9bacbbc1af3630749432e0f4217391f
2021-04-21 11:41:26 +00:00
crc
29bdd46091 nga-c: attempt to fix compiler warnings (issue #57)
FossilOrigin-Name: 7c306b487a9d688b74dc798fd4437b87e71ad9540cfa4d4c73fb2c43cf8f5751
2021-04-20 19:57:31 +00:00
crc
c392a9bfd5 interface/unix: reduce size of io:unix-syscall
FossilOrigin-Name: 74558b75eec0df5a42815a73158f82455cdcced3e8156fc175f81b44186520a8
2021-04-19 17:43:03 +00:00
crc
00f3e53a83 interface/scripting: refactor to reduce size
FossilOrigin-Name: a9419952603779684fcc5d626b394a66f17d8d5fa6d41a941c251da6b8b29506
2021-04-19 17:41:14 +00:00
crc
4d0c80823b interface/filesystem: smaller file:operation
FossilOrigin-Name: e000d1fab7c5b3cbab520a2a5e74bf299cc674edb8b5ebab3c26f6cd29571839
2021-04-19 17:38:47 +00:00
crc
98a6a30db9 interfaces/floatingpoint: smaller io:float-operation
FossilOrigin-Name: 05a362eea49314fe8f9d942c773be1685d845166a48f0201bfbd2e7af16829aa
2021-04-19 17:37:16 +00:00
crc
5ba34b60a9 interfaces/rng: smaller n:random, remove io:rng-operation
FossilOrigin-Name: 893637993c41b36f620410fe489d25d5cb9d08d41dd80f9097b3c193fd54cc92
2021-04-19 17:35:29 +00:00
crc
cd47df06c9 interfaces/clock: reduce size of clock:operation
FossilOrigin-Name: abb9e847ac79f6f8f1782afed5b85030984d4f5db0389932556fe21e1ce96f2b
2021-04-19 17:32:15 +00:00
crc
755f064f62 update Makefile to use new nga-c sources, fix amalgamate tool for changes
FossilOrigin-Name: 5837a410e388941d6cb5822732bcd3d003aa313af0d54c548c662883de01c164
2021-04-19 17:28:08 +00:00