Hi Art, I had a look at this code when you first posted it ...
[FONT=courier new]
--- extend sign of 16-bit word into a long
: EXT16 ( sign16 -- sign32 ) DUP $8000 AND IF $1.0000 - THEN \ convert 16 bit twos complement number to real decimal
;
[/FONT]
This is way better than my 2s>R. I got a bit carried away trying to make it flexible per byte length - not really called for.
Thanks for your comments and improved code, Peter. Your changes are good learning for me. I have been away from this code long enough to need to study it again to understand. When I first looked at Tachyon I made this comment to myself in a note file: "NOT F****** AROUND WITH THIS ANYMORE. Tachyon is for chip heads that are way deeper than me. Bye bye . . ." but this environment is too beguiling so I came back. I'm still dog paddling but it's good.
LOL :nerd:
But as I sit in front of my Tachyon systems connecting to them easily via the Ethernet, transfer files up and down on FTP, manipulate virtual memory files on the SD file system and access webpages stored on them while I write some test code through Telnet I just think "this is pretty cool". All I need now is a P2 or another Prop as the terminal (+editor) and it's stand-alone. Maybe I might even try to tackle a simple text VGA + editor on the same Prop I'm not aware of any other Prop systems that can do all this on an unenhanced Prop, and I'm really only using the one cog! (at the moment). Or is that too "chip head" for you
But as I sit in front of my Tachyon systems connecting to them easily via the Ethernet, transfer files up and down on FTP, manipulate virtual memory files on the SD file system and access webpages stored on them while I write some test code through Telnet I just think "this is pretty cool". All I need now is a P2 or another Prop as the terminal (+editor) and it's stand-alone. Maybe I might even try to tackle a simple text VGA + editor on the same Prop I'm not aware of any other Prop systems that can do all this on an unenhanced Prop, and I'm really only using the one cog! (at the moment). Or is that too "chip head" for you
actually, when I want to play/work Propeller I have a laptop or tablet anyhow with a serial, ethernet / future Bluetooth (you have it already Peter)
with all my other things (mail internet etc...)
but I usually have no extra VGA plus kbd/mouse with me ... so I can't see a need for a real standalone.
Intermediate option would be kind of texteditor based on ANSI-Terminal, that can run over serial, bluetooth, telnet - but a simple editor is everywhere ..
so I think effort is better spent on other enhancements before the standalone idea.
Like webserver with cgi/js/AJAX/xml support ... to write nice interactive WEB-GUIs
m2c
actually, when I want to play/work Propeller I have a laptop or tablet anyhow with a serial, ethernet / future Bluetooth (you have it already Peter)
with all my other things (mail internet etc...)
but I usually have no extra VGA plus kbd/mouse with me ... so I can't see a need for a real standalone.
Intermediate option would be kind of texteditor based on ANSI-Terminal, that can run over serial, bluetooth, telnet - but a simple editor is everywhere ..
so I think effort is better spent on other enhancements before the standalone idea.
Like webserver with cgi/js/AJAX/xml support ... to write nice interactive WEB-GUIs
m2c
And just to chime in: loadable PASM modules so we can have access to F32 and the rest of PASM OBEX
As far as the webserver/AJAX goes this should be very straight forward once I get my head around this basic HTTP server. It's just another header type that needs the correct handler to create the correct response header back to the browser. I have a set of java powered guages that I use with the current spin webserver, all the ajax request does is query for a few variables that are updated server side and sent back that control the guages browser side. Everything is 8.3 file format already for the webserver in spin that Mike G wrote.
As far as the webserver/AJAX goes this should be very straight forward once I get my head around this basic HTTP server. It's just another header type that needs the correct handler to create the correct response header back to the browser. I have a set of java powered guages that I use with the current spin webserver, all the ajax request does is query for a few variables that are updated server side and sent back that control the guages browser side. Everything is 8.3 file format already for the webserver in spin that Mike G wrote.
I haven't had a look at Mike G's webserver .. pointer?
Very soon after I discovered the Propeller I was a witness of the advent of Tachyon and therefore didn't do a lot in SPIN
only some PASM for timecritical parts.
I am also very interested in your gauges, as I am thinking the same direction.
Currently I am working with Peter on a Forth-scriptabe webserver, which will make AJAX and dynamic page creation in general very simple and flexible. This will be really fun. It also offloads the script code from the image to the SD card.
If you send me a PM (with email address) - I'd love to cooperate on this.
In case anyone is wondering what this retired bus driver is up to in Tachyon. Here it is.
Goal #1 a controller for my solar hydronic heat system.
Goal #2 a system base on this controller which might be of interest to others.
A bit of history. In about 1980 I designed and installed a solar heating system for my home. It is composed of six 4 x 8 foot collectors on a freestanding vertical wall on the roof of a new addition. There is a 2' over 12' roof sloping to the south which acts as a reflector to concentrate the sun. Storeage is in an insulated 1250 gallon tank buried under the kitchen. Heat was to be utilized by a 100' coil of copper pipe in the tank to preheat cold water on the way to the electric water heater and also for space heating via a heat exchanger in the return air of an external natural gas furnace. The space heating didn't work out well because of the many feet of moderately insulated ducts and the ancient furnace which finally croaked at the same time my marriage did the same. The water heating works quite well with tank temperatures of 178F observed with good weather in the fall. By 1982 I had made a decent controller using a 68HC11 board from New Micros Inc which had Forth resident. I whomped up a system with the NMI board at the heart and a lot of amazingly functional and durable point-to-point wired circuitry that I designed myself, with the help of some manuals and spec sheets, of course. It had a 2 line LCD display but required a PC to do real data collection and set parameters. And it had a really clunky power supply.
About 5 years ago I re-engineered the power supply just before leaving town for 30 days. While I was gone one of the connections to the PS slipped out and the system was very unhappy. As we said in the USAF "INOP". So I decided to revive an old dream of a much simpler system with an HP48 calculator as the user interface. Meanwhile I have been operating the collector pump and drain valve using an HP48 connected to an X-10 powerline modem and appropriate relays. So operation is on a time of day basis without reference to any temperature measurements. Non-optimal. I won't go into all the false starts, including purchase of a newer board from New Micros just as they were going into bankruptcy, and other times I just lost my resolve ( not so young anymore ). However when I finally decided to try the Propeller and found Propforth and then Tachyon I kind of got my fire lit again.
At first I was determined to have a system using the hp48 as above with a DMM for reading sensors and X-10 for control. The Prop is necessary because the calculator only has one port and no control lines for switching a port multiplexer. As I slogged ahead the points started adding up against the DMM idea even though the hp48 and the DMM could converse easily. I wanted to use the DMM because it would allow me to read my favorite sensors directly in degrees Kelvin. The AD590 temperature sensors require only 2 wires and may be powered by any voltage from 4 to 30, returning the reading as a regulated current of 1 microamp per deg K. One of my early discoveries with this sensor was that it should be strobed at a small duty cycle to prevent self-heating. This was done easily with the NMI board - more on this later. One of the big points against the DMM was when I learned that very few DMMs are really good at measuring microamps and I was pretty sure my Protek 506 was not one of them. So very recently I ditched the DMM and learned to use the TI-1115 16 bit ADC. This was my first attempt to use an interface other than RS-232. Thanks to Tachyon it wasn't very hard. I'm not measuring current anymore but a bonus is that with a carefully constructed resistor network I get a reading from the ADC identical to degrees F. Yeah, Celcius is more scientific - call me a troglodyte. The 16 bits may be overkill but it lets me measure a very wide range and place the important stuff near the center of the range.
X-10 because the relays are cheap and I finally found a reliable powerline modem by JV Digital Engineering < jvde.us >. Already using X-10 with an HP-48. Will need to transfer that function to the Prop.
HP48 because:
- it has a serial port
- it has a date/time system that can do very fancy things by running programs on a schedule in which the schedule can be
modified under software control.
- it has a very accessable and powerful programming environment at which I am skilled.
- there are customizable menus, keyboard, display, port, strings, clock and heavy duty math and analysis functions.
- I prefer the programming environment on the 48 but by moving to the HP50 data can be stored on SD memory.
- all this in an extremely low power moderately expensive package.
Alright, enough justification. Current status is a Prop with 3 RS-232 ports tested functional ( now only need 2 ), an Adafruit TI-1115 ADC board and a special counter circuit for addressing the sensors. 'Art, why do you need that?' Because I was thinking that the voltage needed to drive the AD590 was 3-30v but when I rechecked the specs I saw that it was 4-30. Dang! So I regressed to my glue chip days and put in a 74HC4017 decade counter. Powered from Vin on the Prop it supposedly needs more than the 3.3 volts from the Prop ports to clock it but I correctly guessed that it would work. I have pins Q1 through Q9 to drive sensors with Q0 reserved for 'all off'. To address all 9 sensors in sequence I only need to send a reset pulse ( should already be reset, but init anyway to be sure ) and a clock pulse for each sensor in turn, pausing 20ms to let the little feller wake up. Sensor 'n' can be individually addressed with a reset and 'n' clocks. Only two Prop ports are required - and 4017s can be chained indefinitely.
So the hardware is all prototyped on a reasonably neat board ( see photo ) and is reasonably well tested for function. Software is next, Bwahahaha! My last heavy lifting in Forth or really any environment except HP User code was about 30 years ago. I want to do the project in Forth because that is what I know best outside of QuickBasic. So when I started with the Prop I only touched SPIN lightly before plunging into PropForth and then Tachyon, recommended by Loopy Byteloose. This causes me some extra effort in reading the Tachyon code sometimes. I like Tachyon and while I could use documentation that is more friendly to my skill level I understand why it is not that way and I have gotten better at combing the code files and creating my own.
I comment heavily to aid in understanding code while writing it and for understanding when revisiting it later. Out of luck otherwise. Thanks to Peter for code improvements to some of my posts. Recently learned about B>W and W>B that way. I also sometimes give words names that are quirky and need improvement, i.e., EXT16 instead of 2s>R for a function to convert a twos-complement number to a real. Such assistance is welcome whenever someone feels so inclined. However I will admit to liking my own ideas a lot. Can you tell?
Thanks, Markus. That is an outstanding link. I have seen them before and shied away because I know the AD590 so well and have not been eager to take on interfaces that are new to me. I am beginning to get over that. Tachyon helps. I will look into it.
Thanks, Markus. That is an outstanding link. I have seen them before and shied away because I know the AD590 so well and have not been eager to take on interfaces that are new to me. I am beginning to get over that. Tachyon helps. I will look into it.
just load Peter's 1-WIRE.fth from DROPBOX or web-files
there is a working example for the DS18B20 - you only have to get the one pin number right ;-)
I haven't had a look at Mike G's webserver .. pointer?
Very soon after I discovered the Propeller I was a witness of the advent of Tachyon and therefore didn't do a lot in SPIN
only some PASM for timecritical parts.
I am also very interested in your gauges, as I am thinking the same direction.
Currently I am working with Peter on a Forth-scriptabe webserver, which will make AJAX and dynamic page creation in general very simple and flexible. This will be really fun. It also offloads the script code from the image to the SD card.
If you send me a PM (with email address) - I'd love to cooperate on this.
I am looking for a good beginners book on assembly language do you have any suggestions?
Since this is the Tachyon thread I will give you a Tachyon specific answer in this regard. You mentioned in another concurrent post tacked onto a 9 year old thread about assembly language for the Basic Stamp. Dude, the Basic Stamp is about Basic, and Tachyon Forth is about Forth although the source code is a good place to learn more about Propeller Assembly code, but assembly language is very specific to the processor, and they are all different. We are very helpful here on the Parallax forum but you might have to be a bit more specific about what you want to know as long as it is specifically about Parallax products
Since this is the Tachyon thread I will give you a Tachyon specific answer in this regard. You mentioned in another concurrent post tacked onto a 9 year old thread about assembly language for the Basic Stamp. Dude, the Basic Stamp is about Basic, and Tachyon Forth is about Forth although the source code is a good place to learn more about Propeller Assembly code, but assembly language is very specific to the processor, and they are all different. We are very helpful here on the Parallax forum but you might have to be a bit more specific about what you want to know as long as it is specifically about Parallax products
But his post does add to the thread count so it's not all for not
@Pilot0315 Welcome to fight club, I mean the forums.
I had a running version on my Spinneret and while loading experimental stuff I got Dictionary full.
Without reading the full doc I remembered RECLAIM and issued it.
Apparently it reclaimed a lot - too much for me.
So I tried to rebuild from latest sources.
After a few attempts getting all right PCB, IP, loading sequence ... :-(
I had a running system again -
ftp and telnet are fine,
but on trying http via Firefox by just typing the IP address I get this:
[h=1]Not Found[/h] The requested page was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
GO
*** Tachyon Forth Network and File Server ***
Mounted SD Card
Media mounted as 5957.3321 MSDOS5.0 NO NAME FAT32 Cluster size = 2,768 Sectors = 3,600
as said - previous build worked fine, including HTTP
btw: I have a EVAL$ ready, that can eval a string containing Tachyon code,
will be useful for evaluating FORTH$.
Also decoding of encoded URL messages .. the %20 -> BL stuff is more or less working.
Just couldn't test it yet... see above..
I had a running version on my Spinneret and while loading experimental stuff I got Dictionary full.
Without reading the full doc I remembered RECLAIM and issued it.
Apparently it reclaimed a lot - too much for me.
So I tried to rebuild from latest sources.
After a few attempts getting all right PCB, IP, loading sequence ... :-(
I had a running system again -
ftp and telnet are fine,
but on trying http via Firefox by just typing the IP address I get this:
anything obvoius I do wrong ?
as said - previous build worked fine, including HTTP
btw: I have a EVAL$ ready, that can eval a string containing Tachyon code,
will be useful for evaluating FORTH$.
Also decoding of encoded URL messages .. the -> BL stuff is more or less working.
Just couldn't test it yet... see above..
Thanks, Markus
Well the Tachyon system isn't exactly a sealed black box is it!? Apply the EVAL$ (well done) to yourself and you should be able to step through parts of the code that would execute but at the very basic level just check /HOME.HTM works or even try it via FTP. Let me know what you find out.
Apply the EVAL$ (well done) to yourself and you should be able to step through parts of the code that would execute but at the very basic level just check /HOME.HTM works or even try it via FTP. Let me know what you find out.
I did a complete rebuild from the latest Google sources ...
FTP all fine
HTTP from Firefox still 404
I peeked at GET$ after the request and find a strange string.
GET$ PRINT$ allax, Inc.
www.parallax.com=============== ok
A search for this in my whole Tachyon folders does not show s.th. relevant ... hmm ???
ok
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
Cold start - no user code - setting defaults
----------------------------------------------------------------
CREATE SMALL ok
( EXTEND.fth ) ok
IFDEF EXTEND.fth ok
ok
ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
ok
0000 okCLR
0001 ok
0002 ok
0003 ok
0004 ok
0005 ok
0006 ok
0007 ok
0008 ok
0009 ok
0010 ok
0011
0012
0013 ok
0014
0015
0016 ok
0017 ok
0018 ok
0019 ok
0020 ok
0021 ok
0022 ok
0023 ok
1192 ok
\
1193
00:00:00 End of source code, 1194 lines processed and 0000 errors found
MODULES LOADED:
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
NAMES: $6145...7442 for 4861 (2415 bytes added)
CODE: $0000...2831 for 5428 (4016 bytes added)
CALLS: 0603 vectors free
RAM: 14612 bytes free
ok
\
EEPROM 9600d SERBAUD ok
?BACKUP ok
ok
ok
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
NAMES: $6145...7442 for 4861 (2415 bytes added)
CODE: $0000...2831 for 5428 (4016 bytes added)
CALLS: 0603 vectors free
RAM: 14612 bytes free
MODULES LOADED:
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
BOOT: EXTEND.boot
----------------------------------------------------------------
( SPINNERET.fth ) ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
ok
0000 ok
0109 okINNERET.fth not found
0110 ok
0111
00:00:00 End of source code, 0112 lines processed and 0000 errors found
MODULES LOADED:
2831: SPINNERET.fth Spinneret + W5100 HARDWARE DEFINITIONS 131204.1200
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
NAMES: $602C...7442 for 5142 (0281 bytes added)
CODE: $0000...29B4 for 5534 (0387 bytes added)
CALLS: 0572 vectors free
RAM: 13944 bytes free
ok
Von --> Von <-- not found
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
ok
0310 SDCARD.fth not found
00:00:00 End of source code, 0311 lines processed and 0000 errors found
MODULES LOADED:
29B4: SDCARD.fth SD CARD Toolkit - 140121.2200
2831: SPINNERET.fth Spinneret + W5100 HARDWARE DEFINITIONS 131204.1200
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
NAMES: $5D97...7442 for 5803 (0661 bytes added)
CODE: $0000...2EDE for 6195 (1322 bytes added)
CALLS: 0501 vectors free
RAM: 11961 bytes free
ok
ok
ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
ok
0398 okSYFILE.fth not found
\
0399
00:00:00 End of source code, 0400 lines processed and 0000 errors found
MODULES LOADED:
2EDE: EASYFILE.fth FAT32 Virtual Memory Access File System Layer V1.1 140528-0000
29B4: SDCARD.fth SD CARD Toolkit - 140121.2200
2831: SPINNERET.fth Spinneret + W5100 HARDWARE DEFINITIONS 131204.1200
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
NAMES: $59AE...7442 for 6804 (1001 bytes added)
CODE: $0000...391C for 7816 (2622 bytes added)
CALLS: 0397 vectors free
RAM: 8338 bytes free
ok
?BACKUP ok
\
\
ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
ok
0340 ok100.fth not found
0341
00:00:00 End of source code, 0342 lines processed and 0000 errors found
MODULES LOADED:
391C: W5100.fth WIZNET W5100 driver 140615.0000
2EDE: EASYFILE.fth FAT32 Virtual Memory Access File System Layer V1.1 140528-0000
29B4: SDCARD.fth SD CARD Toolkit - 140121.2200
2831: SPINNERET.fth Spinneret + W5100 HARDWARE DEFINITIONS 131204.1200
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
NAMES: $54A6...7442 for 8092 (1288 bytes added)
CODE: $0000...4088 for 8428 (1900 bytes added)
CALLS: 0264 vectors free
RAM: 5150 bytes free
ok
?BACKUP ok
ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23140617.0000
ok
0537 okSYNET.fth not found
0538
00:00:00 End of source code, 0539 lines processed and 0000 errors found
MODULES LOADED:
4088: EASYNET.fth WIZNET NETWORK SERVERS 140615.2300
391C: W5100.fth WIZNET W5100 driver 140615.0000
2EDE: EASYFILE.fth FAT32 Virtual Memory Access File System Layer V1.1 140528-0000
29B4: SDCARD.fth SD CARD Toolkit - 140121.2200
2831: SPINNERET.fth Spinneret + W5100 HARDWARE DEFINITIONS 131204.1200
1881: EXTEND.fth Primary extensions to TACHYON kernel - 140604-02OO
NAMES: $50B6...7442 for 9100 (1008 bytes added)
CODE: $0000...4EC2 for 11062 (3642 bytes added)
CALLS: 0159 vectors free
RAM: 0500 bytes free
ok
ok
{ ok
{ ok
ok
ok
\
\
---
\
?BACKUP ok
ok
\
\
ok
GO
*** Tachyon Forth Network and File Server ***
Mounted SD Card
Media mounted as 5957.3321 MSDOS5.0 NO NAME FAT32 Cluster size = 2,768 Sectors = 3,600
Listing directory
NO NAME
POPCORN .WAV ROM .BIN SDCARD .FTH SYSLOG .TXT TACHYON .JPG
TACHYON .LST W5200 .FTH CE1372 .FTH EXTEND .FTH FAVICON .ICO
HOME .HTM HTTP001 .HTM HTTP404 .HTM LOG0001 .TXT LOG0002 .TXT
LOG0003 .TXT LOG0004 .TXT LOG0005 .TXT LOG0006 .TXT LOG0007 .TXT
LOG0008 .TXT LOGON . LOGON .TXT MULTIFAT.FTH NETWORK .FTH
PARALLAX.PNG ... ready!
************ NETWORK STATUS ************
HARDWARE: SPINNERET using WIZnet W5100 (indirect mode)
SRC IP 192.168.188.157.
MASK 255.255.255.000.
GATEWAY 192.168.188.001.
MAC 02.FF.BE.AE.70.FD.
*** SOCKETS ***
#0 14:06:50 MODE= CLSD PORT# 80 TXRW= . .RXRW= . .RXSZ= .IR=00 ST=00 CLOSED
#1 14:06:50 MODE= TCP PORT# 21 TXRW= . .RXRW= . .RXSZ= .IR=00 ST=14 LISTEN
#2 14:06:50 MODE= TCP PORT# 80 TXRW= . .RXRW= . .RXSZ= .IR=00 ST=14 LISTEN
#3 14:06:50 MODE= TCP PORT# 23 TXRW= . .RXRW= . .RXSZ= .IR=00 ST=14 LISTEN
* WEB, FTP, and TELNET servers running *
ok
Mounted SD Card
Media mounted as 5957.3321 MSDOS5.0 NO NAME FAT32 Cluster size = 2,768 Sectors = 3,600
#2 14:07:22 MODE= TCP PORT# 80 56876 TXRW=ADC0.ADC0.RXRW= . 12A.RXSZ= 12A.IR=04 ST=17 ESTABLISHED 192.168.188.021.
HTTP/1.1
Host: 192.168.188.157
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
#2 14:07:23 MODE= TCP PORT# 80 56877 TXRW=F58B.F58B.RXRW= . 135.RXSZ= 135.IR=04 ST=17 ESTABLISHED 192.168.188.021.
HTTP/1.1
Host: 192.168.188.157
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
ok
GET$ PRINT$ allax, Inc. ----------------www.parallax.com=============== ok
EDIT: found the string here:
0000_FF10: 20 43 6F 70 79 72 69 67 68 74 20 32 30 30 35 20 Copyright 2005
0000_FF20: 20 50 61 72 61 6C 6C 61 78 2C 20 49 6E 63 2E 20 Parallax, Inc.
0000_FF30: 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D ----------------
0000_FF40: 77 77 77 2E 70 61 72 61 6C 6C 61 78 2E 63 6F 6D www.parallax.com
0000_FF50: 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D ================
We know that every time we make assumptions that we get caught time and time again
.HEX is really an internal word for printing nibbles in HEX characters.
From the Tachyon 2.3 source code:
[FONT=courier new]' .HEX ( n -- ) print nibble n as a hex character
PRTHEX ' ( n -- ) print n (0..$0F) as a hex character
byte toNIB
byte PUSH1,$30,PLUS
byte DUP,PUSH1,$39,GT,_IF,03,_BYTE,7,PLUS 'Adjust for A..F
PRTCH byte XCALL,xEMIT,EXIT
[/FONT]
I know that I later created a word called .DEC to print out a number in decimal so perhaps the name choice for .HEX could have been different in hindsight but numbers are normally forced to print in hex notation using either .LONG or .WORD or .BYTE plus a few other methods. Normally in Forth there is just the dot word and variations ( . .R U. U.R ) for printing numbers and you normally have to change the base beforehand. I have added those hex print words as mentioned plus .DEC and also a number format routine .NUM for specifying how a number should be printed by passing a control parameter which specifies:
b07..00 = base
b12..08 = digits
b13 = use spaces in place of leading zeros
b14 = force separators (decimals have a , every 3 places while others have a _ every 4 places)
b15 = force sign (always + or - depending upon the number)
We know that every time we make assumptions that we get caught time and time again
.HEX is really an internal word for printing nibbles in HEX characters.
From the Tachyon 2.3 source code:
[FONT=courier new]' .HEX ( n -- ) print nibble n as a hex character
PRTHEX ' ( n -- ) print n (0..$0F) as a hex character
byte toNIB
byte PUSH1,$30,PLUS
byte DUP,PUSH1,$39,GT,_IF,03,_BYTE,7,PLUS 'Adjust for A..F
PRTCH byte XCALL,xEMIT,EXIT
[/FONT]
I know that I later created a word called .DEC to print out a number in decimal so perhaps the name choice for .HEX could have been different in hindsight but numbers are normally forced to print in hex notation using either .LONG or .WORD or .BYTE plus a few other methods. Normally in Forth there is just the dot word and variations ( . .R U. U.R ) for printing numbers and you normally have to change the base beforehand. I have added those hex print words as mentioned plus .DEC and also a number format routine .NUM for specifying how a number should be printed by passing a control parameter which specifies:
b07..00 = base
b12..08 = digits
b13 = use spaces in place of leading zeros
b14 = force separators (decimals have a , every 3 places while others have a _ every 4 places)
b15 = force sign (always + or - depending upon the number)
Just done a quick little update and consolidated the DUMP words for RAM, EEPROM, and SD so that you specify which when you DUMP memory. I might even add COG to the fray too.
DUMP words are:
DUMP ( addr cnt -- ) Dump memory as hex bytes along with an ASCII listing on each line
DUMPW ( addr cnt -- ) Dump memory as hex words along with an ASCII listing on each line
DUMPL ( addr cnt -- ) Dump memory as hex longs along with an ASCII listing on each line
DUMPA ( addr cnt -- ) Dump memory as 64 ASCII characters per line
RAM --- latching prefix to select normal RAM (or ROM) memory for DUMP listing
EE --- latching prefix to select EEPROM for DUMP listing
SD --- latching prefix to select SD memory for DUMP listing
[FONT=courier new][B]$8000 $200 RAM DUMPA[/B]
0000.8000: .............................@UU.@U..@U..@U..@U..@...@...@...@..
0000.8040: .@...@...@...@...@U..@U..@U..@U..@UU............................
0000.8080: ..............................................(.....@..........?
0000.80C0: ...?....@.........(.............................................
0000.8100: .................................................._.@._.P._.....
0000.8140: ................../.............................................
0000.8180: ..........................@..*P...T...W..._....................?
0000.81C0: ...?.................._...W...T..*P...@......................... ok
[B]$8000 $200 EE DUMPA[/B]
0000.8000: CE1372 WIDGET HARDWARE DEFINITIONS 131109.2340 .FAT32 Virtual Me
0000.8040: mory Access File System Layer V1.1 140528-0000 .Media mounted as
0000.8080: . Cluster size = . Sectors = . Mounted SD Card . *Format Erro
0000.80C0: r* .*Card Error* . *No Card inserted!* ....opened at . not found
0000.8100: . to .No file opened ././.:.:.........NAME .EXT ATRS SECTO
0000.8140: R DATE TIME SIZE .#.#. Saving EEPROM image to
0000.8180: .Loading EEPROM image . to EEPROM ..............................
0000.81C0: ................................................................ ok
[B]$8000 $200 SD DUMPA[/B]
0000.8000: ................................................................
0000.8040: ............................................................ ...
0000.8080: !..."...#...$...%...&...'...(...)...*...+...,...-......./...0...
0000.80C0: 1...2...3...4...5...6...7...8...9...:...;...<...=...>...?...@...
0000.8100: A...B...C...D...E...F...G...H.......J...K...L...M...N...O...P...
0000.8140: Q...R...S...T...U...V...W...X...Y...Z...[...\...]...^..._...`...
0000.8180: a...b...c...d...e...f...g...h...i...j...k...l...m...n...o...p...
0000.81C0: q...r...s...t...u...v...w...x...y...z...{...|...}...~........... ok
[B]@ROOT $200 SD DUMPA[/B]
0076.3400: CE1067 ......D.D.....D......DEBUG ROM .d...D.D.....D......
0076.3440: FAVICON ICO .d...D.D..<O.C......FIRMWAREROM .d...D.D.....D......
0076.3480: HELP TXT .d...D.D..!r.D%.....HOME HTM ..-..D.D.....D.A....
0076.34C0: HTTP404 HTM .d...D.D..TO.C7.4...MENU TXT .d...D.D.....D8.....
0076.3500: PREVIOUSROM .d...D.D.....D9.....CANB0001LOG .d...D.D...sXDI.....
0076.3540: CANB0002LOG .d...D.D...sXDI.....CANB0003LOG .d...D.D...sXDI.....
0076.3580: CANB0004LOG .d...D.D...sXDI.....CANB0005LOG .d...D.D...sXDI.....
0076.35C0: CANB0006LOG .d...D.D...sXDI.....CANB0007LOG .d...D.D...sXDI..... ok[/FONT]
Peter,
in working on the Tachyon extensible scriptable WebServer I am wondering.
If the webserver is not intended to be only static and preloaded on SD-card,
then .HTM, *.JPG etc. and .HTX script files need to also be ADDED and not only be changed remotely.
The SD filesystem and the FTP-server do not seem to be designed to create new files remotely - atm at least.
trying to put a non existing file gives
[code]Befehl: PASV
Antwort: 227 Entering Passive Mode with port (192,168,188,157,156,152)
Befehl: STOR NEWTEST.TXT.txt
Antwort: 550 File not available
Fehler: Kritischer Datei
Peter,
in working on the Tachyon extensible scriptable WebServer I am wondering.
If the webserver is not intended to be only static and preloaded on SD-card,
then .HTM, *.JPG etc. and .HTX script files need to also be ADDED and not only be changed remotely.
The SD filesystem and the FTP-server do not seem to be designed to create new files remotely...
I've been able to get away with it and even though I have been using dummy files and renaming them (yes), I see the need to be able to add new files. I don't think it's a big deal to add the extra sections to the file system but I do want to make sure that files are non-fragmented and even with a very basic 4GB card there is plenty of room there to allocate contiguous sectors and clusters. So you might not have to wait too long for this extra functionality to be added.
As for memory I have been using EPRINT to store text strings to the top half of a 64K EEPROM to give me extra room but I may also look at using the SD memory a little bit more, either for dictionary, precompiled blobs, or even direct "scripting" from text files. So far I've been able to add a rather largish application on top of all these layers and still have memory free! I do a RECLAIM just before I add the application though.
Mainly to make it easier to read and clearer to see the structure, in the first there are WORD variables, 9 of them in fact, in the second it's a table for constants or variables maybe and there are 9 words or is that 2 lots of 9 bytes? So the first example is a lot clearer.
There seems to be a confusing number of ways to indicate comments in the source code.
/
{ }
'
''
(
I am clear on the first two. Could use an explanation of the others.
And while I'm on a roll, what is the meaning of the vertical bar in \ test quadrant 3|4 ?
The \ (not /) is a Forth standard as is ( too except I echo anything inside a ( which is normally a stack comment but totally ignore anything after a \ up to the end of line.
The { } are intended for multi-line block comments.
' is not a comment directive in Forth but it is to the Spin compiler which is used to process the PASM and data structures that make up the precompiled kernel.
" is not a comment directive either but is used in TF either in the form of a character literal "$" or for strings such as " HELLO WORLD" PRINT$
But you missed some too
I use the --- a lot since it allows me to space out a comment --- --- --- --- out to where I want it --- just so forum BB code doesn't gobble up whitespace plus --- does not clutter or confuse reading code like 1405 7 / \ is confusing
There's also \\\ and *** but I use that mainly to disable lines of code and to distinguish this from a real comment although they work the same way.
It could also be said that IFDEF and IFNDEF are conditional comment directives too because if they fail they end up working like a block comment { up to the following }
If you're on a roll it could be dangerous, that is if you're a pig and it's a pork roll. But you mentioned a symbol being used in a comment but a comment can be anything at all, however just to satisfy your curiosity the | is just a separator referring to the quadrants 1 (top right) 2 (top left) 3 (bottom left) 4 (bottom right).
The | is also used to build bytes into a table instead of the more standard but unsightly C, as the | works more like a border in a real table so 45 | 07 | 23 | looks more like a table than 45 C, 07 C, 23 C, doesn't it?
I was so used to having only one or two characters to indicate comments that I hadn't noticed that ( would do it. I was using a \ before the ( . I can see now that seeing ( and not \ ( was confusing me. That's cleared up.
Here's another.
From the kernel:
{ quick test
pub TC ( ch -- )
CASE
"4" =[ ." Knock on the door, it's a 4" ]=
"5" =[ ." Let's jive, it's a 5" ]=
"7" "9" ..[ ." Pick up sticks, it's more than six" ]=
;
}
Can't determine what =[ and ]= do. Also ..[
I know the whole clip is a comment but I don't what's going on there. Help?
Comments
This is way better than my 2s>R. I got a bit carried away trying to make it flexible per byte length - not really called for.
LOL :nerd:
But as I sit in front of my Tachyon systems connecting to them easily via the Ethernet, transfer files up and down on FTP, manipulate virtual memory files on the SD file system and access webpages stored on them while I write some test code through Telnet I just think "this is pretty cool". All I need now is a P2 or another Prop as the terminal (+editor) and it's stand-alone. Maybe I might even try to tackle a simple text VGA + editor on the same Prop I'm not aware of any other Prop systems that can do all this on an unenhanced Prop, and I'm really only using the one cog! (at the moment). Or is that too "chip head" for you
with all my other things (mail internet etc...)
but I usually have no extra VGA plus kbd/mouse with me ... so I can't see a need for a real standalone.
Intermediate option would be kind of texteditor based on ANSI-Terminal, that can run over serial, bluetooth, telnet - but a simple editor is everywhere ..
so I think effort is better spent on other enhancements before the standalone idea.
Like webserver with cgi/js/AJAX/xml support ... to write nice interactive WEB-GUIs
m2c
And just to chime in: loadable PASM modules so we can have access to F32 and the rest of PASM OBEX
As far as the webserver/AJAX goes this should be very straight forward once I get my head around this basic HTTP server. It's just another header type that needs the correct handler to create the correct response header back to the browser. I have a set of java powered guages that I use with the current spin webserver, all the ajax request does is query for a few variables that are updated server side and sent back that control the guages browser side. Everything is 8.3 file format already for the webserver in spin that Mike G wrote.
I haven't had a look at Mike G's webserver .. pointer?
Very soon after I discovered the Propeller I was a witness of the advent of Tachyon and therefore didn't do a lot in SPIN
only some PASM for timecritical parts.
I am also very interested in your gauges, as I am thinking the same direction.
Currently I am working with Peter on a Forth-scriptabe webserver, which will make AJAX and dynamic page creation in general very simple and flexible. This will be really fun. It also offloads the script code from the image to the SD card.
If you send me a PM (with email address) - I'd love to cooperate on this.
Goal #1 a controller for my solar hydronic heat system.
Goal #2 a system base on this controller which might be of interest to others.
A bit of history. In about 1980 I designed and installed a solar heating system for my home. It is composed of six 4 x 8 foot collectors on a freestanding vertical wall on the roof of a new addition. There is a 2' over 12' roof sloping to the south which acts as a reflector to concentrate the sun. Storeage is in an insulated 1250 gallon tank buried under the kitchen. Heat was to be utilized by a 100' coil of copper pipe in the tank to preheat cold water on the way to the electric water heater and also for space heating via a heat exchanger in the return air of an external natural gas furnace. The space heating didn't work out well because of the many feet of moderately insulated ducts and the ancient furnace which finally croaked at the same time my marriage did the same. The water heating works quite well with tank temperatures of 178F observed with good weather in the fall. By 1982 I had made a decent controller using a 68HC11 board from New Micros Inc which had Forth resident. I whomped up a system with the NMI board at the heart and a lot of amazingly functional and durable point-to-point wired circuitry that I designed myself, with the help of some manuals and spec sheets, of course. It had a 2 line LCD display but required a PC to do real data collection and set parameters. And it had a really clunky power supply.
About 5 years ago I re-engineered the power supply just before leaving town for 30 days. While I was gone one of the connections to the PS slipped out and the system was very unhappy. As we said in the USAF "INOP". So I decided to revive an old dream of a much simpler system with an HP48 calculator as the user interface. Meanwhile I have been operating the collector pump and drain valve using an HP48 connected to an X-10 powerline modem and appropriate relays. So operation is on a time of day basis without reference to any temperature measurements. Non-optimal. I won't go into all the false starts, including purchase of a newer board from New Micros just as they were going into bankruptcy, and other times I just lost my resolve ( not so young anymore ). However when I finally decided to try the Propeller and found Propforth and then Tachyon I kind of got my fire lit again.
At first I was determined to have a system using the hp48 as above with a DMM for reading sensors and X-10 for control. The Prop is necessary because the calculator only has one port and no control lines for switching a port multiplexer. As I slogged ahead the points started adding up against the DMM idea even though the hp48 and the DMM could converse easily. I wanted to use the DMM because it would allow me to read my favorite sensors directly in degrees Kelvin. The AD590 temperature sensors require only 2 wires and may be powered by any voltage from 4 to 30, returning the reading as a regulated current of 1 microamp per deg K. One of my early discoveries with this sensor was that it should be strobed at a small duty cycle to prevent self-heating. This was done easily with the NMI board - more on this later. One of the big points against the DMM was when I learned that very few DMMs are really good at measuring microamps and I was pretty sure my Protek 506 was not one of them. So very recently I ditched the DMM and learned to use the TI-1115 16 bit ADC. This was my first attempt to use an interface other than RS-232. Thanks to Tachyon it wasn't very hard. I'm not measuring current anymore but a bonus is that with a carefully constructed resistor network I get a reading from the ADC identical to degrees F. Yeah, Celcius is more scientific - call me a troglodyte. The 16 bits may be overkill but it lets me measure a very wide range and place the important stuff near the center of the range.
X-10 because the relays are cheap and I finally found a reliable powerline modem by JV Digital Engineering < jvde.us >. Already using X-10 with an HP-48. Will need to transfer that function to the Prop.
HP48 because:
- it has a serial port
- it has a date/time system that can do very fancy things by running programs on a schedule in which the schedule can be
modified under software control.
- it has a very accessable and powerful programming environment at which I am skilled.
- there are customizable menus, keyboard, display, port, strings, clock and heavy duty math and analysis functions.
- I prefer the programming environment on the 48 but by moving to the HP50 data can be stored on SD memory.
- all this in an extremely low power moderately expensive package.
Alright, enough justification. Current status is a Prop with 3 RS-232 ports tested functional ( now only need 2 ), an Adafruit TI-1115 ADC board and a special counter circuit for addressing the sensors. 'Art, why do you need that?' Because I was thinking that the voltage needed to drive the AD590 was 3-30v but when I rechecked the specs I saw that it was 4-30. Dang! So I regressed to my glue chip days and put in a 74HC4017 decade counter. Powered from Vin on the Prop it supposedly needs more than the 3.3 volts from the Prop ports to clock it but I correctly guessed that it would work. I have pins Q1 through Q9 to drive sensors with Q0 reserved for 'all off'. To address all 9 sensors in sequence I only need to send a reset pulse ( should already be reset, but init anyway to be sure ) and a clock pulse for each sensor in turn, pausing 20ms to let the little feller wake up. Sensor 'n' can be individually addressed with a reset and 'n' clocks. Only two Prop ports are required - and 4017s can be chained indefinitely.
So the hardware is all prototyped on a reasonably neat board ( see photo ) and is reasonably well tested for function. Software is next, Bwahahaha! My last heavy lifting in Forth or really any environment except HP User code was about 30 years ago. I want to do the project in Forth because that is what I know best outside of QuickBasic. So when I started with the Prop I only touched SPIN lightly before plunging into PropForth and then Tachyon, recommended by Loopy Byteloose. This causes me some extra effort in reading the Tachyon code sometimes. I like Tachyon and while I could use documentation that is more friendly to my skill level I understand why it is not that way and I have gotten better at combing the code files and creating my own.
I comment heavily to aid in understanding code while writing it and for understanding when revisiting it later. Out of luck otherwise. Thanks to Peter for code improvements to some of my posts. Recently learned about B>W and W>B that way. I also sometimes give words names that are quirky and need improvement, i.e., EXT16 instead of 2s>R for a function to convert a twos-complement number to a real. Such assistance is welcome whenever someone feels so inclined. However I will admit to liking my own ideas a lot. Can you tell?
I am perfectly happy with DS18B20 temperature sensors.
They require only 3 - 5 V supply and give digital results.
NO ADCs and the disturbances on long lines ...
you can even run them with 2 wires - 1-wire + GND in parasitic mode.
- and got them cheap, ready with cables and steel caps in the dozend from EBAY
http://www.ebay.com/itm/10pcs-New-DS18B20-Digital-Thermal-Probe-Temperature-Sensor-1m-Waterproof-/161015469495?pt=LH_DefaultDomain_0&hash=item257d4515b7
Just recently tried Peters 1-Wire driver for Tachyon and have a multi-bus extension ready, but not yet fully documented.
A little Propeller Board can drive a LCD or even VGA display,
does not need much power - great for a 24*365 application like yours.
And now with the telnet & webserver in Tachyon, you can monitor and control everything from the WEB.
really great
Markus
there is a working example for the DS18B20 - you only have to get the one pin number right ;-)
PM Sent,
Mike G's WebServer is in the this entire section:
http://forums.parallax.com/forumdisplay.php/82-Spinneret-Web-Server
Since this is the Tachyon thread I will give you a Tachyon specific answer in this regard. You mentioned in another concurrent post tacked onto a 9 year old thread about assembly language for the Basic Stamp. Dude, the Basic Stamp is about Basic, and Tachyon Forth is about Forth although the source code is a good place to learn more about Propeller Assembly code, but assembly language is very specific to the processor, and they are all different. We are very helpful here on the Parallax forum but you might have to be a bit more specific about what you want to know as long as it is specifically about Parallax products
But his post does add to the thread count so it's not all for not
@Pilot0315 Welcome to fight club, I mean the forums.
I had a running version on my Spinneret and while loading experimental stuff I got Dictionary full.
Without reading the full doc I remembered RECLAIM and issued it.
Apparently it reclaimed a lot - too much for me.
So I tried to rebuild from latest sources.
After a few attempts getting all right PCB, IP, loading sequence ... :-(
I had a running system again -
ftp and telnet are fine,
but on trying http via Firefox by just typing the IP address I get this: anything obvoius I do wrong ?
as said - previous build worked fine, including HTTP
btw: I have a EVAL$ ready, that can eval a string containing Tachyon code,
will be useful for evaluating FORTH$.
Also decoding of encoded URL messages .. the %20 -> BL stuff is more or less working.
Just couldn't test it yet... see above..
Thanks, Markus
Well the Tachyon system isn't exactly a sealed black box is it!? Apply the EVAL$ (well done) to yourself and you should be able to step through parts of the code that would execute but at the very basic level just check /HOME.HTM works or even try it via FTP. Let me know what you find out.
I did a complete rebuild from the latest Google sources ...
FTP all fine
HTTP from Firefox still 404
I peeked at GET$ after the request and find a strange string.
GET$ PRINT$ allax, Inc.
www.parallax.com=============== ok
A search for this in my whole Tachyon folders does not show s.th. relevant ... hmm ???
EDIT: found the string here:
#2 14:07:22 MODE= TCP PORT# 80 56876 TXRW=ADC0.ADC0.RXRW= . 12A.RXSZ= 12A.IR=04 ST=17 ESTABLISHED 192.168.188.021.
HTTP/1.1
Host: 192.168.188.157
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
#2 14:07:23 MODE= TCP PORT# 80 56877 TXRW=F58B.F58B.RXRW= . 135.RXSZ= 135.IR=04 ST=17 ESTABLISHED 192.168.188.021.
HTTP/1.1
Host: 192.168.188.157
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
ok
GET$ PRINT$ allax, Inc.
www.parallax.com=============== ok
[/code][/QUOTE]
Are you able to put the server online? Maybe just PM me an IP and have ports forwarded?
We know that every time we make assumptions that we get caught time and time again
.HEX is really an internal word for printing nibbles in HEX characters.
From the Tachyon 2.3 source code:
I know that I later created a word called .DEC to print out a number in decimal so perhaps the name choice for .HEX could have been different in hindsight but numbers are normally forced to print in hex notation using either .LONG or .WORD or .BYTE plus a few other methods. Normally in Forth there is just the dot word and variations ( . .R U. U.R ) for printing numbers and you normally have to change the base beforehand. I have added those hex print words as mentioned plus .DEC and also a number format routine .NUM for specifying how a number should be printed by passing a control parameter which specifies:
b07..00 = base
b12..08 = digits
b13 = use spaces in place of leading zeros
b14 = force separators (decimals have a , every 3 places while others have a _ every 4 places)
b15 = force sign (always + or - depending upon the number)
Have fun!
DUMP words are:
DUMP ( addr cnt -- ) Dump memory as hex bytes along with an ASCII listing on each line
DUMPW ( addr cnt -- ) Dump memory as hex words along with an ASCII listing on each line
DUMPL ( addr cnt -- ) Dump memory as hex longs along with an ASCII listing on each line
DUMPA ( addr cnt -- ) Dump memory as 64 ASCII characters per line
RAM --- latching prefix to select normal RAM (or ROM) memory for DUMP listing
EE --- latching prefix to select EEPROM for DUMP listing
SD --- latching prefix to select SD memory for DUMP listing
in working on the Tachyon extensible scriptable WebServer I am wondering.
If the webserver is not intended to be only static and preloaded on SD-card,
then .HTM, *.JPG etc. and .HTX script files need to also be ADDED and not only be changed remotely.
The SD filesystem and the FTP-server do not seem to be designed to create new files remotely - atm at least.
trying to put a non existing file gives
[code]Befehl: PASV
Antwort: 227 Entering Passive Mode with port (192,168,188,157,156,152)
Befehl: STOR NEWTEST.TXT.txt
Antwort: 550 File not available
Fehler: Kritischer Datei
I've been able to get away with it and even though I have been using dummy files and renaming them (yes), I see the need to be able to add new files. I don't think it's a big deal to add the extra sections to the file system but I do want to make sure that files are non-fragmented and even with a very basic 4GB card there is plenty of room there to allocate contiguous sectors and clusters. So you might not have to wait too long for this extra functionality to be added.
As for memory I have been using EPRINT to store text strings to the top half of a 64K EEPROM to give me extra room but I may also look at using the SD memory a little bit more, either for dictionary, precompiled blobs, or even direct "scripting" from text files. So far I've been able to add a rather largish application on top of all these layers and still have memory free! I do a RECLAIM just before I add the application though.
FTP Rename RNFR & RNTO seem to work - see latest EASYNET.fth - still commented
#9 WORDS: tempsens
How is that different from:
TABLE tempsens 2 9 * ALLOT
/
{ }
'
''
(
I am clear on the first two. Could use an explanation of the others.
And while I'm on a roll, what is the meaning of the vertical bar in \ test quadrant 3|4 ?
Mainly to make it easier to read and clearer to see the structure, in the first there are WORD variables, 9 of them in fact, in the second it's a table for constants or variables maybe and there are 9 words or is that 2 lots of 9 bytes? So the first example is a lot clearer.
The \ (not /) is a Forth standard as is ( too except I echo anything inside a ( which is normally a stack comment but totally ignore anything after a \ up to the end of line.
The { } are intended for multi-line block comments.
' is not a comment directive in Forth but it is to the Spin compiler which is used to process the PASM and data structures that make up the precompiled kernel.
" is not a comment directive either but is used in TF either in the form of a character literal "$" or for strings such as " HELLO WORLD" PRINT$
But you missed some too
I use the --- a lot since it allows me to space out a comment --- --- --- --- out to where I want it --- just so forum BB code doesn't gobble up whitespace plus --- does not clutter or confuse reading code like 1405 7 / \ is confusing
There's also \\\ and *** but I use that mainly to disable lines of code and to distinguish this from a real comment although they work the same way.
It could also be said that IFDEF and IFNDEF are conditional comment directives too because if they fail they end up working like a block comment { up to the following }
If you're on a roll it could be dangerous, that is if you're a pig and it's a pork roll. But you mentioned a symbol being used in a comment but a comment can be anything at all, however just to satisfy your curiosity the | is just a separator referring to the quadrants 1 (top right) 2 (top left) 3 (bottom left) 4 (bottom right).
The | is also used to build bytes into a table instead of the more standard but unsightly C, as the | works more like a border in a real table so 45 | 07 | 23 | looks more like a table than 45 C, 07 C, 23 C, doesn't it?
Here's another.
From the kernel: Can't determine what =[ and ]= do. Also ..[
I know the whole clip is a comment but I don't what's going on there. Help?