2022-06-06 11:12:22 hi 2022-06-06 11:14:09 hallo 2022-06-06 11:15:31 I ve done a switch, when invoked toggle its value and display it 2022-06-06 11:15:34 TOGGLE 0 CREATE , DOES> DUP @ not DUP ROT ! ; 2022-06-06 11:16:39 (: with colon in front) its working great, sometimes the memory gets corrued 2022-06-06 11:17:22 "working great" and "memory corruption" usually don't go together 2022-06-06 11:17:25 do u knw why? 2022-06-06 11:18:30 you can define like this: TOGGLE PAUSE and use it PAUSE . PAUSE . 2022-06-06 11:21:32 its working great, I think because I m storing it in flash of MSP430 it kinda bugs 2022-06-06 11:23:44 anyway Ill figure out myself cya 2022-06-06 13:35:25 re 2022-06-06 13:37:52 Yeah, it seems clear the memory corruption doesn't (or shouldn't) have anything to do with how you defined that word. Just something buggy down in the guts of your system. 2022-06-06 13:39:53 HA ! thx! kipIngram 2022-06-06 13:42:18 I m back havnt seen your answers 2022-06-06 13:43:54 Th function using it is executing on nothing, It might be problem 2022-06-06 13:59:36 what the difference between : myWord CREATE , DOES> ... ; and 2022-06-06 14:01:47 depends on tbe implementation 2022-06-06 14:04:07 alrite 2022-06-06 14:06:28 I was trying to build a "vector" that has only 3 value possible -1 0 and 1 and 2 coordinates 2022-06-06 14:06:57 < A , B > = { -1 , 0 , 1 } 2022-06-06 14:08:57 Which one rule when One coordinate is set, the other is reset 2022-06-06 14:09:59 Ended up with a very complicated corrupt funct x) 2022-06-06 14:16:17 I m still not sure the advantage of using hi all, I'm still playing around with Mecrisp Stellaris Forth and my Rpi Pico (RP2040, ARM M-0) 2022-06-06 14:40:47 I was steering toward this project idea to make my own scientific calculator for 20x4 LCD + Adafruit keypad 2022-06-06 14:41:16 I wrote the LCD drivers and was going to work on the i2c keypad support next 2022-06-06 14:42:39 anyhow, lately I was pondering how I could have something like loadable programs like scientific calculators usually do (TI and HP calculators, e.g.) 2022-06-06 14:44:23 lispmacs[work]: you could use a phonojack and just machester encode an carrier 2022-06-06 14:45:28 well, I wasn't so much wondering how to communicate the program, as like the approach to actually loading it. Like, I didn't want to have to store source on the device, and recompile to the wordlist every time 2022-06-06 14:45:40 or you could have a single phototranistor barcode reader and read in code128 barcodes 2022-06-06 14:46:42 then just treat that as input buffer source 2022-06-06 14:46:43 like, wonder if I could just load precompiled code into memory somewhere and run it from there 2022-06-06 14:47:10 but then how to know that the addresses in that code are correct for the system words? 2022-06-06 14:47:29 Do I need to come up with my own dynamic loading system...? 2022-06-06 14:47:35 sure, though I recommend then you use something like srec to carry that precompiled code 2022-06-06 14:48:59 well look at how OpenFirmware does it with Fcode 2022-06-06 14:50:10 the loaded code can assume some vector table for the system words 2022-06-06 14:50:13 I'm reading the FCODE wiki page 2022-06-06 14:50:23 looks like they use tokens mapped to system words 2022-06-06 14:51:02 then in that vector table you just jump to each system word definition 2022-06-06 14:51:54 so, then, is the FCODE program stored as tokens in firmware, and interpreted at runtime? 2022-06-06 14:52:20 like, another interpreter layer? 2022-06-06 14:52:35 yes, usually on rom chips on the device that was added 2022-06-06 14:53:46 hmm, okay, that sounds straightforward enough. Though, I don't see a way in that approach to have something like a shared library, not part of the original system words 2022-06-06 14:53:53 but guess you can't have everything 2022-06-06 14:54:21 each tokenized program could only depend on the system words, if I'm understanding this correctly 2022-06-06 14:55:11 though I suppose one program could transfer control to another tokenized program 2022-06-06 14:56:33 kind of in that cheap way that TI calcs do it 2022-06-06 14:56:56 or, maybe that was HP calcs 2022-06-06 14:58:04 well, shared libraries not really need for something as simple as a scientific calculator 2022-06-06 14:58:29 just could add shared functionality as additional system functions 2022-06-06 14:58:54 and add more token numbers 2022-06-06 15:01:17 lispmacs[work], ive done a lot of calculator projects including one in forth. my advice is to provide a strong layer of abstraction. a calculator is something that needs to be crash proof 2022-06-06 15:02:11 so you could make a tokenized forth with lots of overhead and error checking then choose whether you want to code the whole thing in that or compromise like HP calcs did and offer a second layer that is much faster but allows the calculator to crash since it does no checks 2022-06-06 15:02:38 and only let the user get down to the second layer if they really know what they're doing 2022-06-06 15:04:12 MrMobius: you have your own forth calculator? Did you already give me the link for that? Just curious 2022-06-06 15:04:20 probably 2022-06-06 15:04:35 unfinished forth calculator to be exact :P 2022-06-06 15:04:43 I remember looking at one forth calculator project a while ago 2022-06-06 15:06:21 you can always look at old models for inspiration. the easiest thing is one long stretch of memory you can put words and numbers into although that makes it hard to go back and add or edit things 2022-06-06 15:07:15 the later scheme was letting the user define and edit words however they wanted but then you need a way to dynamically edit and delete words from your dictionary which is beyond most forths 2022-06-06 15:12:20 lispmacs[work], anyway, what were you envisioning? 2022-06-06 15:13:38 it is all still rather nebulous in my mind, to be honest 2022-06-06 15:14:04 but the approach of using tokens with a higher level interpreter makes sense 2022-06-06 15:14:17 the system layer will be mecrisp stellaris forth 2022-06-06 15:14:38 that will be really neat! 2022-06-06 15:14:49 I guess though, with the token approach, I am wondering how I can give the end user a forth like experience 2022-06-06 15:15:18 or if that even matters 2022-06-06 15:16:20 I would certainly want them to have something better than, say, a TI-BASIC experience 2022-06-06 15:16:24 (*shudder*) 2022-06-06 15:16:57 I suppose I could give the user his own data stack, and some nice tokenized words 2022-06-06 15:18:04 so his program could just be a list of tokenized words 2022-06-06 15:18:40 but can he define his own words in that scheme...? 2022-06-06 15:19:10 TI-BASIC and the old HP basic had labels and goto statements 2022-06-06 15:19:36 the goto would literally scan through all the program source until it found the appropriate label 2022-06-06 15:19:39 or didn't 2022-06-06 15:21:20 hehe, TI-BASIC isnt that bad considering what its for 2022-06-06 15:22:49 the thing with tokenization is the user never has to know its not machine code 2022-06-06 15:23:58 to them its just a regular forth. tokens just make a lot of things easier for you, the firmware writer 2022-06-06 15:35:48 MrMobius: what kind of keypads and displays have you worked with for your calculators? 2022-06-06 15:36:03 calculator projects, I meant? 2022-06-06 15:43:19 lispmacs[work], for keypads, just soldering tactile switches to protoboard. the key labels are hardest part of the hardware 2022-06-06 15:45:07 for displays, 20x4 LCDs, a little 128x32 monochrome LCD for one, a bigger 128x64 LCD for the graphing one and a color one from adafruit for another unfinished one 2022-06-06 15:46:07 there are clear caps that you can put labels under for the bigger 12x12mm tactile switches if you dont mind a bigger keypad 2022-06-06 15:46:58 also a really awesome VFD display I got from Noritake for free 2022-06-06 15:49:34 lispmacs[work], youre thinking about using a text lcd? 2022-06-06 15:50:07 I will for this project, since I already have the 20x4 LCD driver coded 2022-06-06 15:51:47 https://codeberg.org/infrared/mf-lcd 2022-06-06 15:54:17 working idea was, God willing, to write i2c driver for this fancy adafruit keypad, then put together a scientific calc using the 20x4 + the keypad, and then move on to learning how program some better visual interface device, like an TFT display 2022-06-06 15:55:29 I was going to use one of those super cheap 4x4 keypads that are available on Amazon, but I've found I just hate working with those things 2022-06-06 15:55:54 stupid cheap solder pads, in particular 2022-06-06 15:57:41 so I bought Adafruits silicon 4x4 button keypad with the driver PCB that has an I2C interface 2022-06-06 15:57:52 which looks nicer 2022-06-06 15:58:37 but now I've got to code some forth words for Mecrisp Stellaris to use the I2C interface on the RP2040 target, which is something that nobody has gotten around to yet 2022-06-06 15:59:20 but I did something similiar once for SPI on a different chip, and it wasn't that hard 2022-06-06 16:01:00 this Adafruit keypad has key LED support to, to make keys glow, fancy stuff! 2022-06-06 16:01:06 (end ramble) 2022-06-06 18:18:57 lispmacs[work], sorry, afk 2022-06-06 18:23:25 lispmacs[work], nice, I think those 4x20 LCDs are awesome for a scientific calculator. some are better than others. newhaven makes some really good ones though kind of pricey that i have used: https://newhavendisplay.com/4x20-character-lcd-stn-gray-display-with-white-side-backlight-3v/ 2022-06-06 18:24:22 nothing wrong with adafruit stuff for one off prototypes. the keypad is the most annoying part 2022-06-06 20:59:16 And one of the most important. 2022-06-06 20:59:40 One of the best things about that 41CV I used in college was the "niceness" of the key touch / response.