Commit Graph

44 Commits

Author SHA1 Message Date
Andrius Štikonas 279941646f
Fix a typo:
Recieved -> Received
2019-10-23 20:01:23 +01:00
Jeremiah Orians 3309e6325e
Correcting the behavior of R@ 2017-09-16 07:41:22 -04:00
Jeremiah Orians 5b302ba9d0
Actually write to the desired output 2017-07-13 22:01:25 -04:00
Jeremiah Orians 4963fcfebc
Implemented graceful FAILURE and PRINT 2017-06-24 10:06:50 -04:00
Jeremiah Orians a51c243088
Implementing LSHIFT and RSHIFT per request 2017-06-24 08:49:08 -04:00
Jeremiah Orians 37b061defc
Ensure changelog, checksums and whitespacing rules are updated and enforced 2017-06-24 08:14:31 -04:00
Caleb Ristvedt 1a6c7d5afe
Fix CREATE, implement DOES>, more words
Implemented some new words in forth.s:
* 'DODOES
  Gives the address of the assembly for DODOES. Used by DOES> when compiling
  machine code to jump to it and activate the following high-level forth
  code. This is how non-primitive actions for a word can be set.
* LATEST!
  Sets the LATEST pointer. For when the user wants to write their own way of
  extending the dictionary (word lists, vocabularies, etc).
* R@
  Copies the top of the return stack to the data stack. Useful for when loops
  start getting non-trivial and you start wondering of all those ROTs aren't
  efficient enough. Maybe someday we'll implement a register-allocating
  compiler. Probably not. Too complicated for bootstrapping.
* Not really words but used: DODOES and DOVAR.
  DOVAR is the default behavior of CREATEd words - it just pushes a pointer to
  whatever was allotted right after the word was created. DODOES is jumped to in
  order to invoke high-level forth behaviors for words.
* Changed behavior of CREATE to better match the way it usually works.

Added some words to inital_library.fs (we should fix that name sometime):
* Added a variable BASE to control what base numbers are printed in.
* Turns out I misunderstood what WORD did and mis-diagnosed an early problem in
  ' - so it turns out that nothing was being allotted in the dictionary, just
  stuff in "string space", which if I understand properly just sort of fills up
  infinitely as long as WORD is being invoked. Some other forths try to solve
  this by introducing an input buffer for the current line, at the cost of some
  complexity (as words like [CHAR] and S" have to take that into
  account). Anyway, the HERE and DP! are gone from ' now.
* Added BOUNDS for common setup for sequence-iterating loops.
* Added region-comment "(" (note that it doesn't nest), used most often for
  stack comments.
* Added hex dump printer DUMP and support words, number of bytes printed per
  line is controlled by LINE-SIZE. It looks pretty nice, much of the design is
  based off of gforth's.
* Added DOES> and supporting words, and used it to make VARIABLE, CONSTANT, and
  DEFER.
* Added TUCK, MIN, SPACES, :NONAME, FILL, and <>.

Add LSHIFT and RSHIFT to the wishlist, as ghetto shifting with division seems to
behave a bit strangely when given negative values.

Also, we're now advanced enough to support the tictactoe I wrote awhile back for
gforth! http://paste.lisp.org/display/349394
2017-06-24 07:40:22 -04:00
Jeremiah Orians 800c867085
Altered EXECUTE into indirection 2017-06-17 22:27:15 -04:00
Jeremiah Orians 3b05f83e6a
Fixed the Carriage return issue and CMOVE zeroing issue 2017-06-17 22:05:33 -04:00
Jeremiah Orians b3eedb60de
Refining FORTH to enable more productive development 2017-06-17 00:02:33 -04:00
Jeremiah Orians 97a145ac1f
Enabled support for HIDDEN Flag 2017-06-16 18:08:33 -04:00
Jeremiah Orians c43171c7d2
Added requested ABORT function to forth 2017-06-16 17:43:57 -04:00
Jeremiah Orians 8b0384b370
Added an EXECUTE command primitive to stage2 forth 2017-06-16 16:36:03 -04:00
Jeremiah Orians 77795c669c
Fixed Forth's Stack Leak 2017-06-16 16:19:45 -04:00
Jeremiah Orians 9e2d807553
Fixed the arithmetic order issue found by reepca 2017-06-15 16:36:05 -04:00
Jeremiah Orians 41d3ebb643
Fixing forth comparisons thanks to reepca 2017-06-15 06:33:45 -04:00
Jeremiah Orians 54f4019767
Incorporated requested function into stage2 forth 2017-06-14 23:07:50 -04:00
Jeremiah Orians 2a12799d82
Fixings remaining stack offset bugs 2017-06-14 21:25:41 -04:00
Jeremiah Orians 02b2d231a6
Bug fix thanks to reepca 2017-06-14 21:13:52 -04:00
Jeremiah Orians 87477db7eb
Added requested Copyright notices 2017-04-01 17:26:44 -04:00
Jeremiah Orians 5f6c7f82bc
Added license to all source files 2017-03-28 20:25:39 -04:00
Jeremiah Orians db753a0cf0
Fixed minor typo 2016-11-19 14:12:42 -05:00
Jeremiah Orians 614748a00b
Tweaked parameters to match possible heap usage and better fix 2MB environments 2016-11-19 13:45:14 -05:00
Jeremiah Orians 7fd82b8b67
Enhanced forth memory space layout 2016-11-19 12:41:34 -05:00
Jeremiah Orians 5ed87d81af
Added Tape write and HALT instructions to forth interpreter 2016-11-01 22:49:59 -04:00
Jeremiah Orians cde1cddcc1
Fully working forth! 2016-11-01 19:08:00 -04:00
Jeremiah Orians fc04be52cc
Fixed exit and improved string storage in forth 2016-11-01 18:08:47 -04:00
Jeremiah Orians 2136cbc220
Now putting strings in an entirely seperate block of memory 2016-10-31 22:35:12 -04:00
Jeremiah Orians 4cae5c35fa
Semiworking state, needs more work 2016-10-31 20:38:07 -04:00
Jeremiah Orians b14c5e73af
More tweaking on forth 2016-10-30 21:58:41 -04:00
Jeremiah Orians d69c382c36
Fixing minor mistakes 2016-10-30 20:29:14 -04:00
Jeremiah Orians 12bc57e143
Added Codewords to forth assembly primatives 2016-10-30 20:11:27 -04:00
Jeremiah Orians 0e06ed00df
Continued bug fixing 2016-10-30 11:30:13 -04:00
Jeremiah Orians b58504806e
Still bug fixing and attempting to fix all bugs 2016-10-30 11:17:09 -04:00
Jeremiah Orians 334a3a7678
First draft of Forth Complete, I hope 2016-10-29 23:13:39 -04:00
Jeremiah Orians 2716530746
Added several more important forth functions 2016-10-29 21:36:22 -04:00
Jeremiah Orians 07fe743b2f
Added string comparision Node finding and Numeration functions to Forth 2016-10-29 19:13:09 -04:00
Jeremiah Orians 236a905e77
Add IO instruction to Forth 2016-10-29 17:53:22 -04:00
Jeremiah Orians f0f13843a8
Added parameter stack operations 2016-10-29 14:55:04 -04:00
Jeremiah Orians eea718599e
Fix comment spacing and added Return stack operations 2016-10-29 14:26:00 -04:00
Jeremiah Orians 968f5852bf
Added Memory and variable functions 2016-10-29 13:19:00 -04:00
Jeremiah Orians 40ec859e51
Added logical functions and a subroutine EXIT 2016-10-29 12:05:41 -04:00
Jeremiah Orians 1ee3d8d296
Added Comparision operators to forth 2016-10-29 11:49:36 -04:00
Jeremiah Orians 375368c751
Started to implement Forth 2016-10-29 11:12:29 -04:00