summaryrefslogtreecommitdiff
path: root/forth/lib
Commit message (Collapse)AuthorAgeFilesLines
* Generalise parse-hexBALATON Zoltan2023-01-261-2/+34
| | | | | | | | | | | Add parse-nhex word reusing existing parse-ints and use that in parse-hex instead of an independent implementation. The parse-nhex name matches Apple OF, while SLOF calls the same operation hex-decode-unit so adding this word increases compatibility with other OF implementations. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* rstack.fs: add pseudo r-stack implementation for interpret modeMark Cave-Ayland2016-07-172-0/+22
| | | | | | | | The OS 9 boot loader uses the r-stack outside of a word in interpret mode. Provide an r-stack implementation which allows r-stack accesses in interpret mode using a separate pseudo stack. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* string.fs: add functions to support ROT13 string encoding/decodingMark Cave-Ayland2016-02-201-0/+14
| | | | | | Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1380 f158a5a8-5612-0410-a976-696ce0be7e32
* Improve dir word by reducing complexity and adding some more diagnostics.Mark Cave-Ayland2012-11-241-21/+0
| | | | | | | | | | | Since the OF path resolution algorithm automatically passes anything following a ':' as an argument to the specified device, we don't need to bother with handling this ourselves. As a side effect, the auxiliary word split-path-device is no longer needed as we can isolate the path by doing a simple split on ','. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1071 f158a5a8-5612-0410-a976-696ce0be7e32
* Implementation of Forth local variables for OpenBIOS.Mark Cave-Ayland2012-11-232-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bootloaders, particularly OS X, execute Forth strings that make use of Forth local variables. This patch provides an implementation that allows OpenBIOS to execute such code. A couple of examples are included below: : diff.squares { A B -- A*A-B*B } A A * B B * - ; : myword { ; cat dog } 4 -> cat 5 -> dog cat \ cat's value pushed onto stack ( - cat) dog \ dog's value pushed onto stack (cat - cat dog ) + cr ." Total animals = " . cr ; Since the Forth locals stack and temporary dictionary take up extra space, the locals implementation is protected by a new CONFIG_LOCALS build variable. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1068 f158a5a8-5612-0410-a976-696ce0be7e32
* forth: Fix ([IF]) to handle nested [IFDEF] as wellAndreas Färber2010-12-051-0/+1
| | | | | | | | | | | | | | | | | Depending on the condition, either the [IFDEF] FOO or the [ELSE] would get compiled as an [IF], eating words until [ELSE] or [THEN] respectively. While doing so, [IFDEF] does not get compiled to [IF], so we need to handle nested [IFDEF] to account for its [ELSE] or [THEN]. This fixes [IFDEF] not disabling the full section of code. Thanks to Segher for pointing me in the right direction. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@979 f158a5a8-5612-0410-a976-696ce0be7e32
* Switch dir over to use the new static filesystem dir methods.Mark Cave-Ayland2010-07-111-0/+21
| | | | | | | Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@817 f158a5a8-5612-0410-a976-696ce0be7e32
* - drop commented out functions, they're in others.fs alreadyStefan Reinauer2009-11-201-17/+1
| | | | | | | - fix another stack diagram typo git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@621 f158a5a8-5612-0410-a976-696ce0be7e32
* improve x@ and x! functions, at least x@ reads back what x! wrote, now.Stefan Reinauer2009-11-201-4/+8
| | | | git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@620 f158a5a8-5612-0410-a976-696ce0be7e32
* Add 64bit extensions from 12756d5Stefan Reinauer2009-11-202-0/+141
| | | | | | | | Signed-off-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@616 f158a5a8-5612-0410-a976-696ce0be7e32
* Reworked version of Forth Source debugger (Mark Cave-Ayland)Blue Swirl2009-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch implements the following Forth words: debug <xt> - Mark word for debugging debug-off - Unmark all words for debugging resume - Return from subordinate Forth interpreter The source debugger also implements the following commands when it has been activated: Up - Unmark current word for debugging, mark parent and continue Down - Mark next word for debugging Trace - Continue execution until end of word displaying debug information Rstack - Display contents of the Rstack Forth - Launch subordinate Forth interpreter Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@611 f158a5a8-5612-0410-a976-696ce0be7e32
* Remove unnecessary trailing newlinesBlue Swirl2008-12-131-2/+0
| | | | git-svn-id: svn://coreboot.org/openbios/openbios-devel@285 f158a5a8-5612-0410-a976-696ce0be7e32
* initial import of openbios--main--1.0--patch-26Stefan Reinauer2006-04-268-0/+515
git-svn-id: svn://coreboot.org/openbios/openbios-devel@1 f158a5a8-5612-0410-a976-696ce0be7e32