proteus-guy has quit [Ping timeout: 256 seconds]
dave0 has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
Zarutian_HTC has quit [Ping timeout: 264 seconds]
Zarutian_HTC has joined #forth
jsoft has quit [Ping timeout: 256 seconds]
iyzsong has joined #forth
dave0 has quit [Quit: dave's not here]
proteus-guy has joined #forth
karswell has joined #forth
karswell has quit [Remote host closed the connection]
karswell_ has joined #forth
proteus-guy has quit [Ping timeout: 256 seconds]
<Croran> john_cephalopoda: is the source for your mandelbrot thingie available separately?
actuallybatman has quit [Ping timeout: 260 seconds]
kori has quit [Ping timeout: 272 seconds]
<tabemann_> tpbsd: I see that your code use i within words
<tpbsd> yes
<tabemann_> are you relying on some ra magic to make that possible?
<tpbsd> not that I'm aware off, i is just the loop counter
<tabemann_> yeah, but normally the loop counter is kept on the return stack
<tpbsd> i ( - -u|n ) Gives innermost loop index
<tpbsd> j ( - -u|n ) Gives second loop index
<tpbsd> k ( - -u|n ) Gives third loop index
<crc> Croran: http://forth.works/examples/mandelbrot.retro.html is an older copy of john's mandlebrot code
<tpbsd> k and k are also available
<tpbsd> tabemann_, I used I in my non RA days also
<tabemann_> hmm
tabemann_ is now known as tabemann
<tpbsd> all code that runs on RA also runs on non RA afaik
dddddd has quit [Ping timeout: 256 seconds]
<tpbsd> there are no "RA only" apps Ive seen
<tabemann> okay, just checked
<tabemann> i is always in a register, whereas j and k are on the return stack
<tpbsd> ah!
<tpbsd> but theyre still available in Mecrisp-Stellaris
webchat9 has joined #forth
<tabemann> yes
<tpbsd> RA Core Register Usage
<tpbsd> r0 Free scratch register Saved on interrupt entry by hardware r1 Free scratch register Saved on interrupt entry by hardware r2: Free scratch register Saved on interrupt entry by hardware r3: Free scratch register Saved on interrupt entry by hardware
<tpbsd> Register Purpose Notes
<tpbsd> r4: Inner loop count Needs Push and Pop when used otherwise r5: Inner loop limit Needs Push and Pop when used otherwise
<tpbsd> r6=TOS: Top-Of-Stack Stack design is interrupt safe ) r7=PSP: Parameter Stack Pointer Stack design is interrupt safe )
<tpbsd> r8: Unused r9: Unused r10: Unused r11: Unused r12: Unused Saved on interrupt entry by hardware
<tpbsd> r13=SP: Return Stack Pointer r14=LR: Link Register r15=PC: Program Counter, always odd
<tabemann> yeah, zeptoforth's do loops are more expensive than that because they store all their info on the return stack in all cases
<tabemann> okay, am really sleepy, gonna hit the sack
<tabemann> g'night
<tpbsd> cya
gravicappa has joined #forth
crab1 has joined #forth
<crab1> What's up forth boys
jsoft has joined #forth
<crab1> welcome
karswell_ has quit [Ping timeout: 250 seconds]
rdrop-exit has joined #forth
john_cephalopoda has joined #forth
kori has joined #forth
kori has quit [Changing host]
kori has joined #forth
<john_cephalopoda> Oh, hi kori.
<rdrop-exit> hi all
<john_cephalopoda> Hey rdrop-exit
<rdrop-exit> hey john_cephalopoda
<tpbsd> hey rdrop-exit Zen Forth Guru!
<rdrop-exit> hello Forth Master Technician (tm)!
<kori> hi john_cephalopoda
<john_cephalopoda> kori: Are you the kori from the 6c37 crux ports collection?
<kori> yes
<john_cephalopoda> Heh, the world is small. Or rather freenode IRC is small :D
<kori> i've been here a while!!! (whenever I'm on freenode)
<john_cephalopoda> It's fun to see a lot of familiar names every time I join a channel.
<crab1> how's y'all
<rdrop-exit> hi crab1
<crab1> what ya up to
ecraven has joined #forth
<rdrop-exit> having a snack
<crab1> btw does anyone know a good book/resource about designing VMs?
<crab1> o what's your snack I got Haagen Dasz
<rdrop-exit> Nutella
<crab1> lucky boi
<rdrop-exit> Forth-style VMs?
<crab1> stack machines yeah
<rdrop-exit> there's Koompan's stack machine book but it's not on VMs
<rdrop-exit> * Koopman
<rdrop-exit> it's available free online on his site
<rdrop-exit> for threading techniques there's "Interpretation and Instruction Path Coprocessing" by Dabare et al.
<crab1> I think a forth that's delimited by a character other than spaces would be nice because text is sometimes annoying to deal with and you could avoid escaping in strings
<rdrop-exit> and articles reprints from The Computer Journal by Brad Rodriguez
<john_cephalopoda> crab1: Would make it harder to program though.
<crab1> but no I mean VM more like retro's NGA or jvm and similar
<crab1> john: why?
<john_cephalopoda> You'd need a character to separate words, so instead of pressing the spacebar you'd have to press some other key.
<rdrop-exit> crab1, depends I'm happy with spaces, you don't need to escape anything if your Forth has control of the keyboard
<john_cephalopoda> :_square_dup_*_;
<john_cephalopoda> Maybe you could use one of the non-printing ascii characters, but your code editor would have to understand that and you'd have to map it to some key.
<crab1> yeah something like that, or one of the unicode characters designated for private use, make it look like a dot product maybe
<crab1> bind it to space and move space to another key
<john_cephalopoda> Advantage of a non-printing ascii char would be the small length of one byte :)
<john_cephalopoda> But yeah... Hmm...
<john_cephalopoda> You're right, a private-use unicode character would be advantageous because it usually won't be used in a string.
<crab1> right, if you have unicode at your disposal
<rdrop-exit> for a development environment I prefer 1 char = 1 byte
<crab1> can do 4 byte at a time, it's reasonable
rdrop-exit has quit [Ping timeout: 264 seconds]
rdrop-exit has joined #forth
<rdrop-exit> I would only add Unicode to a Forth if a particular application requires it, i.e. as an optional add-on
<crab1> well ASCII only uses 7 bits so you could add a character right
<crab1> use the 8th bit
<rdrop-exit> it's up to you how you input and display byte values above 127
<crab1> and that way you get a character that nobody else will be using in their strings
<crab1> but it may be hard for other languages to handle your source
<rdrop-exit> to me a byte is a byte, my source is in blocks
<rdrop-exit> what varies is how you input it, and how you display it
<rdrop-exit> i.e. how you interpret keyboard events, and what font you use to display it
<crab1> but anyway, I think when I make a forth I will try using a different delimiter than space
<rdrop-exit> do you have a particular alternative in mind?
<crab1> for now, visually I am thinking of the dot product symbol
<crab1> but I'm unsure, it needs to be a simple symbol
<rdrop-exit> won't that create a lot of clutter on your display if you replace all blank spaces with something visible?
<crab1> I need something at least a little visible to distinguish from spaces that are now allowed everywhere else though
<crab1> if
<john_cephalopoda> rdrop-exit: RETRO Forth actually supports unicode out-of-the-box :D
<rdrop-exit> then you need two delimiters space and your dot product
<rdrop-exit> john_cephalopoda, yes as do most desktop oriented Forths nowadays I imagine
<crab1> space is no longer a delimiter though, it just means that you can have things like :Song by Artist.ogg:play:
<rdrop-exit> john_cephalopoda, I'm old fashioned, I don't have a requirement for Unicode support in the Forth itself, if ever I needed it, I would want to have it as an optional add-in and keep the base Forth clean at 1 char = 1 byte
<crab1> and that would be your string, just delimited like other words are form each other
dys has quit [Ping timeout: 265 seconds]
<rdrop-exit> crab1, the reason <word><space><word> and <word><100 spaces><word> are quivalent is that the space is treated as a delimiter
<rdrop-exit> * equivalent
<rdrop-exit> by the outer interpreter
<crab1> why do you need 100 spaced between words
<veltas> DKordic: ZX Spectrum
<rdrop-exit> I don't, but I do often have more than one space between words to make it more legible and to highlight patterns
<john_cephalopoda> 100 is exaggerated, but I also often use multiple spaces for alignment reasons.
<rdrop-exit> the 100 was just to show that it makes no particular difference to the outer interpreter
<rdrop-exit> For example juump tables are often aligned visually
<crab1> and you could have :2:3:::+:
<rdrop-exit> like I said it leads to visual clutter when it's not spaces
<rdrop-exit> spaces are relaxing :)
<john_cephalopoda> 3·2···dup··+·.·.···
<crab1> just may need to find the right character
<john_cephalopoda> 3 2 dup + . .
<rdrop-exit> what you posted looks like a bunch of A with circumflex
<john_cephalopoda> It's a center dot.
<rdrop-exit> I guess my IRC client isn't configured to Unicode
<rdrop-exit> on my terminal it looks like A with ^ on top
<rdrop-exit> I'lll check the logs online, see what it looks like there
<rdrop-exit> same as on my terminal:
<crab1> "3:2:::dup::add:show:show" is probably how I would do this sort of thing
<crab1> I think it's a little more clear to use full words to combat that visual business
<crab1> shit
<rdrop-exit> how would your comments look?
<rdrop-exit> e.g. an end-of-line comment
<rdrop-exit> I guess like this 3:2:::dup::add:show:show:\:bla bla
<crab1> :program:This is my comment:drop:rest-of-program: would work too but not great
<rdrop-exit> wouldn't it try to interpret "This is my comment" as a word name?
<crab1> oh my concept for this forth says "is it in dictionary? if no, it is data." But idk if that is going to be workable because it introduces some problems
dys has joined #forth
<rdrop-exit> comments aren't data though
<crab1> that's why you drop it
<rdrop-exit> I see
<crab1> it's a bit of a cavalier solution
<rdrop-exit> makes it hard to catch typos
<crab1> I at least want to give it a whirl and see how it goes, it will probably not be worth the challenges it introduces
<rdrop-exit> that's one of the nices things about Forth it's easy to experiment with
<crab1> yes :)
<crab1> thank chuck for forth
<rdrop-exit> right
<rdrop-exit> unless you care about Forth standards there's no reason not to customize your Forth to be a perfect fit for you
<crab1> if you care about forth standards you are not embracing the spirit of forth
<rdrop-exit> personally I've never cared about Forth standards, although I do care about standards in other domains
<rdrop-exit> I posted about this on reddit not long ago
<crab1> wait
<rdrop-exit> here we go:
<rdrop-exit> A product or component involves a set of "given" or "fixed" technologies (hardware, devices, protocols, specs, layers, interfaces, etc...), that are externally specified by standards or the market.
<rdrop-exit> I see a Forth's role as providing unfettered interactive control of these "fixed" aspects, bottom to top, so you can build up a specific solution with minimal fuss or bloat. In effect a Forth rolls the typical remaining layers and tools (device drivers, debug monitor, OS, shell, assembler, compiler, interpreter, etc...) into a single very tightly-wound no-frills minimalistic platform/framework.
<rdrop-exit> Forth is the one aspect of the product that needn't conform to an external specification or standard, which is what allows it to remain small, nimble, and totally customizable. I don't really see Forth as a language, but as accumulated lore on the design and implementation of such (real or virtual) stack machines, and the programming of solutions on/with them.
<rdrop-exit> ooh, that was a longer post than I remembered, sorry about the semi-spamming
<crab1> no problem
<crab1> I am good with well defined interfaces and protocols, points of contact in general must be very concretely specified, but I am not a fan of standard implementations or interfaces made so complicated that only one implementation will ever come into existence
<rdrop-exit> I'm not a fan of having to go through a library to get to an interface or protocol, I'd rather deal with the interface or protocol directly.
<crab1> exactly
<crab1> also standards like JSON are fucking stupid
<rdrop-exit> I'll take your word for it
<rdrop-exit> bbl, stay healthy :)
<crab1> toodles
crab1 has quit [Ping timeout: 265 seconds]
dddddd has joined #forth
john_cephalopoda has quit [Remote host closed the connection]
john_cephalopoda has joined #forth
dave0 has joined #forth
<webchat9> how to compile a number into a word, as it is? without (LIT) I want to manually embed a sequence of bytes (assembly instructions) in a word
<john_cephalopoda> Which Forth dialect are you using?
rdrop-exit has quit [Ping timeout: 240 seconds]
rdrop-exit has joined #forth
<john_cephalopoda> Gforth, for example, has some special words to handle assembly embedding: https://gforth.org/manual/Assembler-Definitions.html
<webchat9> spf-forth
<webchat9> Found its inline asm handling lib ; but it doesn't recognize a certain instruction so I was curious if there's a way to just embed a byte
rdrop-exit has quit [Ping timeout: 265 seconds]
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
<MrMobius> how about just CREATE ?
<tpbsd> we do it like this on Mecrisp-Stellaris
<tpbsd> : 2plus ( u -- 2+ )
<tpbsd> $2102 h, \ movs r1, #2
<tpbsd> [ \ *execute* mode
<tpbsd> $1872 h, \ adds r2, r6, r1
<tpbsd> $0016 h, \ movs r6, r2
<tpbsd> ] \ *compile* mode
<tpbsd> ;
rdrop-exit has joined #forth
<rdrop-exit> most forths have various comma words e.g. either b, ro c, to comma a byte
<rdrop-exit> 16, to comma 16-bits
<rdrop-exit> 32, to comma 32 bits
<rdrop-exit> or similar words
<rdrop-exit> some use h, for half-word etc...
<webchat9> thanks
<tpbsd> my working example above is just inlined machine code for cortex-m0
<rdrop-exit> right, your "h," is probably equivalent to "16," on my system
<rdrop-exit> it lays down 16 bits
<tpbsd> true, it's 'halfword'
<rdrop-exit> right
<tpbsd> i compile the code with a assembler them translate it as above to a word
<rdrop-exit> DOS Forths also had comma-ing words for different segments, e.g. c,c to comma a byte into the code segment and c,h to comma a byte into the header segment (for multi-segment Forths)
<rdrop-exit> One can add comma words for any space, buffer, target, or whatever, not just for the Forth dictionary
<rdrop-exit> Anything that fills up
<rdrop-exit> It's a common Forth idiom
<rdrop-exit> If you have a space that stuff gets layed down into, you make a set of custom comma-ing words
<rdrop-exit> You have a variable that tracks the current offset, just as DP does it for the Forth dictionary
<rdrop-exit> I have factors for this
<tpbsd> have you installed Jitsi yet ?
<tpbsd> oops sorry, wrong ch!
<tpbsd> (jitsi is a OSS video/audio system for communicating over the net)
<tpbsd> it's gained a lot of users since the CoV-19 outbreak
<rdrop-exit> so for example if you have a FOO buffer, you would have a FOO'ED variable to track it
<rdrop-exit> then you would have various comma words e.g. B,FOO 16,FOO 32,FOO ,FOO etc...
<rdrop-exit> if needed they could have overflow checks
<rdrop-exit> you could even have S,FOO for strings #,FOO for variable length comma-ing, etc...
<rdrop-exit> tp, not familiar with jitsi
<rdrop-exit> I've been using zoom to conference with the kids, and whatsapp to chat with them individually
<rdrop-exit> bbiab
rdrop-exit has quit [Quit: Lost terminal]
<tpbsd> no problemo
<john_cephalopoda> Riot IM works quite well for individual video chat. Never tried conferences though.
<john_cephalopoda> It's a horrible messenger though. Totally unusable for me.
<tpbsd> our computer club is trying jitsi out this week as we cant meet in person atm
<john_cephalopoda> Neat.
<john_cephalopoda> I've used it in the past. Good thing and self-hosting is possible.
<tpbsd> i havent installed it yet, gotta update this pc first
<tpbsd> yeah the club server has jitsi installed and working as a server
xek__ has joined #forth
<john_cephalopoda> The Forth e.V.'s conference was twitch streamed this year. I'll have to look for the videos some time, some topics sounded interesting.
<tpbsd> sadly looks like jitsi is a no-no on FreeBSD
<tpbsd> I'll have to use Linux
xek__ has quit [Remote host closed the connection]
xek__ has joined #forth
jsoft has quit [Ping timeout: 265 seconds]
<veltas> tpbsd: I stopped using FreeBSD the last time I tried because DRM stuff doesn't work easily
<veltas> I know there is a clever way to run Firefox using a simulated Linux system on FreeBSD but that is already getting unreasonably difficult for me
<tpbsd> veltas, I run firefox on FreeBSD
<veltas> The only BSD I use now is NetBSD for really constrained systems, it is the only good free UNIX that 'runs on anything' anymore.
<veltas> Firefox runs on FreeBSD, but the native Firefox does not allow using most DRM
<tpbsd> ahh
<tpbsd> I like NetBSD also
<tpbsd> and OpenBSD
<tpbsd> my favorite is Openindiana but I Id have to compile heaps of my apps for it
<veltas> I am interested to try OpenBSD but for the fun of it, not sure I have the patience to really rely on it
<tpbsd> it's really nice but *only* runs OSS packages
<tpbsd> no Nvidia etc
<veltas> tpbsd: Hmm this is the issue with distros and different UNIXs etc, I enjoyed trying loads out but eventually for me I have gone with the path of least resistance. So I just use Arch Linux (or Debian for x86-32). Those are the things that burn me the least.
<veltas> There is a nice "non-free" version of the Debian installer so your drivers work out the box
<veltas> Imagine not running 'unfree' binary blobs on your computer. Almost the entire web uses what the FSF considers non-free JavaScript, do you think they care if you don't?
<veltas> I have for a long time agreed with the stance e.g. FSF take that licensing and EULAs etc to try and limit how you use software is unethical and unhelpful. But I have always disagreed with their approach because it clearly doesn't work.
<veltas> Open source got it right, lead by example.
<tpbsd> opensource or gpl ?
<john_cephalopoda> Do I really want to use the 16 MB of non-free JS to display a 220KB image?
<john_cephalopoda> The web is a mess. DRM is useless and punishes the people who pay for things.
<tpbsd> no ?
<john_cephalopoda> tpbsd: There are many websites that display only one image (comic/manga viewers, image boards) but are backed by tons of JS.
<tpbsd> john_cephalopoda, yeah, the web seems to run on JS these days
<veltas> tpbsd: GPL is an open source licence. But when I say 'open source' I mean the movement that distinguished itself from the 'free software movement'
<john_cephalopoda> JS should be the cherry on top of the cake, yet web designers build their sites out of cherry and put a crumble of cake on top.
<tpbsd> veltas, to me the GPL is Free Software and the OSS another thing, not GPL
<veltas> Yes
<veltas> I know how you mean that
<tpbsd> it's a bit confusing
<veltas> But by the open source movement's definition of "open source" the GPL is a type of open source licence
<veltas> Well it is *the* definition because they invented the term
<tpbsd> I must admit, Im more of a BSD licence person now, but I still owe a massive amount to RMS
<tpbsd> veltas, the OSS movement would have us believe it's the same as the GPL I think
<veltas> Yes a huge amount of the software I rely on every day has credits to RMS
<veltas> I'm not sure what you mean
<veltas> Like, most people who call themselves "open source" advocates know the difference between GPL and MIT or BSD. And some are critical of GPL vs MIT, etc.
<tpbsd> yeah it's a religous war Im sure neither of us want to get into here on #forth :)
<veltas> I'm not involved in this war and never have been
<tpbsd> in 1993 it was all much simpler
<veltas> True that
<tpbsd> me neither but I do tend to debate with those who think GPL == OSS
<veltas> It's more like a subset relation
<tpbsd> as usual history is always being changed by the victors which makes it difficult for those that were there at the time and remember
<tpbsd> it was more like eric raymond wanting to slyly commercialise the GPL as I recall it
<veltas> Yeah that is the point of open source
<tpbsd> at the time a lot of GPL people were very upset
<tpbsd> and everyone has a valid point, as a FreeBSD user I'm not so GPL strict now, in fact I release under the BSD lic now if I can
<tpbsd> ie come to see some of the negatives of the GPL over the years, nothing is perfect
<veltas> There is a philosophical difference and I know I am more aligned with the open source people, even if they are dirty commericalists or whatever people want to say
<tpbsd> hahah, I am probably as well nowdays. Im no longer a GPL zealot, thats for sure
<tpbsd> the forth I use (Mecrisp-Stellaris) is GPL3 and I'd rather it wasn't but I didn't write it
<john_cephalopoda> Hmm, I've got to look at my old repos for the licenses...
<tpbsd> nowdays Im becomming more and more inclined to start wor`king on my own tethered Forth for cortex-m and that will be a BSD lic
<veltas> My position, as I said before, is I don't think I have the right, nor should I threaten, taking someone to court and forcing them to do something because they used some software I wrote.
<john_cephalopoda> Looks like I used MIT/zlib pretty much from the beginning. Because it was too inconvenient to copy-paste the whole GPL and remember all its parts, I suppose :þ
<tpbsd> john_cephalopoda, lol
<tpbsd> I'm a electronics tech as well, a software lic doesnt have the same import to me as it does to a programmer
<john_cephalopoda> I think I read through the GPL and LGPL one or two times each. But it's just such a hassle. Nobody got time for that.
<tpbsd> if I want to protect a hardware design I just make it really hard to copy, grind the numbers of the chips etc
<john_cephalopoda> tpbsd: Put a blob of epoxy on top of it all! :þ
<tpbsd> john_cephalopoda, yeah, same here, Im not a lawyer
<tpbsd> john_cephalopoda, with Carborundum dust mixed into the epoxy ? ;-)
<tpbsd> Nil Carborundum Bastardo !
<tpbsd> (dont let any bastard grind you down)
<john_cephalopoda> tpbsd: Pour armored concrete around your hardware.
<tpbsd> hahah, give weight to my design
<john_cephalopoda> Charge for hardware design by grams :D
<tpbsd> john_cephalopoda, I once spent a week designing a awesome heavy duty monitor mount for a stock brokers office about 30 years ago, I made up about 20 of them and they were all fitted mounted from the ceiling
<tpbsd> it was one of my best designs
<john_cephalopoda> Oh, nice! I got some Samsung monitor which doesn
<tpbsd> a couple of years later I was back in that city and visiting a stock brokers office and noticed they also had many of my mounds hanging from the ceiling
<john_cephalopoda> 't have an adjustable mount. It's the horror.
<tpbsd> differnt stockbroker tho, and I only made the one set!
<tpbsd> imitation is the best form of flattery I decided
<tpbsd> yeah all the commercial ones were junk
<tpbsd> these CRTs at the stockbrokers were huge and so the mount had to be able to stand the load
<tpbsd> I chromed all the parts, they looked awesome
dave0 has quit [Quit: dave's not here]
crest_ has joined #forth
<crest_> hi. i just got mecrisp stellaris working on an old stm32f103 and s" is compile only on this forth
<crest_> to write my own little conditional include logic i want to check if the last word in a file on my host computer is already defined
<tpbsd> crest_, awesome, congrats
<crest_> i use freebsd and while i got e4thcom kind of working on freebsd with the 64 bit linux abi
<tpbsd> eww, e4thcom doesnt like FreeBSD
<crest_> tpbsd: it starts up and as basic termial emulator
<crest_> so does picocom
<tpbsd> crest_, you can add RTS handshaking instead and then use any terminal ?
<crest_> tpbsd: i use a direct usb serial
<tpbsd> crest_, thats what I do, Ive made a few standalone binaries for that chip
<tpbsd> crest_, auu
<crest_> i'm self isolating at home and don't have access to my tools in the local hackerspace
<tpbsd> crest_, the usb driver uses 'backpressure' to control flow
<crest_> ascii-xfr -s works fine without line delay
<tpbsd> crest if you try a 1ms EOL delay on picocom it may work fine
<tpbsd> crest_, ahh, intersting to know
<tpbsd> crest_, what baud do you use ?
<crest_> i didn't configure any because assumed it makes no sense on a usb "modem"
<crest_> so freebsd should default to 9600
<crest_> but it feels to fast for just 9600 baud
<crest_> i can raise it to 115200 and report back
<tpbsd> it doesnt, but I've always configured it on picocom as I use it with USART normally
<tpbsd> I'm sure it doesnt matter as you say
<tpbsd> it's really fast wuth that usb connection
<tpbsd> faster than my 460800 baud on other systems
<crest_> and it requires just a single cable
<tpbsd> yes, very handy
<crest_> i have no tools except my hands and a multitool
<crest_> i had to bend most of the pins on the ftdi232 chip out of the way to get rx/tx connected for the initial upload
<tpbsd> ?
<tpbsd> ahh ho bootloader on the f103 usb!
<crest_> i have a few spare blue pill boards
<tpbsd> have you run my binary diag on it ?
<crest_> they are the 128kb model and i run the eb13e308316527be6a8963098c7291d5.bin image i found online
<tpbsd> aha thats a old one of mine
<tpbsd> the new one helps you determine the chip with greater accuracy
<crest_> i compiled mecrisp stellaris 2.5.3 from source and flashed that as well
<tpbsd> cool
<tpbsd> at least it compiles out of the box on FreeBSD
<crest_> it didn't
<tpbsd> Im running FreeBSD myself
<tpbsd> oh why ?
<tpbsd> oh yeah "bash"
<crest_> i had to install gnu coreutils from ports to get md5sum etc.
<crest_> (and of course the arm compilers)
<crest_> bash etc.
<tpbsd> I just compile the target in the source dir using gnake
<tpbsd> gmake
<crest_> than patch the shell scripts to call gmd5sum
<crest_> and gmake
<crest_> and remove the linux builds because there is no linux arm toolchain ports
<tpbsd> i dont bother with the 'make every target' thing
<tpbsd> I installed bash and symlinked it to handle Linux things
<crest_> than i compiled the freebsd mecrisp and ran it on my amd64 with qemu static :-)
<tpbsd> yeah me too
<tpbsd> and you noticed the api stuff ?
<crest_> which api stuff?
<tpbsd> youcan even use the networking I've been told
<tpbsd> the freebsd mecrisp has a API
<tpbsd> it's quite different to the embedded one
<crest_> sure almost freebsd syscalls should work
<tpbsd> fo you can save and read files from the pc with it
<crest_> i suspect it will get confusing to read /dev/kmem :-P
<crest_> but other than that the arm emulation works pretty well
<tpbsd> i havent used it apart from a quick test
<tpbsd> it does
<crest_> i've used it to compile freebsd package repos for arm boards
<tpbsd> I'm a electronics tech and I only use the embedded stuff
<tpbsd> nice
<tpbsd> beats that very limited thumbulator
<crest_> i used it for stuff like the 32bit raspberry pi
<tpbsd> I spoke to the guy that made up the freebsd version
<tpbsd> of Mecrisp-Stellaris
<crest_> which is an ugly kludge, but cheap and available
<tpbsd> I've only used Linux on the rpi, when it comes to large embedded I dont care what I use
<crest_> i prefer to use freebsd if it can handle the task
<tpbsd> and why not
<crest_> e.g. read a reed relay switch via gpio and expose the door status in the hackerspace as irc bot
<crest_> but back to forth related topics :-)
<tpbsd> as a way to prevent uploading previous files, have you considered just concatenating all your Forth source into one file before upload after erasing flash ?
<tpbsd> thats what I do
<tpbsd> I also strip all the comments
<crest_> at the speed of the usb serial i don't care about stripping comments yet
<crest_> but eraseflash on your old image kills the usb serial
<tpbsd> I do, I hate any delays
<tpbsd> oh yeah!
<crest_> it comes back on usart1
<tpbsd> unless you use cornerstone ?
<crest_> now i just get unhandled interrupt 3
<tpbsd> ah ok
<tpbsd> which cornerstone do you have I wonder
<tpbsd> Jeelabs made a special one thats used here and there
<tpbsd> are you planning to use the 2nd 64kb Flash on the board ?
<crest_> afaik the image already uses it
<tpbsd> which image ?
<crest_> your old image i'm using
<tpbsd> ahh
<crest_> RAM.... TOTAL PRESET: 20000 USED: 888 FREE: 19112
<crest_> FLASH.. TOTAL REPORTED: 131072 USED: 90228 FREE: 40844
<crest_> (with a decimal base)
<tpbsd> thats pretty old I cant remember if the conerstone was broken but I think it was, yeah I'm sure it was
<crest_> there was no cornerstone
<tpbsd> lemme check the wordlist
<crest_> i just risked executing the example from the documentation
<tpbsd> brb
<crest_> looks like my step should be to learn about the mecrips terminal input buffering
<crest_> to get a string out of the tib to pass to find
reepca has quit [Read error: Connection reset by peer]
<tpbsd> i think you know more about Forth than I do at tis stage
reepca has joined #forth
<crest_> i sure don't
<crest_> i haven't used forth in ages
<tpbsd> i wouldnt be so sure, I'm a tech not a programmer
<crest_> and just looked for a nice toy to pass the time
proteus-guy has joined #forth
<tpbsd> of course
<tpbsd> do you think you have CoV-19 ?
<crest_> so far i got the systick working and wrote a multitasking blinky
<crest_> tpbsd: probably
<tpbsd> thats not noob stuff!
<tpbsd> how do you feel ?
<crest_> mine was a mild case
<tpbsd> excellent, and hopefully come out with some immunity
<MrMobius> aka COVID-0x13
<crest_> MrMobius: :-P
<tpbsd> heheh
<tpbsd> actually it's COVID-$13 around here!
<tpbsd> it's COVID-0x13 over on #embedded
<crest_> tpbsd: i followed the examples from the documentation
<crest_> and used the multitask.txt
<crest_> but followed the bloody datasheets to configure the gpio clock, open drain output pin and systick timer
<tpbsd> crest have you seen the register pretty print on that binary ?
<tpbsd> ie "gpioa."
<crest_> tpbsd: yes it was very helpful
<tpbsd> awesome!
<tpbsd> are you familiar with cortex-m generally ?
<crest_> no
<tpbsd> ahh!
<tpbsd> the STm32F103 (cortex-m3) has the most HORRIBLE gpio config ever
<tpbsd> I totally hate it
<crest_> i have only used with avrs with avr libc and/or asm in the past
<tpbsd> aha
<crest_> i once wrote a totally crazy line following robot that did all the logic in interrupt handlers
<tpbsd> the later chips such as cortex-m0 which I use and the M4's all use a nice easy and non horrible GPIO config
<crest_> the main function just configured the hardware and went into a sleep loop
<tpbsd> did it follow a line well ?
<crest_> sure
<tpbsd> nice
<veltas> crest_: "that did all the logic in interrupt handlers" that sounds like me irl
dddddd has quit [Ping timeout: 250 seconds]
<tpbsd> crest_, if you like doing everything in ISR's then youll love the m3, you have TONS of interrupts!
<crest_> i was even mean enough to allow nested interrupt handling and included a short "proof" of how deep the stack could nest given the worst case runtime of the interrupt handlers and the adc sample rate
<crest_> tpbsd: i didn't like doing it that way. i just wanted to mess with my teaching assistant, because he claimed it was impossible
<tpbsd> hahah
<tpbsd> what were you teaching ?
<crest_> i took "Produktionsinformatik" because it was the smallest evil among the optional courses i had to pick from
<tpbsd> and you had some fun it sounds like !
<crest_> we had to program the avr and they assumed we would use the arduino ide
<crest_> i asked if we could use avr libc and normal embedded c instead
<tpbsd> crest_, if you use the TIB and search for Words previously loaded the problem there is words that have been changed ?
<tpbsd> eww arduino <spit>
<crest_> exactly
<crest_> and those poor avr chips
<crest_> they are already so easy to get up and running
<crest_> everything is enabled by default
<tpbsd> they were great in their day, back in 1897
<crest_> and the datasheet is writen for human consumption
<crest_> *written
<tpbsd> I hate AVR as it happens, but then I had a Vulcan mind meld with the ARM cortex-m manuals and now Im good
<crest_> they are crude 8bit cpus and the peripherals are limited
<tpbsd> you know you can run Mecrisp-Stellaris on a cortex-m with zero external components, just power and 3.3v serial ?
<tpbsd> and it will boot at 8Mhz and run fine
<tpbsd> i dont think there is a easier chip to get running
<tpbsd> anyway, the AVR is ancient
<crest_> an avr just needs anything between 2.7v and 6v
<tpbsd> heck, even your bluepill is ancient
<crest_> i know. they're cheap recycled crap
<tpbsd> crest_, what chip do you think you have in the bluepills ?
<crest_> i didn't run your diagnostic
<tpbsd> you can have up to 4 different mcu's at least iirc
<crest_> but given that your forth image uses 90k and works it has to be one with 128k flash
<tpbsd> it's probably a STM32F103C8
<tpbsd> oh yeah, but how did you flash it ?
<tpbsd> serial of course
<tpbsd> the SWD and JTAG flashers wont flash over 64kb on a STM32F103C8
<tpbsd> as the chip flash register says '64kB'
<crest_> via serial
<tpbsd> but you may have STM32F103CB which declares 128kB
<crest_> which register do i have to read to find out?
<tpbsd> Ive set the kernel up in that binary to think it has 128kB also
<tpbsd> type ? there should be a menu ?
<tpbsd> unlless that version didnt have it
<crest_> type is the word to print a string
<tpbsd> yes
<tpbsd> one way to do it
<tpbsd> ." I'm a string" is another but needs to be compiled
<crest_> the only words in the image containing the substring "type" are "type" and "ctype"
<crest_> there is no "type?"
<tpbsd> it has all the Mecrisp-Stellaris built in words
<tpbsd> hey i gtg it's 2am here, zz time
<crest_> gn8
<tpbsd> great to see a Mecrisp-Stellaris user, have fun!
<crest_> yes. i missunderstood and assumed your image included some kind of hardware diagnostic already
<crest_> and i found a solution
<crest_> mecrisp has a working "token" word
<crest_> but i really works line by line
<crest_> so the scope for anything token returns is just the current line of input
<crest_> but token $some_word find should do the trick
actuallybatman has joined #forth
reepca has quit [Ping timeout: 260 seconds]
mark4 has joined #forth
<veltas> What are good names for words that access I/O space?
<veltas> I am torn between IN and OUT, or IO@ and IO!
<mark4> i would use the @ and ! because you might want to have c@ and c! in there too
<veltas> Or maybe I/O@ and I/O!
<mark4> x86 allows 8 and 16 bit io writes i believe
<Zarutian_HTC> depends, are you configuring or using an io device?
<veltas> mark4: This is Z80 but it's the same concept
<veltas> I think I am going to keep it 8-bit only though
<veltas> Zarutian_HTC: Just using an I/O device directly
<veltas> But also these words might be used by a Forth programmer for general I/O address access I suppose
<Zarutian_HTC> the difference, for example an uart, is that you configure the baud rate, start and stop bits and parity but use the uart to transmit or recieve a char/byte
<veltas> I am writing generic words for accessing I/O space, not memory-mapped I/O but specifically the "I/O address space" that you get on x86 and Z80
<veltas> So it really doesn't matter what kind of hardware interaction is happening here
mark4 has quit [Quit: Leaving]
cheater has quit [Ping timeout: 256 seconds]
john_cephalopoda has quit [Remote host closed the connection]
john_cephalopoda has joined #forth
john_cephalopoda has quit [Remote host closed the connection]
john_cephalopoda has joined #forth
webchat9 has quit [Ping timeout: 256 seconds]
john_cephalopoda has quit [Read error: Connection reset by peer]
john_cephalopoda has joined #forth
reepca has joined #forth
reepca has quit [Read error: Connection reset by peer]
reepca has joined #forth
xek__ has quit [Ping timeout: 265 seconds]
<crest_> tpbsd: wtf?!? why is the stm32f103 usb interface so braindead?
<Zarutian_HTC> crest_: how braindead is it?
gravicappa has quit [Ping timeout: 265 seconds]
<crest_> Zarutian_HTC: the usb interface the core share a 512 byte dual ported memory
<crest_> the core sees this as 1024 32bit words with half of each word "ignored"
<crest_> looks like they glued a 16bit usb interface to a 32bit bus and connected the address lines shifted by one bit
<crest_> i'm sure there is some reason, but it's just annoying and ugly
<crest_> if you can read german and c++ there is a guide here: https://www.mikrocontroller.net/articles/USB-Tutorial_mit_STM32
<crest_> the same 512 bytes are also used by the can controller so you have to pick between usb and can bus
<Zarutian_HTC> well the google translate isnt too terrible
<crest_> some of it isn't too bad
<crest_> just enable the transmitter and wait 1us
<crest_> register interrupts and set the enable the 1.5k pull up (which is hardwired on the blue pill. unless you enable usb in time the host will log lots of usb failures)
<Zarutian_HTC> this wierd access setup from the core could easily be masked by the @ and ! primitives, no?
dys has quit [Ping timeout: 265 seconds]
<crest_> Zarutian_HTC: sure you can work with it
<crest_> its just annoying
<crest_> *it's
john_cephalopoda has quit [Quit: Leaving]
kori has quit [Ping timeout: 265 seconds]
kori has joined #forth
dave0 has joined #forth
dddddd has joined #forth
<tabemann> back
<tpbsd> crest_, perhaps because it's 16 years old ?
<tpbsd> tabemann, welcome back!, crest_ is using Mecrisp-Stellaris of a F103 with one of my old bootable binaries!
<tabemann> cool
<tpbsd> tabemann, the thinks people do when stuck at home self isolating!
<tabemann> I do them regardless, stuck at home or not!
<tpbsd> :)
<crest_> tpbsd: if i had a proper way to connect the usb serial adapter i wouldn't have started my journey by looking at the usb interface
<tabemann> btw
<tabemann> do h.2 and h.4 output 8 bit and 16 bit hexadecimal values padded with zeros?
<crest_> instead i would've prefered to use a usb serial adapter with flowcontrol and at least one gpio pin for software controlled reset
<tpbsd> crest_, and arduino!!
<crest_> why would i use arduino?
<tpbsd> a pin for software reset ?
<tpbsd> you dont need a pin for software reset with Mecrisp-Stellaris
<crest_> to reset the uC from my desktop without touching the reset button
<tpbsd> but you can do that with the Mecrisp-Stellaris 'reset' command ?
<crest_> only if the system is still responsive
<tpbsd> I use that plus the ram clear command all the time
<tpbsd> oh, pc software reset then ?
<tpbsd> something like the arduino uses ?
<crest_> e.g. while writing my blinky i forgot to yield the cpu in my blink task
<tpbsd> cts from the usb/3.3v dongle to a transistor on the target ?
<tpbsd> crest_, as you do
<tpbsd> I just have a reset button on the target which gets pressed a million times a project
<crest_> the cts/rts pins are required for hw flow control
<tpbsd> yes, if in use
<crest_> but access to the reset line from the host is nice because it can be used to run a test suite or fuzz things
<crest_> and recover from almost all software errors
<crest_> but for now a physical reset button works for the cases when i lock myself out
<tpbsd> in the case of Mecrisp-Stellaris I only use the RTS from the board to CTS on the pc because it's the MCU thats the slow part
X-Scale has quit [Ping timeout: 260 seconds]
<tpbsd> and when developing being locked out only happens about 1000 times a day :)
<tpbsd> I've work out at least one reset button so far
<tpbsd> Im thinking of using a contactless one next
<tabemann> back
X-Scale` has joined #forth
X-Scale` is now known as X-Scale
<tabemann> I just did my port of ihex.fs
<tpbsd> wow
<tpbsd> got ihex streaming up the terminal yet ?
<tabemann> not yet
<tabemann> nowI have hex streaming up the screen
<tpbsd> hahah, awesome
<tpbsd> ihex4 to be exact
<crest_> tpbsd: btw my idea with token foo find drop 0<> cr . works in expect
<tpbsd> crest_, brilliant! so many skilled embedded Forth programmers here lately!
<crest_> now i just need a good way to upload code without disturb the rest of the system
<tpbsd> crest_, what is 'token' ?
<crest_> token a word in mecrisp
<crest_> it takes the next token from the terminal input buffer (the current line)
<crest_> so you can't hold on to the string
<tpbsd> oh!
<tpbsd> I never understood the description "token ( - - c-addr len ) Cuts one token out of input buffer"
<crest_> run token + find drop 10 20 rot execute
<tpbsd> token + find drop 10 20 rot execute ok.
<tpbsd> . 30 ok.
<crest_> token + gets you the single char string "+"
<crest_> find searches the dictionary for it and returns the xt and flags
<tabemann> find in zeptoforth just returns a pointer to the word header, from which one can get the xt, the flags, the name, and the next pointer of the word
<crest_> the 0<> cr . makes it easier to match the output because it reduces it to two cases
<crest_> found or not defined
<tpbsd> crest_, aha, I'm beginning to understand
<tpbsd> crest_, I use hardware handshaking so I can use gnu screen as my terminal
<crest_> i prefer tmux and picocom
<crest_> or just picocom on my local system and i3 as tiling window manager
<tpbsd> crest_, that way I can have multiple remote connections to the serial port
<tpbsd> crest_, sadly tmux has no terminal capability
<tpbsd> crest_, and picocom would never do what I need
<crest_> what do you need that minicom offers?
<crest_> i'm still looking for a good way to combine multiple files on my host system
<crest_> to quickly reset the uC and upload my code
<tpbsd> crest_, concatenate them into one large file ?
<tpbsd> thats what I do
<tpbsd> it's all automatic via my GVIM make button
<crest_> sure cat $> >.blob.fs
<crest_> but what about dependencies?
<crest_> just flatten it all manually?
<crest_> do you just run forgetram a lot?
<tpbsd> this is a script I use to load all the files for zeptoforth into one file including removing all the comments
<tpbsd> cat zeptoforth/src/common/forth/schedule.fs >> $ZEPTOFORTH
<tpbsd> cat zeptoforth/src/common/forth/task.fs >> $ZEPTOFORTH
<tpbsd> cat zeptoforth/src/common/forth/basic.fs > $ZEPTOFORTH
<tpbsd> cat zeptoforth/src/common/forth/systick.fs >> $ZEPTOFORTH
<tpbsd> cat zeptoforth/src/stm32f407/forth/int_io.fs >> $ZEPTOFORTH
<tpbsd> sed 's/\\.*$//g' < $ZEPTOFORTH | sed '/^\s*$/d' | sed 's/([^)]*)//g' > $ZEPTOFORTH.rcas.fs
<tpbsd> rm $ZEPTOFORTH
<tpbsd> crest_, I use it forgetram when I'm creating a bootable binary image of the chip, same as when I made the binary youre using now
<tpbsd> mainly because I load the program that does the flash--> bootable binary from ram on the target
<tpbsd> hmm, forget that, it makes no sense
<tpbsd> I use it for some reason instead of reset in that process anyway
<crest_> i still haven't got a cornerstone that doesn't wipe at least the usb serial
<tpbsd> i think I used the wrong one in that image
<crest_> as far as i can tell you didn't include one
<crest_> but maybe eraseflashfrom assumes a 64kb flash
<tpbsd> I removed that image from my site a while back and deleted it here so I'm not sure now
<crest_> neither am i
<tpbsd> I think it was my forst release
<tpbsd> would you like a new one ?
<tpbsd> I'll make you a image made to order :)
<crest_> i should probably figure out how to build image with usb serial myself
<tpbsd> just tell me what you want in it ?
<crest_> *an image
<tpbsd> yeah, youd have no problems
<tpbsd> expecially using QEMU
<tpbsd> excepth perhaps for the SVD2FORTH stuff
<crest_> i would like a mecrisp image for the bluepill board and the source code to modify it that includes a usb serial and definitions for the hardware like your nice gpioa. words
<crest_> i want to look under the hood and understand what's happening
<crest_> so far i use freebsd devd to create syslinks to /dev/cuaU[0-9] based on the serial number
<crest_> giving me a stable name in /dev for my blue pills that i can use in a makefile
<crest_> and use revoke to kill any existing openings of the cuaU device
<crest_> followed by cat $> | picocom $(DEV)
<crest_> but it would be nice to have something like e4thcom claims to have
<crest_> *claims to be
<crest_> that understands the forth system well enough to stop at the first compiler error
<crest_> but it just stops after the first word
<crest_> \i multitask.fs Uploading: ./multitask.fs
<crest_> \ Cooperative Multitasking
<crest_> \ -----------------------------------------------------------
<crest_> \ -----------------------------------------------------------
<crest_> \ Configuration:
<crest_> 128 cells constant stackspace ok.
<crest_> at Line 7 in File ./multitask.fs