I tried as many ways, programs etc that I could think of to output $0000 $8000 IDUMP to a binary including hex2bin (mac osx) None of them were recognized as a valid image by BST like your .binary was.
Here's the best of them:
hex2bin v1.0.9, Copyright (C) 2012 Jacques Pelletier
checksum extensions Copyright (C) 2004 Rockwell Automation
improved P.G. 2007, modified Danny Schneider,2012
The IDUMP on it's own will not work if you want a valid image for a Prop binary. Have a look at BINARYDUMP which fixes up the header and checksum (first 16 bytes of memory) before it dumps from the EEPROM. You don't need to set any parameters for this word as it caclulates what's needed.
The IDUMP on it's own will not work if you want a valid image for a Prop binary. Have a look at BINARYDUMP which fixes up the header and checksum (first 16 bytes of memory) before it dumps from the EEPROM. You don't need to set any parameters for this word as it caclulates what's needed.
GCC is part of XCode (sort of) but you still need to go into XCode | Preferences and install "Command Line Tools". Then you can GCC to your heart's content!
I was setting up a situation to try out BACKUP and RESTORE. I added my own small file LOOKUP.fth after EXTEND.fth did a BACKUP and a REBOOT and MODULES stopped reporting EXTEND, but it IS there!
End of source code, 0027 lines processed and 0000 errors found
Load time = 2,502ms
CODE @$4B02 - bytes added = 0189 and 13566 bytes free
NAMES @$2648 - bytes added = 0151 and 2568 bytes free
YCALLS @ 0163 entries free
Runtime since last reset = 306,496ms
ok
MODULES
LOOKUP.fth 120922.1300 - extension to examine LOOKUP/VECTORS
EXTEND.fth Primary extensions to TACHYON kernel - 120923.2300
ok
BACKUP ok
REBOOT
Propeller .:.:--TACHYON--:.:. Forth V20120919.1215
CODE @$4B02 - bytes used in this load = 0189
NAMES @$2648 - bytes used in this load = 0151
YCALLS @ 0163 entries free
----------------------------------------------------------------
MODULES
LOOKUP.fth /
ok
MODULES
LOOKUP.fth \
ok
QWORDS
LU DEFLT FTH ETH DTH CTH BTH ATH 9TH 8TH 7TH 6TH 5TH 4TH 3RD 2ND 1ST 0TH SPCHAR
LOOKUP.fth COLD EXTEND exttimers INFO STATS END .RUNTIME BINARYDUMP FIXCKSUM IDUMP cksum CONBAUD
RESTORE ?BACKUP BACKUP kernel 64K? EVERIFY EFILL EECOPY eebuf ELOAD ESAVEB ESAVE EDUMP ENDRD
EE@ EE! EERD @EE I2CBUS SI2C@ SI2C! SI2C!? I2C@ I2C! I2C!? I2CSTOP I2CSTART I2CPINS
EEPROM SDA SCL sda scl % PWM! PWMFREQ RUNPWM PWMCOG pwmfreq pwmtbl pwmchans pwmpins
RUNTIMERS TIMERTASK ALARM TIMEOUT? TIMEOUT TIMER timercnt timers runtime MUTE HZ KHZ MHZ DAC!
FRQ BPIN APIN PLLDIV PLL DUTY CTRMODE NCO B A CTR@ CTR! CTR ctr PINS? .PIN SPRS REG$
.LAP .NUM (SEP) B>L B>W W>L W>B L>W >B >W CON SERIN SEROUT SERBAUD MAP MODULES QWORDS
@. C~~ C~ W~~ W~ ~~ ~ C-- C++ W-- W++ -- ++ <= => >| |< seconds second MOD
LONGFILL LBIT! MASKS PININP PINCLR PINSET TYPE SPACES ALIGNL TASKS TASK? ENQ@ ATN! ENQ! ATN@
ATN? RUN COGINIT @CNT @MISO @MOSI @SCK COGREG@ COGREG! CLKFREQ U@ .INDEX ... Published
IMMEDIATE ok ]~ [~ LEMIT EXTEND.fth RESET 0EXIT EXIT NOP 3DROP 2DROP DROP ?DUP DUP OVER 3RD
4TH SWAP ROT NIP 1+ 1- + - * U/MOD UM* NEGATE INVERT AND ANDN OR XOR SHR SHL 2/ 2*
REV MASK 0= = > C@ W@ @ C+! C! C@++ W+! W! +! ! CMOVE BIT! SET CLR IC! (PUSH4)
(PUSH3) (PUSH2) (PUSH1) (VAR) FALSE OFF 0 1 2 3 4 5 6 7 8 ON TRUE -1 BL IN@ P@ OUT!
P! CLOCK OUTSET OUTCLR OUTPUTS INPUTS WAITLOW SHROUT SHRINP LOADMOD RUNMOD SFR@ SPR@
COG@ COGREG COG! PASM STACKS LSTACK CALL JUMP (XCALL) (YCALL) (WCALL) (ELSE) (IF) (UNTIL)
(AGAIN) ADO DO LOOP +LOOP FOR NEXT <BEGIN AGAIN> UNTIL> POPMARK >R R> >L L> (EMIT) (REG)
REG DELTA WAITCNT WAITPEQ WAITPNE CMPSTR I XCALLS REBOOT STOP COGID PAR CNT INA INB
OUTA OUTB DIRA DIRB CTRA CTRB FRQA FRQB PHSA PHSB VCFG VSCL SPR SPR! [SPIO] [SPIOD]
[SDRD] [SDWR] [PWM] [PWM!] [PLOT] !SP 2+ 2- SET? / 2DUP MIN MAX 0<> <> 0> 0< < U<
WITHIN ?EXIT BOUNDS LEAVE J K IX ERASE FILL ms us CNT@ NEWCNT LAPCNT OUT IN INPUT PIN!
PIN@ KEY? KEY HEX DECIMAL BINARY .S DUMP COGDUMP .STACKS DEBUG EMIT CLS SPACE BELL CR
SPINNER .HEX .BYTE .WORD .LONG . >DIGIT NUMBER SCRUB GETWORD FINDSTR NFA>CFA EXECUTE V2 VER
.VER TACHYON @PAD HOLD >CHAR #> <# # #S (STR) .STR STRLEN U. .DEC DISCARD colors pixels
REG flags base digits delim word autorun keypoll tasks unum uemit ukey names here codes
errors baudcnt prompt find create lines ALLOT ALLOCATED HERE AUTO! MARK UNMARK >PFA NFA' '
KEYPOLL \ '' ( { } IFNDEF " ." AUTORUN IF ELSE THEN ENDIF BEGIN UNTIL AGAIN WHILE REPEAT
; [COMPILE] GRAB LITERAL : pub pri CREATEWORD CREATE CVARIABLE WVARIABLE VARIABLE BYTE
WORD LONG TABLE CONSTANT C, | || TASK IDLE LOOKUP VECTORS +XCALL +YCALL ITEM ITEM@ ITEMS
NFA>CFA WORDS =PIXELS STATS FREE COLD
ok
1.61 GB of Xcode 4.5 later plus another 115 MB for 'command line tools' and I had hex2bin turned into an executable under Mountain Lion ... did either of you guys get a compiler warning about 'signedness.'
I could not figure how to make SpinSIDE do a .binary. So I brought up Parallels/WinXP and PropTool 1.3.2, and burned the EEPROM and it ran.
1.61 GB of Xcode 4.5 later plus another 115 MB for 'command line tools' and I had hex2bin turned into an executable under Mountain Lion ... did either of you guys get a compiler warning about 'signedness.'
I could not figure how to make SpinSIDE do a .binary. So I brought up Parallels/WinXP and PropTool 1.3.2, and burned the EEPROM and it ran.
Yes I got the gcc warning, that's the beauty of the -Wall arg. Parallels? I highly recommend BST since your on OSX, it handles tachyon source and binarys perfectly so far.
Yes I got the gcc warning, that's the beauty of the -Wall arg. Parallels? I highly recommend BST since your on OSX, it handles tachyon source and binarys perfectly so far.
For some reason, I have never been able to fathom, the BST IDE stopped working for me under Lion and Mtn Lion. The BST executables work fine for SpinSIDE (Simple IDE). Parallels is so thoroughly integrated into OSX that its no bother at all.
I have found that TACHYON and the Micomega uM-FPU64 64-bit Floating Point Coprocessor work well together. A minimal code for using the FPU64 in a TACHYON environment is shown below. Note that 3 words are included which allow access to a serial lcd connected to the coprocessor serial port. This chip includes support for a 1-Wire bus, servo controller, parallel lcds, GPS input with NMEA sentence parsing, etc..
{ TACHYON V2.0 um-FPU64 Access Nicholas G. Lordi 9/2012
See uM-FPU64 Datasheet and Instruction Set for details. }
'' SPI Words - require loading SDCard.fth
'' Pin Assignments - scs is not needed, since the FPU cs pin is wired to ground
#21 MASK CONSTANT .miso
#22 MASK CONSTANT .sclk
#23 MASK CONSTANT .mosi
#4 MASK CONSTANT .busy \ monitor FPU busy signal (lo - busy hi - not busy)
: SPI ( -- ) \ Initialize spi engine (2.8 MHz).
#8 3 COGREG!
.miso 2 COGREG!
.mosi 1 COGREG!
.sclk 0 COGREG!
.mosi OUTCLR
.sclk OUTCLR ;
: FPU>B ( -- b ) \ Leaves 1 byte on stack.
SD@ ;
: B>FPU ( b -- ) \ Sends 1 byte to FPU64.
SD! ;
: W>FPU ( w -- ) \ Sends 1 word to FPU64.
DUP #8 SHR SD! SD! ;
: L>FPU ( l -- ) \ Sends 1 long to device.
DUP #24 SHR SD! DUP #16 SHR SD! DUP #8 SHR SD! SD! ;
: FPU>W ( -- w ) \ Leaves 1 word on stack.
SD2@ ;
: FPU>L ( -- l ) \ Leaves 1 long on stack.
SD@ #8 SHL SD@ OR #8 SHL SD@ OR #8 SHL SD@ OR ;
'' Utilities
WVARIABLE REGA \ stores reg A number
WVARIABLE REGX \ stores reg X number
: FPU ( -- b ) \ Initialize SPI engine and resets the fpu chip. Leaves $BC on stack if fpu is in sync.
SPI 10 0 DO $FF SD! LOOP $00 SD! 10 ms $F0 SD! SD@ ;
'' Some Useful Subroutines
: SETREGA ( n1 -- ) \ Assigns register A as register #n1.
DUP REGA W! $01 SD! SD! ;
: SETREGX ( n1 -- ) \ Assigns register X as register #n1.
DUP REGX W! $02 SD! SD! ;
: I>FP ( l -- ) \ Stores long in fpu reg A and converts it to floating point.
$91 SD! L>FPU $60 SD! ;
: FP>I ( -- l ) \ Leaves integer form of floating point value in fpu reg A on stack. Value unchanged in reg A.
$08 SD! #0 SD! $62 SD! $95 SD! 1 ms FPU>L $10 SD! REGA W@ SD! ;
: SCALEUP ( n1 -- ) \ Multiplies fp value in reg A by n1.
$08 SD! #0 SD! I>FP $2D SD! $06 SD! ;
: SCALEDN ( n1 -- ) \ Divides fp value in reg A by n1.
$08 SD! #0 SD! I>FP $2F SD! $06 SD! ;
: LCD ( -- ) \ Initializes serial lcd (4x20) attached to the seroil port at 19200 baud.
$CE SD! $00 SD! #7 SD! ;
: >LCD ( b -- ) \ Sends control code b to lcd.
$CE SD! $01 SD! SD! $0 SD! ;
: FP>LCD ( n1 -- ) \ Converts value in reg A to a string of length n1 (max 10) to the lcd.
$1F SD! #0 SD! $E4 SD! #0 SD! SD! $CE SD! #3 SD! #13 >LCD ;
END
"BTW, use the ATN! command rather than the RUN for passing commands to tasks. I noticed that the task that stopped may not have been stopped because you probably said 1 4 RUN rather than 1 4 ATN!. The ATN? looks in another location for the command while the RUN vector really only takes effect when the task is in IDLE.
pub ATN? \ alias for newer command ATN@
pub ATN@ ( -- cmd )
COGID TASK 4 + DUP W@
0 ROT W! \ Clear the command (ack)
;
( To talk to tasks in other cogs )
\ Use this in place of "cmd n RUN"
pub ATN! ( cmd cog -- )
TASK 4 + W!
;
"BTW, use the ATN! command rather than the RUN for passing commands to tasks. I noticed that the task that stopped may not have been stopped because you probably said 1 4 RUN rather than 1 4 ATN!. The ATN? looks in another location for the command while the RUN vector really only takes effect when the task is in IDLE.
pub ATN? \ alias for newer command ATN@
pub ATN@ ( -- cmd )
COGID TASK 4 + DUP W@
0 ROT W! \ Clear the command (ack)
;
( To talk to tasks in other cogs )
\ Use this in place of "cmd n RUN"
pub ATN! ( cmd cog -- )
TASK 4 + W!
;
Cheers,
Peter
"
While the source for V2 and Extend.fth do have some inline documentation an example of inter-task communications would be fantastic.
While the source for V2 and Extend.fth do have some inline documentation an example of inter-task communications would be fantastic.
Peter set a good example in Msg #241 of this thread. I copy pasted it to an editor and corrected it for the changes that have occurred over the last few weeks.
"Okay so I have made an addition to allow other Tachyon cogs to receive a command, a bit like hitting a key. It's really very simple, we just insert ATN? which returns with a non-zero byte command which is inserted by another cog. You can interpret the command anyway you want, just like a key. The command is read from the cog's "tasks" vector which won't cause it to run wild as it will simply clear a byte command in the idle loop without trying to execute it.
Here's what my BLINKY looks like:
#13 MASK CONSTANT .RDY
: BLINKY BEGIN .RDY OUTSET 50d ms .RDY OUTCLR 50d ms ATN? UNTIL ;
' BLINKY CONSTANT UBLINKY
UBLINKY 4 RUN
Now when I type:
1 4 ATN!
Where 1 is a "command" for cog 4 the loop will terminate and I can get control of it once again in the idle loop. This is also a neat way to pass commands to the cog if it is setup to process them like this:
#13 MASK CONSTANT .RDY
: BLINKY 50d BEGIN .RDY OUTSET DUP ms .RDY OUTCLR DUP ms ATN? DUP 1 > IF NIP DUP THEN 1 = UNTIL ;
' BLINKY CONSTANT UBLINKY
UBLINKY 4 RUN
So BLINKY will start off with a fast blink, but now type:
#200 4 ATN!
will cause it to slow blink. NOTE from BBR ... even with BLINKY reconfigured to set the blink rate sending "1" to ATN? still terminates the loop and hands control back over to the TF VM IDLE loop. "
Peter set a good example in Msg #241 of this thread. I copy pasted it to an editor and corrected it for the changes that have occurred over the last few weeks.
#241 Thanks Brian, Tachyon is moving faster than I can keep up with it seems.
#241 Thanks Brian, Tachyon is moving faster than I can keep up with it seems.
Oh, and I thought it had slowed to a pedestrian pace in recent weeks! I've been very busy with hardware and application software with very little time for improving the kernel lately. Big things are happening with Tachyon in the next couple of weeks though (unless other big things happen in the meantime!).
So, watching this thread, I started wondering if C could be compiled to Tachyon bytecode.So, I Googled "compile C to stack machine" and the first result was My history with Forth & stack machines which is an absolutely fascinating article. After reading it, I can somewhat wrap my head around Forth, but I also understand that some people can't, so I won't feel bad if I never do, completely.
So, watching this thread, I started wondering if C could be compiled to Tachyon bytecode.So, I Googled "compile C to stack machine" and the first result was My history with Forth & stack machines which is an absolutely fascinating article. After reading it, I can somewhat wrap my head around Forth, but I also understand that some people can't, so I won't feel bad if I never do, completely.
Tachyon is just on 3 months old and there is still so much to do yet. I have finally just gotten around to tidying up a couple of things and expanding the vector table to allow for larger programs. In Tachyon all definitions need to have (it's automatic) the absolute address recorded in the vector table (XCALLS) and one of 4 instructions along with an 8-bit index is normally compiled and accesses code via the table. Later on when P2 comes out the vector table can be "widened" to accommodate longer addresses without impacting the compactness of the compiled code.
The dictionary still needs to be moved out of RAM and the 2K kernel image will be reused for the serial buffers and paging the dictionary from EEPROM/SPI/SD into RAM. I just need to figure out how to convince the Spin tool that I want the dictionary compiled right at the very end.
The startup screen after which I type INFO then 0 8000 MAP:
I found a bug in my jmservo8 code that would blow the stack. It has been fixed. Along the way I created a second piece of code titled jmservo2 . Where the original code would flexably handle 1-8 servos this is hard coded for two, though one or two more could be easily added.
I also created a shared DropBox folder for Tachyon Forth Apps and JMSERVO and NIc Lordi's 64 bit FPU code are the first entries.
The shared DropBox folder, "Tachyon Forth Apps," has had quite a bit of traffic. I set it up so that any "member" can also invite members. The problem is I only have a very few regular email addresses to use to issue "invitations" for a few of the regular posters and lurkers. So, if you wish to subscribe to the shared folder, send me an email to <brianbr@wulfden.org>. In order to accept the sharing status you need to have a DropBox account. The initial account is free with 2 GB. DropBox has all sorts of ways to earn extra space for no cost. I have almost doubled my free space already. Personally I am quite satisfied.with the DropBox service. I have it running on my iMac, an old MacBook Pro, my iPhone, iPad, a WinXP box and also on my iMac, Parallels passes the Mac DropBox through to a WinXP VM transparently.
If you are not interested in joining feel free to lurk and browse simply by clicking on the link to that folder in my sig.
While on the subject of Tachyon Forth Apps. Nick Lordi wrote up a great toolkit for the Micromega uM-FPU64 64-bit Floating Point Coprocessor. The 32 bit version of this is found in abundance, even right here at Parallax, but the 64 bit not so much. Solarbotics out in Western Canada has the chip for $25 plus shipping. The link to it is here
I created a separate folder for the FPU64 code and added the documentation from Micromega ... enjoy
Peter et al.
I was going over Nick's FPU 64 code this afternoon and a thought occurred to me. The FPU64 uses SPI for I/O, thus necessitating loading SDCARD.fth before loading FPU64. So when reading or writing to the FPU64 you are mostly using Forth word whose names derive from "SD" which is only logical if you are familiar with Tachyon history. In my rarely very humble opinion would not it be easier on future apprentices of TF if SPI words were collected together, given SPI derived names and put into their own file? Do it now while it is still a manageable task.
Does this make any sense? thanks for listening ...
I'm a step away from earning my apprenticeship but Brian's suggestion makes sense to me. A layer of SPI words on top of which any device/application specific words for a particular SPI peripheral can be built.
I required SDCARD.fth for the FPU64 words since my application included both the FPU64 and an SD card. In a previous post on this thread (#334), I included generic SPI words and applied them to accessing flash memory.
I'm in the process of tidying up and optimizing the memory map for Tachyon so I can work with the bulk of the dictionary in EEPROM or SD memory. So the bytecode kernel itself and the images and the vector table (kernel and user) requires 8K. Since accessing the dictionary in EEPROM will be slow I am looking at employing another task to page in sections and scan them but we'll see how that goes. Other than that there is nothing really new yet but these changes will enable more functionality to be incorporated while also freeing up more RAM for user applications. I almost forgot to mention that the HS-SerialRxL driver is now integrated in the Tachyon source. Latest binary - bare kernel, 230400 baud, 5MHz
The memory map has been optimized again and this time the image for the Tachyon VM and HS-Serial are located at the end of hub memory so that they can be used for buffers. The SD card buffers will be moved to overlay the 2K VM image which will also include dictionary buffers.
To speed up compilation I have added a number preprocessor so that prefixed numbers are processed immediately rather than searching the dictionary first. The dictionary search has also been optimized as well as the dictionary headers with the most common kernel words being searching first for an earlier match. I've been able to reduce my line delay to 12ms even on SDCARD.fth which used to need 60ms or more.
So the kernel dictionary is searched first unless it's a prefixed number (#$%) and then the extended dictionary is searched while allowing for an alternate search method so that SDCARD.fth can be expanded to buffer the extended dictionary into SD memory and page it in and out rapidly as needed. The SD card routines use the 2K Tachyon image as a buffer area.
Since bytecode is referenced via the vector table it can be relocated very easily which will allow modules to be moved around or in and out of memory. This also means that kernel bytecode words can also be redefined by changing it's vector to point to the new definition. I will be making more use of these features as I expand Tachyon's functionality.
Loading EXTEND.fth takes 18.6 seconds (11.7 seconds with 6ms line delay @3M baud)
End of source code, 0978 lines processed and 0000 errors found
Load time = 18,607ms
NAMES: $6488...7446 for 4030 (23176 bytes added) with 23648 bytes free
CODE: $0000...250B for 5453 (3595 bytes added) with 23285 bytes free
CALLS: 0688 vectors free
and loading SDCARD.fth only takes 8 seconds now (6 seconds with 8ms line delay @3M baud)
End of source code, 0423 lines processed and 0000 errors found
Load time = 8,094ms
NAMES: $61AB...7446 for 4763 (20973 bytes added) with 22915 bytes free
CODE: $0000...2D69 for 6862 (2142 bytes added) with 21143 bytes free
CALLS: 0609 vectors free
I really appreciated finding this page. The 'one' item that no one seems to have is a PDF version of Starting Forth by Leo Brodie, and yet it is very worthwhile.
Since one can't download it, you either have to buy an out of print copy or read it on-line. Fortunately, Forth, Inc. has it in the original format.
I find out that while so much of Forth has been generously shared with the public domain, this one book has become rather protected. If you can find it used, the second edition published 1987 by Prentice Hall is supposed to be the best.
There's a pdf of the online version of Starting Forth here.
I have just found an old copy in reasonable condition which I have ordered just for nostalgia (loved that book). I used to have about 3 copies but you know how people are when they say "just want to borrow it for a day or two...bring it right back..." :frown:
There's a pdf of the online version of Starting Forth here.
I have just found an old copy in reasonable condition which I have ordered just for nostalgia (loved that book). I used to have about 3 copies but you know how people are when they say "just want to borrow it for a day or two...bring it right back..." :frown:
Thanks, I don't have to pay for wifi in Starbucks to read it on my notebook.
AbeBooks.com has several copies available of both first and second editions, along with several other Forth classics. Prices range from under $5 to over $100USD.
Reading Starting Forth really makes moving on to Brodie's other later book Thinking Forth, much easier.
I really appreciated finding this page. The 'one' item that no one seems to have is a PDF version of Starting Forth by Leo Brodie, and yet it is very worthwhile.
Since one can't download it, you either have to buy an out of print copy or read it on-line. Fortunately, Forth, Inc. has it in the original format.
I find out that while so much of Forth has been generously shared with the public domain, this one book has become rather protected. If you can find it used, the second edition published 1987 by Prentice Hall is supposed to be the best.
... and thanks to Peter's link to an SF in PDF, my Forth Resources Directory now has filled this hole in its catalog.
Comments
The IDUMP on it's own will not work if you want a valid image for a Prop binary. Have a look at BINARYDUMP which fixes up the header and checksum (first 16 bytes of memory) before it dumps from the EEPROM. You don't need to set any parameters for this word as it caclulates what's needed.
Works perfect with BST, thanks.
How did you get this to compile. I am running 10.8.2 and it couldn't find GCC. I though that got installed along with the XCode package.
My system is:
Darwin dp.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
GCC is located at:
dp:Hex2bin-1.0.9 dp$ whereis gcc
/usr/bin/gcc
This is all I had to do
gcc -O2 -Wall -o hex2bin hex2bin.c
GCC is part of XCode (sort of) but you still need to go into XCode | Preferences and install "Command Line Tools". Then you can GCC to your heart's content!
I was setting up a situation to try out BACKUP and RESTORE. I added my own small file LOOKUP.fth after EXTEND.fth did a BACKUP and a REBOOT and MODULES stopped reporting EXTEND, but it IS there!
1.61 GB of Xcode 4.5 later plus another 115 MB for 'command line tools' and I had hex2bin turned into an executable under Mountain Lion ... did either of you guys get a compiler warning about 'signedness.'
I could not figure how to make SpinSIDE do a .binary. So I brought up Parallels/WinXP and PropTool 1.3.2, and burned the EEPROM and it ran.
Yes I got the gcc warning, that's the beauty of the -Wall arg. Parallels? I highly recommend BST since your on OSX, it handles tachyon source and binarys perfectly so far.
For some reason, I have never been able to fathom, the BST IDE stopped working for me under Lion and Mtn Lion. The BST executables work fine for SpinSIDE (Simple IDE). Parallels is so thoroughly integrated into OSX that its no bother at all.
NickL
"BTW, use the ATN! command rather than the RUN for passing commands to tasks. I noticed that the task that stopped may not have been stopped because you probably said 1 4 RUN rather than 1 4 ATN!. The ATN? looks in another location for the command while the RUN vector really only takes effect when the task is in IDLE.
pub ATN? \ alias for newer command ATN@
pub ATN@ ( -- cmd )
COGID TASK 4 + DUP W@
0 ROT W! \ Clear the command (ack)
;
( To talk to tasks in other cogs )
\ Use this in place of "cmd n RUN"
pub ATN! ( cmd cog -- )
TASK 4 + W!
;
Cheers,
Peter
"
While the source for V2 and Extend.fth do have some inline documentation an example of inter-task communications would be fantastic.
Peter set a good example in Msg #241 of this thread. I copy pasted it to an editor and corrected it for the changes that have occurred over the last few weeks.
#241 Thanks Brian, Tachyon is moving faster than I can keep up with it seems.
Funny you should mention this. I just today added that article to my "Fort Resources" directory http://www.wulfden.org/downloads/Forth_Resources/
The dictionary still needs to be moved out of RAM and the 2K kernel image will be reused for the serial buffers and paging the dictionary from EEPROM/SPI/SD into RAM. I just need to figure out how to convince the Spin tool that I want the dictionary compiled right at the very end.
The startup screen after which I type INFO then 0 8000 MAP:
I also created a shared DropBox folder for Tachyon Forth Apps and JMSERVO and NIc Lordi's 64 bit FPU code are the first entries.
... enjoy!
If you are not interested in joining feel free to lurk and browse simply by clicking on the link to that folder in my sig.
While on the subject of Tachyon Forth Apps. Nick Lordi wrote up a great toolkit for the Micromega uM-FPU64 64-bit Floating Point Coprocessor. The 32 bit version of this is found in abundance, even right here at Parallax, but the 64 bit not so much. Solarbotics out in Western Canada has the chip for $25 plus shipping. The link to it is here
I created a separate folder for the FPU64 code and added the documentation from Micromega ... enjoy
I was going over Nick's FPU 64 code this afternoon and a thought occurred to me. The FPU64 uses SPI for I/O, thus necessitating loading SDCARD.fth before loading FPU64. So when reading or writing to the FPU64 you are mostly using Forth word whose names derive from "SD" which is only logical if you are familiar with Tachyon history. In my rarely very humble opinion would not it be easier on future apprentices of TF if SPI words were collected together, given SPI derived names and put into their own file? Do it now while it is still a manageable task.
Does this make any sense? thanks for listening ...
NickL
Latest binary - bare kernel, 230400 baud, 5MHz
To speed up compilation I have added a number preprocessor so that prefixed numbers are processed immediately rather than searching the dictionary first. The dictionary search has also been optimized as well as the dictionary headers with the most common kernel words being searching first for an earlier match. I've been able to reduce my line delay to 12ms even on SDCARD.fth which used to need 60ms or more.
So the kernel dictionary is searched first unless it's a prefixed number (#$%) and then the extended dictionary is searched while allowing for an alternate search method so that SDCARD.fth can be expanded to buffer the extended dictionary into SD memory and page it in and out rapidly as needed. The SD card routines use the 2K Tachyon image as a buffer area.
Since bytecode is referenced via the vector table it can be relocated very easily which will allow modules to be moved around or in and out of memory. This also means that kernel bytecode words can also be redefined by changing it's vector to point to the new definition. I will be making more use of these features as I expand Tachyon's functionality.
Loading EXTEND.fth takes 18.6 seconds (11.7 seconds with 6ms line delay @3M baud)
End of source code, 0978 lines processed and 0000 errors found
Load time = 18,607ms
NAMES: $6488...7446 for 4030 (23176 bytes added) with 23648 bytes free
CODE: $0000...250B for 5453 (3595 bytes added) with 23285 bytes free
CALLS: 0688 vectors free
and loading SDCARD.fth only takes 8 seconds now (6 seconds with 8ms line delay @3M baud)
End of source code, 0423 lines processed and 0000 errors found
Load time = 8,094ms
NAMES: $61AB...7446 for 4763 (20973 bytes added) with 22915 bytes free
CODE: $0000...2D69 for 6862 (2142 bytes added) with 21143 bytes free
CALLS: 0609 vectors free
RMAP
0000: 47 4F 45 4E 35 47 62 43 4A 45 59 44 66 29 .. ..
0400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0800: 09 05 23 0F 2E 59 65 5D 4A 4B 50 7D 92 7C 7F 81
0C00: 76 5C 61 5E 3B 5B 5B 59 56 5A 52 4E 57 60 63 5E
1000: 75 6D 68 41 65 7E 79 74 63 7E 68 50 5B 66 5C 56
1400: 65 54 6C 65 72 77 60 79 79 77 39 .. 4D 62 50 3A
1800: 52 5F 61 5B 42 42 50 58 45 5B 5B 4E 68 69 66 73
1C00: 6A 4C 65 48 60 45 58 57 59 76 62 53 71 5C 6E 71
2000: 70 66 71 6B 6A 6E 73 6E 81 5A 6C 5D 5D 66 5D 5B
2400: 6B 63 47 15 47 3B 2A 7E 88 36 77 7E 5A 1E 29 27
2800: 3D 6B 77 72 79 76 76 80 78 72 5A 56 59 59 6A 84
2C00: 87 6F 67 66 51 34 .. .. .. .. .. .. .. .. .. ..
3000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
3400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
3800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
3C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
4000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
4400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
4800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
4C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
5000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
5400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
5800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
5C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
6000: .. 2A 6C 5D 64 6A 5F 58 68 5F 62 60 62 63 60 6B
6400: 71 6A 65 5D 5F 5E 5A 55 60 60 5D 63 5B 57 57 56
6800: 54 5A 53 58 51 4F 50 48 55 3E 3D 4E 42 32 3A 38
6C00: 35 41 4B 4B 4B 53 48 46 59 5D 58 65 52 53 55 52
7000: 48 50 55 51 52 52 57 58 5A 63 74 73 64 5B 5C 5B
7400: 5D 7B 65 71 5A 69 64 65 6A 74 6C 6E 61 70 82 91
7800: 7C 6C 71 74 6A 72 8E A1 8D 8A 72 0E .. .. 08 54
7C00: 4F 55 76 6A 6F 85 76 30 92 3E .. .. .. .. .. .. ok
I really appreciated finding this page. The 'one' item that no one seems to have is a PDF version of Starting Forth by Leo Brodie, and yet it is very worthwhile.
Since one can't download it, you either have to buy an out of print copy or read it on-line. Fortunately, Forth, Inc. has it in the original format.
http://www.forth.com/starting-forth/sf1/sf1.html
I find out that while so much of Forth has been generously shared with the public domain, this one book has become rather protected. If you can find it used, the second edition published 1987 by Prentice Hall is supposed to be the best.
I have just found an old copy in reasonable condition which I have ordered just for nostalgia (loved that book). I used to have about 3 copies but you know how people are when they say "just want to borrow it for a day or two...bring it right back..." :frown:
Thanks, I don't have to pay for wifi in Starbucks to read it on my notebook.
AbeBooks.com has several copies available of both first and second editions, along with several other Forth classics. Prices range from under $5 to over $100USD.
Reading Starting Forth really makes moving on to Brodie's other later book Thinking Forth, much easier.
... and thanks to Peter's link to an SF in PDF, my Forth Resources Directory now has filled this hole in its catalog.