RetroForum Welcome, Guest. Please login or register.
September 03, 2010, 09:54:15 PM
Home Help Search Calendar Login Register

RetroForth Discussion  |  Older Boards  |  Code Library  |  Topic: Library development « previous next »
Pages: 1 Go Down Print
Author Topic: Library development  (Read 2685 times)
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Library development
« on: May 03, 2007, 12:56:39 AM »

Just a quick update: this weekend I'll start backporting some of the libraries from Toka. Expect to see the following in the near future:

- floating point stack + basic operations (hybrid, C and Forth)
- sockets library (hybrid, C and Forth)
- time (basic functions to get time and date, time functions, etc)
- strings (probably not complete, but a good chunk of what Toka provides)
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Library development
« Reply #1 on: May 04, 2007, 05:43:16 AM »

Some links to documentation on the library modules I'm porting:

- Strings: http://charleschilders.com:9812/book/stringslibrary.html
- Floats: http://charleschilders.com:9812/book/floatslibrary.html
- Time: http://charleschilders.com:9812/book/timelibrary.html
- Sockets: http://charleschilders.com:9812/book/socketlibrary.html

Edit: updated the links
« Last Edit: May 10, 2007, 11:27:44 PM by Charles Childers » Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Library development
« Reply #2 on: May 10, 2007, 11:50:18 PM »

Here is the code for creating and working with Toka-style arrays in RetroForth:

Code:
: is-array create allot ;
: get-element swap 4 * + @ ;
: put-element swap 4 * + ! ;
: get-char-element swap 1 * + c@ ;
: put-char-element swap 1 * + c! ;

A dummy definition for chars may be helpful in improving readability:

Code:
self: chars ;

The array words are documented at http://charleschilders.com:9812/book/arrays.html
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Library development
« Reply #3 on: May 13, 2007, 06:54:35 PM »

The floating point support from Toka has been ported to RetroForth now. You can find it at http://charleschilders.com/retroforth/library

You will need floats.c and floats. Instructions for compiling floats.c are in the file itself. This library is documented at http://charleschilders.com:9812/book/floatslibrary.html

Next up: sockets Smiley
Logged
Pages: 1 Go Up Print 
RetroForth Discussion  |  Older Boards  |  Code Library  |  Topic: Library development « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!