CAMELFORTH/8051 APPLICATION NOTE #1 DOWNLOADING SOURCE FILES B. Rodriguez 9 November 1996 A simple modification to the CamelForth interpreter makes it very easy to download Forth source code to the target computer. The word QUIT is changed as shown below, so that after every line of input, an ASCII CR-LF is output (by the Forth word CR). Most PC terminal programs can be set up to download a line, then wait for a carriage return (or other response character) before continuing: For the Windows 3.1 Terminal program, in Settings/Text Transfers, set Flow Control to "Line at a Time", select "Wait for Prompt String", and set the prompt string to "^M" (the default). Under Settings/Communications, it's best to set Flow Control to "None". You can then use Transfers/Send Text File to download your Forth file. In Procomm for DOS, in ASCII Transfer Setup (ALT-S option 6), under ASCII Upload, set Pace Character to "13" (CR). Also ensure that upload LF Translation is set to "STRIP". Then use Upload (PageUp) to send your Forth file. (Originally CamelForth output a CR after an input line _only_ when in the interpret state, and then followed the CR-LF with the string "ok".) The new source code for QUIT: ;C QUIT -- R: i*x -- interpret from kbd ; L0 LP ! R0 RP! 0 STATE ! ; BEGIN ; TIB DUP TIBSIZE ACCEPT SPACE ; INTERPRET ; STATE @ 0= IF ." OK" THEN CR ; AGAIN ; .drw link .set link,*+1 .db 0,4,"QUIT" QUIT: lcall L0 lcall LP lcall STORE lcall RP0 lcall RPSTORE lcall LIT .drw h'0 lcall STATE lcall STORE QUIT1: lcall TIB lcall DUP lcall TIBSIZE lcall ACCEPT lcall SPACE acall INTERPRET lcall STATE lcall FETCH lcall ZEROEQUAL lcall zerosense jz QUIT2 lcall XISQUOTE .db 2,"ok" lcall ITYPE QUIT2: lcall CR sjmp QUIT1