00:00:00 --- log: started forth/20.02.26 00:07:59 --- join: dys joined #forth 00:12:30 --- join: mtsd joined #forth 00:57:24 --- join: jsoft joined #forth 01:19:47 --- join: xek_ joined #forth 02:01:16 --- join: dave0 joined #forth 02:15:25 --- quit: _whitelogger (Remote host closed the connection) 02:18:27 --- join: _whitelogger joined #forth 03:23:23 nice! 04:34:33 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 05:04:17 --- quit: dave0 (Quit: dave's not here) 05:32:35 --- quit: jsoft (Ping timeout: 255 seconds) 06:19:20 --- join: dddddd joined #forth 06:23:43 --- quit: mtsd (Quit: Leaving) 07:00:56 back 07:25:48 --- quit: tabemann (Ping timeout: 240 seconds) 08:13:21 --- quit: _whitelogger (Read error: Connection reset by peer) 08:18:28 --- join: _whitelogger joined #forth 08:33:29 --- quit: reepca (Ping timeout: 255 seconds) 08:48:53 --- join: xek__ joined #forth 08:51:42 --- quit: xek_ (Ping timeout: 265 seconds) 09:10:46 --- join: X-Scale` joined #forth 09:12:26 --- quit: X-Scale (Ping timeout: 260 seconds) 09:12:26 --- nick: X-Scale` -> X-Scale 09:24:11 --- quit: dys (Ping timeout: 248 seconds) 09:25:12 --- join: X-Scale` joined #forth 09:25:57 --- quit: X-Scale (Ping timeout: 260 seconds) 09:25:58 --- nick: X-Scale` -> X-Scale 11:15:19 --- join: WickedShell joined #forth 11:32:18 --- join: reepca joined #forth 11:32:42 Has anyone written code that will optimise stack operations? 11:33:32 i.e. you give it a series of the basic stack operations and it outputs the shortest equivalent 12:17:03 veltas: something like http://sovietov.com/app/forthwiz.html ? 12:33:06 Ah that's brilliant 12:33:18 Exactly like that thanks 13:15:36 --- quit: gravicappa (Ping timeout: 265 seconds) 14:40:03 --- join: dave0 joined #forth 15:03:12 --- join: tpbsd joined #forth 15:03:12 --- quit: tpbsd (Changing host) 15:03:12 --- join: tpbsd joined #forth 15:03:14 --- quit: tp (Read error: Connection reset by peer) 15:09:17 --- join: tp joined #forth 15:09:17 --- quit: tp (Changing host) 15:09:17 --- join: tp joined #forth 15:09:33 --- quit: tpbsd (Remote host closed the connection) 15:38:01 --- quit: xek__ (Ping timeout: 240 seconds) 15:42:25 --- quit: _whitelogger (Remote host closed the connection) 15:45:28 --- join: _whitelogger joined #forth 17:16:44 --- join: tabemann joined #forth 17:32:42 --- quit: dddddd (Ping timeout: 260 seconds) 18:14:47 --- quit: tabemann (Ping timeout: 265 seconds) 18:23:31 --- join: rdrop-exit joined #forth 18:25:24 --- join: boru` joined #forth 18:25:27 --- quit: boru (Disconnected by services) 18:25:30 --- nick: boru` -> boru 18:30:44 crc, do you know how that kind of optimization is done? 18:30:57 like generally what I should google 18:48:34 --- join: jsoft joined #forth 18:58:30 --- quit: cheater (Ping timeout: 258 seconds) 19:00:22 --- join: cheater joined #forth 19:00:23 --- quit: cheater (Changing host) 19:00:23 --- join: cheater joined #forth 19:00:30 --- quit: cheater (Client Quit) 19:00:55 --- join: cheater joined #forth 19:07:05 --- quit: reepca (Ping timeout: 255 seconds) 19:11:24 --- join: reepca joined #forth 19:13:28 --- quit: reepca (Remote host closed the connection) 19:13:44 --- join: reepca joined #forth 19:28:44 --- quit: reepca (Remote host closed the connection) 19:30:35 --- join: tabemann joined #forth 19:30:45 --- join: reepca joined #forth 19:41:45 --- quit: reepca (Remote host closed the connection) 19:44:36 --- join: reepca joined #forth 19:45:10 MrMobius: no idea; I've not looked at the code for it 19:56:22 --- quit: dave0 (Quit: dave's not here) 19:56:54 --- quit: reepca (Ping timeout: 260 seconds) 20:00:19 hey crc 20:01:49 hey tabemann congrats on your Forth progress 20:03:14 now IF THEN ELSE works 20:03:29 *IF ELSE THEN 20:03:58 I tried BEGIN AGAIN and... well... it repeats for a bit, then exits, leaving the RAM dictionary corrupted 20:05:41 BEGIN UNTIL acts funny 20:22:34 okay, this is stupid 20:22:56 the code looks correct, but those just act really weirdly 20:23:55 I thought for a sec that it was . that was the problem, so I tried : foo 0 begin 1 + dup 10 = until ; and it caused it to freeze 20:24:10 my guess is it caused the stack to explode, causing a memfault 20:35:00 good morning Forthwrights :) 20:38:17 hey rdrop-exit 20:38:27 hi tabemann 20:38:36 * tabemann is busy debugging zeptoforth 20:38:44 cool 20:39:06 it now compiles code to RAM and executes it, but loops are acting funny 20:39:44 funny how? 20:40:26 I'm not sure how to describe it; I think it may actually be that something is goofing up the stack, which is interfering with the exit conditions for the loops 20:41:02 I see 20:42:42 : baz 0 begin 1 + dup 10 = until ; 20:42:45 followed by 20:42:46 baz 20:42:51 causes a hang for instance 20:43:31 insert a dup . so you can at least see the progress 20:45:17 I haven't done any Forthing for the past week or so, today I'm looking into the possibility of switching my host forth to x11 20:46:19 making it graphical? 20:47:25 Not graphical, two main reasons are to get key release events and using a special font 20:48:07 I'm getting tired of the limitations of terminals when it comes to keyboard input 20:49:28 I figure x11 is my best bet for key release events that will work with any unix flavor 20:50:56 --- join: iyzsong joined #forth 20:52:49 ah 20:53:41 I haven't done anything with x11 since the 80s, I'm dedicating this afternoon to a refresher 20:54:44 I've never done anything with raw x11 20:54:53 from what I've heard it's best left alone 20:55:03 I've done stuff with GTK+ and OpenGL 20:55:48 old-school OpenGL, not the modern-day fancy schmancy GPU-centric OpenGL of today 20:57:10 X has always been a mess, I'm not sure if there's a viable alternative that will meet my needs across the different unices (including MacOS) 20:58:28 I'd say find a toolkit like GTK+ that fits your needs, write a frontend using it, and communicate with that frontend with sockets or pipes or like to separate your Forth code from the language that the frontend would have to be written in (e.g. C for instance) 20:59:15 I was planning on just writing to the wire protocol 20:59:26 that is another option 20:59:56 except that from what I gather dealing with X11 in the raw is a pain in the ass 21:00:38 thirty-something years of history layered on itself 21:01:19 I used the wire protocol in a project in the 80s, no longer have the code though 21:03:12 I also have an idea for a custom ASCII font I'd like to use 21:03:29 two birds with one stone I'm hoping 21:04:35 X is definitely long in the tooth 21:06:32 If anyone knows of an alternative that works on Unices and Macs, I'd appreciate a heads up 21:07:14 GTK+/Pango/Cairo is my go-to if I ever need to write 2D GUI code 21:07:49 I'd write a terminal with those in C, then talk to my Forth code with said terminal over some wire protocol 21:08:24 actually, it need not be C 21:08:46 my last two graphical projects used those and were written in Haskell (aside from my sixel work, which was in Forth) 21:09:50 (I am using an IRC client right now written in Haskell using GTK+) 21:11:24 I may be wrong, but I don't think I need GTK+ 21:12:32 to me the main factor is that GTK+ is pain-free compared with raw X11 21:13:19 you're right I'm sure 21:14:48 My initial googling tells me x11 is the common denominator between the different unices, although on Mac it's an optional add on to Quartz 21:15:12 heyhey 21:15:39 hello Master Forth Technician (tm)! 21:16:28 rdrop-exit, there is a new x windowing system called 'wayland' 21:16:31 or is it Forth Master Technician (tm)? I forget :) 21:16:55 i think it's made by ex windows x haters but I dont know 21:17:08 thanks tp, will check it out 21:17:27 just 'natural born electronics tech' will do :) 21:17:35 ok :) 21:17:35 does anyone actually use wayland 21:17:52 I think they haven't yet decided how to do screenshots 21:18:21 wayland is supposed to replace all the layers of X with a nice unified and homogeneous system 21:18:23 because they're confused about how to permission processes so they're allowed to do screenshots 21:18:39 also there is no remote wayland either 21:18:51 rather you're supposed to use something like RDP for remote 21:18:53 tabemann, yeah, i bet it's useless compared to the X we all use everyday to good effect 21:19:31 exactly, thats why I think it's a Windows users system 21:19:50 The thing I like about X is that there's a wire protocol spec, so you don't have to deal with libraries 21:19:54 X windows without remote X would be utterly useless to me 21:20:23 I like it how they from on high just decided that This was The replacement for what we've been relying on for the last thirty-odd years 21:21:03 I imagine Linux will become more and more windows like as more and more windows people have a say 21:21:14 kids always think they now better, hindsight is always 20/20 21:21:16 ugh 21:21:44 in the same way that C users try and make Forth look like C, windows users try and make Linux more like windows 21:21:53 like systemd 21:21:57 rdrop-exit, so true, and it's driven by those kids 21:22:07 tabemann, yes 21:22:19 systemd is not a bad idea though, it does speedup boot time 21:22:24 damn you Poettering 21:22:28 i'll take anything as long as its faster 21:22:41 Kumool, thats fine for a car radio I guess 21:22:48 there were other alternatives they could have taken 21:22:56 like parallel init 21:23:12 windows users typically shut down their PC/laptop after use, Unix users typically leave their running 24/7 21:23:31 well. shit, I'm gonna shut down my laptop right now 21:23:37 and am running linux 21:23:39 and in the latter case, bootup time is utterly irrelevant 21:23:52 I never shut this box down 21:24:09 it's uptime equals exactly the local power company outages 21:24:12 yeah but that's because you live in a first world country that's not constantly having blackouts 21:24:22 I only shut down my mac a couple times a year 21:24:30 <- right now the lights are flickering 21:24:35 at my place 21:24:57 spooky 21:25:10 4:24PM up 2 days, 9:21, 14 users, load averages: 0.52, 0.40, 0.32 21:25:24 also I doubt this is a windows thing, because windows 10 takes like 10 minutes of booting for me 21:25:37 probably why its windows 10! 21:25:41 Kumool, I like in rural new south wales, the power here isnt very reliable, tho probably better than yours 21:25:49 except for watching videos and surfing, I mostly use a terminal 21:26:12 tp: oh is your country trying desperately to sell and privatize its power plants too? 21:26:28 Kumool, they have sold them all years ago 21:26:48 after which power costs went up and up ... 21:27:21 :S 21:27:31 power generation is one of those things that should not be privatized 21:27:41 and now the power companies are in a death spirel 21:27:44 spiral 21:27:54 Kumool, oh I agree 100% 21:28:20 the Australian govt didnt ask for permission, they just did it 21:29:33 I don't think there's a Wayland for mac yet 21:29:36 :( 21:29:45 solar power really took off here with massive govt subsidies and so the electricity companies struggle, raising prices to survive as more and more people go to solar 21:29:47 I better go, 1am now, bb 21:30:14 unless my google-fu is lacking 21:30:14 Kumool, cya! 21:30:20 ciao Kumool 21:30:21 :) 21:30:53 rdrop-exit, Im sure you can buy it for mac, just $300 plus yearly subscriptions ;) 21:31:20 I've never bought any software for mac 21:32:32 You're thinking Windows 21:33:08 Mac is basically a BSD underneath all the GUI stuff 21:33:32 Sergey Bugaev @bugaevc@mastodon.technology 21:33:33 I have ported Wayland (that is libwayland-client, libwayland-server, libwayland-cursor, and wayland-scanner) from Linux to Darwin (Mac OS X 10.6 Snow Leopard to be exact). 21:33:33 Wayland relies on many little things that are specific to Linux (examples: epoll, timerfd, SO_PEERCRED, ), so I had to try and come up with ways to make it work without them. 21:33:43 https://mastodon.technology/@bugaevc/101603518023241841 21:34:32 okay, I'm gonna hit the sack 21:34:33 yeah, weyland is Linux only I guess, same as systemd is Linux only 21:34:41 g'night guys 21:34:47 good night tabemann! 21:34:49 Linux is becoming more and more it's own thing 21:34:53 night tabemann 21:34:59 I hate how linux users can be so provincial at times 21:35:03 and less and less POSIX 21:35:13 tabemann, better get used to it 21:35:30 g'night guys for real now 21:35:38 or move to *bsd, openindiana, mac 21:35:49 I've always favored BSDs over Linux 21:36:04 rdrop-exit, :) 21:36:39 I went to FreeBSD to escape the Linux systemd, but I stayed for the ZFS and FreeBSD jails 21:36:53 If this Mac dies one day, I'll probably try NetBSD 21:37:14 theyre all pretty safe and admin friendly 21:37:23 no OS is perfect 21:37:30 right 21:38:15 rdrop-exit, I had a breaktru in my own forth dev environment 21:38:26 pray tell 21:38:47 i wanted to achieve this thing in 2014 but was utterly clueless about how to do it 21:39:12 the other day I woke up and knew how it was achieved, and 30 mins later was working with no issues 21:39:31 I love it when inspiration strikes 21:39:32 so I guess I've been learning slowly a bit each day since 2014 :) 21:39:43 it's boring and XML related 21:39:56 hack cough cough 21:40:02 ;) 21:40:37 but basically my "svd2forth" generation now knows the difference between bitfields with >1 bit and acts accordingly 21:41:50 this was a pain for me for years as a MCU may have up to 17,000 bitfields 21:42:12 and the Forth Words to handle them need to be automatically constructed 21:42:40 cool, I have some higher level bitfield handling words that optimize down when the width is known at compile-time 21:43:09 otherwise making the simplest programs that use Peripherals is a exercise in pain 21:43:57 in C all this is done *exactly* the same way, by building header files from the same XML data 21:44:23 no one does it by hand because it's impossible 21:44:37 and the data is ONLY available as XML 21:44:58 which makes sense as XML is easiest to parse using XML tools 21:45:55 so now my new svd2forth builds a Word for bitfields >1 as per this example 21:46:11 : GPIOC_MODER_MODER15 ( %XX -- ) 30 lshift GPIOC_MODER ; \ GPIOC_MODER_MODER15, 21:46:51 a possible use may be like this " OUTPUT GPIOC_MODER_MODER15 BIS! " 21:47:31 I use BITS for that 21:47:39 23 10 bits constant %csr.icount.count 21:49:13 your example is non peripheral based tho ? 21:49:20 %csr.icount.count is a bit mask with bits 23 down to 10 set 21:49:58 what is "csr" ? 21:50:18 control and status register 21:50:35 a cpu register ? 21:50:56 a special RISC-V register 21:51:03 ah yeah 21:51:28 2 %csr.icount.count 21:51:29 3 Bit mask for isolating the csr.icount count bitfield (R/W, 21:51:29 4 reset: 1). 21:51:29 5 When csr.icount.count is decremented to 0, the trigger fires. 21:51:29 6 Instead of changing csr.icount.count from 1 to 0, it is also 21:51:31 7 acceptable for h/w to clear csr.icount.m, csr.icount.s, and csr.icount.u. 21:51:33 8 This allows csr.icount.count to be hard-wired to 1 if this CSR 21:51:36 9 just exists for single step. 21:51:59 debugging 21:52:44 profiling instruction count IIRC 21:52:44 the CMSIS-SVD standard gives only a start bit position and the number of bits involved 21:52:49 nice 21:53:11 rather than start and finish bit positions 21:53:27 The RISC-V docs usually give starting and ending bit numbers for a field 21:54:30 for a single bit, I just use BIT 21:54:48 3 bit constant %csr.mstatus.mie 21:55:08 that's a bitmask with just bit number 3 set 21:55:42 I usually name bitmasks with a percent, e.g. %foo 21:55:50 i think youre still working on the risc-v system registers ? 21:56:26 I've done all the registers, including the debug bus registers 21:56:34 the gd32Vf103 also has a CMSIS-SVD.xml file, I use it now for the peripherals 21:57:55 can you see the similarity to my example above for cortex-m3 ? 21:57:58 : GPIOA_CTL0_CTL7 ( %XX -- ) 30 lshift GPIOA_CTL0 bis! ; \ GPIOA_CTL0_CTL7 21:58:37 Why is the bit store part of the word? 21:59:26 I tend to keep fetches and stores factored out 21:59:28 btw, my Forth powered STM32F103 diagnostics program had located a GD32F103 labeled as a STM32F103 in a Chinese 'blue pill' board 21:59:49 cool :) 22:00:13 rdrop-exit, thats a old example, after your comment a few weeks back I moved the store part out of those definitions 22:00:27 it's now used as in my first example above 22:00:34 cool :) 22:00:57 once you mentioned it I saw the logic was sound 22:01:25 it had been annoying me previously but I hadn't actually thought about why 22:01:53 you're devoloping gut feelings about Forth aesthetics 22:02:04 that stuff is a hold over from my 2014 days when I wrote that stuff 22:02:29 well I can appreciate your highly developed Forth logic, you were the catalyst 22:02:39 and I appreciate it 22:03:16 with better logic comes better understanding and the ability to apply the logic to build better systems 22:03:47 Some people prefer it the other way around, to factor in the fetches and stores, especially people into OO programming 22:03:51 so my auto parsing system now produces this for a 1 bit bitfield 22:04:28 %1 15 lshift GPIOC_OTYPER \ GPIOC_OTYPER_OT15, 22:04:52 no Word name is needed as the only choices are set, reset or test the bit like so 22:05:02 %1 15 lshift GPIOC_OTYPER bis! 22:05:11 I would do that as: 22:05:25 --- join: gravicappa joined #forth 22:05:44 16 bit constant %gpioc.otyper 22:06:56 since it's bit# 16 22:07:16 (bit numbering starting at 0) 22:07:27 why do you need 'constant' ? 22:07:41 good point re 16 bit 22:08:12 to name the mask 22:08:47 16 bit bin. $00010000 22:08:47 3322222222221111111111 22:08:47 10987654321098765432109876543210 22:08:47 00000000000000010000000000000000 22:09:07 ahh 22:09:16 in my case BIS! does all that 22:09:49 so I could instead to "16 bit GPIOC_OTYPER bis!" 22:10:27 but the extra parsing work would probably only result in the same binary code 22:10:44 it's easy to test 22:11:39 : test1 %1 15 lshift GPIOC_OTYPER bis! ; ok. 22:11:40 see test1 22:11:40 20000398: 2090 movs r0 #90 22:11:40 2000039A: 04C0 lsls r0 r0 #13 22:11:40 2000039C: 3080 adds r0 #80 22:11:40 2000039E: 0100 lsls r0 r0 #4 22:11:42 200003A0: 6843 ldr r3 [ r0 #4 ] 22:11:44 200003A2: 2280 movs r2 #80 22:11:46 200003A4: 0212 lsls r2 r2 #8 22:11:48 200003A6: 4313 orrs r3 r2 22:11:48 In my case I use bset ( mask a -- ) 22:11:50 200003A8: 6043 str r3 [ r0 #4 ] 22:11:52 200003AA: 4770 bx lr 22:11:54 Bytes: 20 ok. 22:11:58 : test2 16 bit GPIOC_OTYPER bis! ; ok. 22:12:00 see test2 22:12:02 200003CC: 2090 movs r0 #90 22:12:04 200003CE: 04C0 lsls r0 r0 #13 22:12:05 200003D0: 3080 adds r0 #80 22:12:07 200003D2: 0100 lsls r0 r0 #4 22:12:10 200003D4: 6843 ldr r3 [ r0 #4 ] 22:12:12 200003D6: 2280 movs r2 #80 22:12:14 200003D8: 0252 lsls r2 r2 #9 22:12:15 200003DA: 4313 orrs r3 r2 22:12:18 200003DC: 6043 str r3 [ r0 #4 ] 22:12:20 200003DE: 4770 bx lr 22:12:21 Bytes: 20 ok. 22:12:42 see bis! 22:12:42 000019D8: CF03 ldmia r7 { r0 r1 } 22:12:42 000019DA: 6832 ldr r2 [ r6 #0 ] 22:12:42 000019DC: 4302 orrs r2 r0 22:12:42 000019DE: 6032 str r2 [ r6 #0 ] 22:12:42 000019E0: 000E lsls r6 r1 #0 22:12:44 000019E2: 4770 bx lr 22:12:47 Bytes: 12 ok. 22:13:40 probably similar I guess 22:14:09 I have "bis!" (set), "bic" (clear) and "bit@" test 22:14:16 try it with a constant 22:14:53 I have bset bclear btoggle 22:15:22 : test3 16 bit constant GPIOC_OTYPER bis! ; ok. 22:15:22 see test3 22:15:22 20000400: 3F04 subs r7 #4 22:15:22 20000402: 603E str r6 [ r7 #0 ] 22:15:22 20000404: 2680 movs r6 #80 22:15:23 20000406: 0276 lsls r6 r6 #9 22:15:27 20000408: B500 push { lr } 22:15:29 2000040A: 20BD movs r0 #BD 22:15:31 2000040C: 0180 lsls r0 r0 #6 22:15:33 2000040E: 300D adds r0 #D 22:15:35 20000410: 4780 blx r0 --> constant 22:15:37 20000412: 2090 movs r0 #90 22:15:39 20000414: 04C0 lsls r0 r0 #13 22:15:40 20000416: 3080 adds r0 #80 22:15:43 20000418: 0100 lsls r0 r0 #4 22:15:44 2000041A: 6843 ldr r3 [ r0 #4 ] 22:15:46 2000041C: 431E orrs r6 r3 22:15:48 2000041E: 6046 str r6 [ r0 #4 ] 22:15:51 20000420: CF40 ldmia r7 { r6 } 22:15:53 20000422: BD00 pop { pc } 22:15:57 Bytes: 36 ok. 22:16:04 you're code is wrong for that one 22:16:22 what should it be ? 22:16:47 what is the stack picture of your bis! is it ( mask a -- )? 22:16:55 I've no idea 22:17:02 hmm hang on 22:17:14 I'll get a coffee while you look 22:17:30 bis! ( mask a-addr - - ) Set BIts in word-location 22:17:41 me too! 22:18:30 so you're code should be bis! 22:19:41 16 bit constant %gpioc.otyper 22:20:00 %gpioc.otyper bis! 22:20:09 what's the ? 22:21:05 that's probably another constant you generated 22:22:10 %gpioc.otyper foo bis! 22:22:47 presumably foo is a constant address of a memory mapped register 22:22:49 --- quit: cheater (Ping timeout: 258 seconds) 22:24:37 --- join: cheater joined #forth 22:29:48 So you're XML parser would produce hordes of constants, some to name bitmasks, some to name addresses 22:31:25 then you use those constants in phrases as needed 22:32:44 * your 22:34:54 thus avoiding a combinatorial explosion 22:51:12 bak 22:51:28 a-addr is the address of the data 22:51:57 rdrop-exit, I think you have the gist of it! 22:52:09 cool 22:53:21 so my breakthru was knowing how to tell the xml parser to remove all the Word preamble and postamble from the generated template definition 22:53:36 so if I understood correctly your XML thingy produces oodles of code that looks like this: 22:54:01 constant 22:54:28 so now, with the separation of the action (bis! etc) and Words only generated for bits >1, I'm pretty happy with my current svd2forth generator 22:54:50 kudos 22:54:51 youve seen two examples above of the actual autogenerated code 22:55:10 one for bit = 1 and the other for bits >1 22:55:34 (scrolling back in history) 22:55:48 this is my attempt to make the early embedded Forth code more readable 22:55:57 here are the two examples 22:56:07 ok 22:56:36 : GPIOC_MODER_MODER15 ( %XX -- ) 30 lshift GPIOC_MODER ; \ GPIOC_MODER_MODER15 22:56:52 %1 15 lshift GPIOC_OTYPER \ GPIOC_OTYPER_OT15 22:57:17 the bitfields can be up to 30 bits in some cases 22:57:22 oops 22:57:24 32 bits 22:57:50 What is the definition of GPIOC_MODER ? 22:58:24 $48000800 constant GPIOC ( General-purpose I/Os ) 22:58:24 GPIOC $0 + constant GPIOC_MODER ( GPIO port mode register ) 22:58:24 GPIOC $4 + constant GPIOC_OTYPER ( GPIO port output type register ) 22:58:24 GPIOC $8 + constant GPIOC_OSPEEDR ( GPIO port output speed register ) 22:58:24 GPIOC $C + constant GPIOC_PUPDR ( GPIO port pull-up/pull-down register ) 22:58:27 GPIOC $10 + constant GPIOC_IDR ( GPIO port input data register ) 22:58:29 GPIOC $14 + constant GPIOC_ODR ( GPIO port output data register ) 22:58:31 GPIOC $18 + constant GPIOC_BSRR ( GPIO port bit set/reset register ) 22:58:33 GPIOC $1C + constant GPIOC_LCKR ( GPIO port configuration lock register ) 22:58:35 GPIOC $20 + constant GPIOC_AFRL ( GPIO alternate function low register ) 22:58:37 GPIOC $24 + constant GPIOC_AFRH ( GPIO alternate function high register ) 22:58:39 GPIOC $28 + constant GPIOC_BRR ( Port bit reset register ) 22:58:46 these are all in my first loaded 'memmap.fs' 22:59:06 also autogenerated from the same SVD file that the bitfields are 22:59:53 the stack picture of GPIOC_MODER_MODER15 seems wrong 23:03:06 maybe it is 23:03:30 I use it this way "%11 GPIOC_MODER_MODER15 BIS!" 23:03:44 it looks like it leaves two items on the stack 23:03:52 or "ANALOG GPIOC_MODER_MODER15 BIS!" 23:04:31 and it does 23:04:54 it leaves the mask and the address 23:05:05 which are consumed by BIS! 23:05:57 well BIS generates and handles the mask from the number supplied 23:06:03 value supplied 23:06:09 cool 23:06:37 I'm just a user, I tend to take a lot for granted 23:06:43 similar to what I do, names are different to protect the innocent 23:07:09 yeah, in the end it's gotta be the same, only the journey is different 23:07:26 it's even the same for C, but in a utterly different way 23:07:35 bset bclear btoggle 16set 16clear 16toggle set clear toggle etc... 23:07:41 when the binary hits the metal, it's the same 23:08:09 yeah, typical of Forth, everyone has their own methods and names that work for them 23:09:11 you can do it in C like this if you like "GPIOA->AFR[0] |= (0x3 << (4*1)) + (0x3 << (4*2)); //enable AF3 for PA1 and PA2" 23:09:37 yes, the difference usually comes down to what you leave up to the optimizer to figure out 23:09:40 which the C people seem to think is self explanatory 23:09:53 ahh, good point 23:11:29 C style varies a lot too I guess 23:11:47 yes, especially historically 23:12:11 Ive been working thru a Cortex-m0 'touch' peripheral config 23:13:00 you know, where it has a copper pad on a pcb, about the size of a fingertip, and the pad is electrically isolated under plastic or glass etc 23:13:29 a finger touch on the pad is then detected 23:13:50 what are you using it for? 23:13:56 the code I followed is naturally in C, by STM around 2010 23:14:22 as a alternative to a button for a project 23:15:27 interesting 23:15:47 and in those days, STM defined 'bits' like this "TSC_CR_PGPSC_2" and "TSC_CR_PGPSC_0" right up to "TSC_CR_PGPSC_31" I guess 23:16:53 seems redundant 23:18:29 yeah 23:19:18 then in the next C revision they stared using the "TSC->IOHCR &= ~(0x06);" stuff 23:19:41 or maybe "<<" etc 23:20:20 whats crazy is that now, if one looks up the STM code example for how to use the 'touch' peripheral, there is no code 23:20:39 it's all pictures of GUI windows, HAL etc 23:21:31 the reason they're using the and complement idiom is that it doesn't knowing how wide machine word is 23:23:20 i.e. ~(0x06) generates a mask with bits 2 and 3 off and all other bits on regardless of the machine word width you're dealing with 23:23:39 sorry I meant bits 1 and 2 off 23:23:53 i can see why Boeings ISS astronaut capsule failed to make orbit now "we used the wrong version of HAL in our STM32CUBE ide, and the clock got the wrong data" 23:24:51 in ceneral when I read the embedded forums, I see two things 1) a universal love for and godlike respect for The C programming Language 23:25:24 2) users struggling with basic operations on bitfields 23:25:30 --- quit: nonlinear (Ping timeout: 260 seconds) 23:25:49 3) users with almost zero hardware experience 23:26:59 oh and 4) even tho none of them have ever used Forth, they think they know all about it and as a result avoid it like the plague 23:27:54 TSC->IOHCR &= -7 23:28:05 Forth is 'read only', 'untyped', 'ancient', 'unsuitable for teams' and 'arcane' didn't you know ? 23:28:37 I tend to see it the other way around, they are unsuitable for forth ;-) 23:28:42 hahaha 23:28:45 me too :) 23:30:23 I did mention that after 58 days a C user managed to provide partial functionality of my Forth binary, but it's very cut down. 23:31:13 he reads the chip registers, makes a conclusion, then outputs it in a USB 'identification' string when the device is queried 23:31:53 it's pretty clever I admit, but the actual source requires quite a few libraries 23:32:27 and it has no 'fancy menu' like mine ;-) 23:33:11 there was a short window of time when C interpreters were popular, the users of such interpreters were more likely to understand the benefits of a variable level interactive system such as Forth 23:33:40 but then C got complicated and C interpreters died out 23:34:39 late 70s, early 80s timeframe 23:35:05 is when the C interpreters were popular IIRC 23:35:34 i missed all that somehow 23:35:52 probably too busy being a newlywed and having kids 23:36:23 I probably have some old magazines with articles on them, maybe Computer Language or early Dr. Dobbs 23:36:46 one of them was called C-terp IIRC 23:36:52 one advantage is he doesnt need a serial terminal, but then Im always hearing C embedded people explaining how they use print statements on a serial terminal to debug their code 23:38:16 http://www.softwarepreservation.org/projects/interactive_c/cterp/cterp/ ? 23:38:37 looks pretty old 23:39:09 wow cool! Copyright 1985 23:39:24 good memory! 23:39:56 better than I expected :) 23:39:58 in 1985 I was writing machine code on a STK8085, that was the state of my tech! 23:40:19 I think there were others, but that's the name that popped to mind 23:41:24 it's been replaced by GDB over JTAG now 23:41:26 There were also a some Small-Cs, don't recall if they were just compilers 23:42:05 Do you remember the Motorola debug monitor 23:42:14 forget what they called it 23:42:16 well I'm off for tea! thanks for the chat and many Forth tips as always :) 23:42:27 no I never had stuff like that 23:42:30 cya! 23:42:32 take care, I'm off to x11 land 23:42:35 ciao! 23:43:39 --- join: nonlinear joined #forth 23:51:00 --- quit: nonlinear (Quit: The Lounge - https://thelounge.chat) 23:59:59 --- log: ended forth/20.02.26