00:00:00 --- log: started forth/20.04.13 00:05:01 --- quit: webchat9 (Ping timeout: 260 seconds) 00:54:26 --- join: webchat9 joined #forth 01:13:58 --- quit: reepca (Ping timeout: 258 seconds) 01:31:01 --- join: reepca joined #forth 01:35:57 --- quit: reepca (Remote host closed the connection) 01:36:08 --- join: reepca joined #forth 01:46:20 MrMobius, after your C chat I obtained the STMicro StdPeriph library for the STM32F0 that I use and have found a good additional resource of config information, so thank you ! 03:48:40 --- part: dne left #forth 04:54:40 --- join: dddddd joined #forth 05:42:33 --- quit: reepca (Remote host closed the connection) 05:42:45 --- join: reepca joined #forth 06:06:16 --- quit: webchat9 (Ping timeout: 240 seconds) 06:09:31 : NEGATE ( n -- -n ) 0 SWAP - ; 06:09:47 --- quit: reepca (Ping timeout: 256 seconds) 06:11:27 see negate 06:11:27 0000207C: 4276 negs r6 r6 06:11:27 0000207E: 4770 bx lr 06:11:30 :) 06:12:17 I wrote an implementation in assembly as well 06:12:33 But this one is shorter 06:12:33 see NEGATE1 06:12:33 20000446: 2300 movs r3 #0 06:12:33 20000448: 1B9E subs r6 r3 r6 06:12:33 2000044A: 4770 bx lr 06:12:33 Bytes: 6 ok 06:13:27 My NEGATE is 4 bytes, not including the CREATE entry 06:13:30 negate is 4 bytes 06:13:50 seems efficient enough 06:14:41 of course youre on a 8 but cpu, this is 16 bit opcodes 06:15:26 In Z80 assembly it's something along line of: XOR A LD H,A LD L,A POP DE SBC HL,DE PUSH HL JP forth_next 06:15:48 Which I believe is 10 bytes at a glance 06:16:23 And extra code in the stack-checked version (my stack checking is done per-CODE def) 06:17:24 yeah always overheads 06:18:04 mine is the 0000207E: 4770 bx lr 06:18:35 basically it's only one instruction "negs" 06:18:38 Z80 has a 'negative' instruction, but of course it's 8-bit and applies to A only 06:18:57 Actually I'm sure you knew that already 06:19:26 i suspected, it's been 30+ years since I wrote Z80 assembly 06:19:44 Ah, glad to see discussion on Z80 :) 06:20:01 It's still around these days, with all the high schoolers and college students using TI-84+ calculators. 06:20:14 If I had used HL as top-of-stack then it would be EX DE,HL XOR A LD H,A LD L,A SBC HL,DE JP forth_next 06:20:27 But that's only 1 byte less (I think?) 06:20:32 Unfortunately TI upped their RSA signing on the newer calculators, so people can't flash their custom OSes or sign binary apps anymore :( 06:21:02 Z80 is very register constrained, but I managed to get it to work even using a register for TOS. 06:21:45 I tried with HL as TOS, and did not like it 06:22:42 veltas: How come? 06:23:14 I never checked to see if it gained me anything, it would be too painful to rewrite it at this point, perhaps. 06:23:44 Just over-complicated the situation, didn't gain me much, that was my very unscientific analysis 06:24:12 I think you probably want HL as TOS for max performance, but I am not trying to write the fastest Forth, just keeping it simple 06:24:29 Well I really don't care about max performance because I have a tokenised Forth... 06:24:38 good idea, keep it simple to get it going, make it faster later 06:24:58 I have been optimising for space because that's actually *why* I tried Forth out in the first place 06:25:37 The hope of decreasing code foot-print, and then I would just write stuff in assembly that needed speed optimising. That's the idea, give myself a nice big playground, without too much performance penalty in the end 06:26:00 veltas, resident Forth cannot compete with C for rom space 06:26:40 Because of CREATE overhead? 06:26:43 Or what? 06:27:01 veltas, if you want minimal space and the interactivity of forth, a tethered Forth may be the answer 06:27:19 We'll see if you're right ;) 06:27:28 mainly because of the actual Forth code, but yeah the Forth overheads as well 06:28:01 it's not my opinion, it's the results of my tests 06:28:22 and it's perfectly logical 06:28:31 Forth has a *much* lower minimum commitment than hand-written assembly, and the C compilers I've seen for Z80 are worse at Z80 than me without even trying to golf it 06:28:42 heh 06:29:02 Because Z80, to be fair, is not an easy fit for C 06:29:07 aha 06:29:12 Yeah, C to Z80 compilers suck. 06:29:33 it's still going to have much smaller code 06:29:44 Probably, the lack of registers means you'd need a top of the class register allocation compiler, and even then it's no guarantee since you can easily have more live variables than registers. 06:29:52 your Forth will take how many bytes, 12kB ? 06:30:16 tp: Not sure I think it will definitely be under 8KB even with lots of unnecessary stuff in it 06:30:39 ok 8kB 06:30:43 I'm at 3KB right now but probably half the words I need, haven't gone too crazy trying to refactor 06:31:21 if a assembly blinky takes 80 bytes of machine code, a C one might take 100 ? 06:31:52 Yes but what if you are going to fill the whole RAM with code and data 06:32:05 a Forth one will take probably 90 bytes ? 06:32:15 What is a blinky? 06:32:58 but the Forth binary will take 8kb plus the blinky of 90 bytes compared to the C one of 100 bytes ? 06:33:12 it just flashes a LED on your board 06:33:23 Basically, Forth's words I will be compiling into definitions at 1 or 2 bytes each if no special compilation semantics. 06:34:04 a tethered Forth with a multipass compiler may do the blinky in 80 bytes also 06:34:04 The words in Forth are a higher level than what Z80 does, they're mostly 16-bit logical programming operations like looping, arithmetic, comparison, etc 06:34:30 To do those things in Z80 requires an unexpectedly larger amount of code 06:35:01 but the tethered Forth only produces a blinky binary it has nothing else resident on the chip 06:35:28 veltas, wasnt the Z80 designed to be C friendly ? 06:35:38 No I don't think so 06:35:46 or is that the Atmel Mega9 ? 06:35:49 I think it was designed to be an 8080 with extras 06:36:00 ahh, ok i'm getting chips mixed up 06:36:19 It's (mostly) backwards-compatible with native 8080 code 06:36:25 yeah, definitely very intel like with the register banks 06:37:10 I didnt have any problems with assembly on it 06:37:58 but Ive never liked intel ISA as I started the motorola 6800 assembly 06:44:42 : BLINKY ( -- ) BEGIN 0 ATTR-FILE ! 25 MS $3F ATTR-FILE ! 25 MS 0 UNTIL ; \ this would be 20 bytes + CREATE overhead 06:44:45 At a glance 06:44:50 --- join: webchat9 joined #forth 06:46:28 That is blinking the first colour attribute cell, because there aren't any LEDs but it would be roughly the same code for a different address or port if there was. 06:47:54 do you have a PIO on the spectrum ? 06:47:59 Yes 06:48:03 cool 06:48:17 Wait you mean port input/output? 06:48:20 Or something else? 06:48:22 yea 06:49:41 better: : BLINKY 0 BEGIN DUP ATTR-FILE ! 25 MS INVERT $3F AND 0 UNTIL ; \ about 16 bytes 06:50:24 tp: How would you do an infinite loop in Forth? 06:51:25 a few ways, usually a do loop when Im testing 06:52:02 I hope BEGIN .. 0 UNTIL is alright, seems like the simplest one 06:52:19 infinite loop in the finished project may be a begin 0 until as you say 06:52:44 mostly it's begin key? until 06:52:53 so a keyboard hit stops the loop 06:53:09 Yes that is a good point 06:53:16 sure BEGIN .. 0 UNTIL is fine tho 06:53:37 I am implementing KEY? at the moment 06:53:59 my touch sensor will be the reset button on my new test jig as I wear buttons out 06:54:28 What if you wear your capacitor out? 06:54:32 my process requires a reset with every non recoverable bug 06:54:43 hahaha, the piece of pcb ? 06:54:47 easy to replace 06:54:54 I am of course joking 06:54:59 og course 06:55:13 and it's not impossible I could wear it out 06:55:36 id wear thry the insulating plastic first tho 06:56:08 i did think about a magnet and hall effect switch but thetouch sensor is fine 07:02:33 tp: I plan to try and set up the Forth so you can keep the dictionary contents seperate from CREATE info, so you just get a big Forth blob without word names etc 07:02:41 As an option when building the Forth 07:03:13 and save a lot of space ? 07:03:20 Yes hopefully 07:03:25 So not quite as optimised as the tethered one, but should enable you to at least get rid of all the unnecessary word strings 07:03:34 sure 07:03:47 but youll use your interactivity ? 07:03:52 Yes 07:04:25 whats the main reason for requiring smaller binary code ? 07:05:00 The plan is this: you can build the program, and then it will just run on its own as long as you don't QUIT if you just 'leave out' the CREATE area 07:05:21 tp: The main reason is I want to see what I can do with 48K so am trying out some fancy ideas 07:05:38 aha 07:05:47 I don't know how successful this will be but I already like the tools I've gained with this Forth 07:05:57 --- quit: iyzsong (Ping timeout: 256 seconds) 07:06:36 yes, Forth is fabulous for too building 07:06:51 thats become a lot of the fun for me 07:07:56 veltas, so when you write assembler for the z80 where does it run from, ram or eprom 07:08:07 RAM 07:08:23 Because I'm targeting the ZX Spectrum, so the ROM is the Sinclair BASIC ROM 07:08:31 and if you need to make it nv only tape ? 07:09:00 Yes 07:09:10 bi eprom option ? 07:09:17 No 07:09:17 no eprom option ? 07:09:41 Changing the ROM on a Spectrum is not hard but I am targeting vanilla hardware 07:09:55 So this is a pure software exercise 07:10:00 when I had a 8085 dev kit (SDK8085) it came with ram only as well 07:10:29 it had a hex keypad and 7 seg leds displey 07:10:41 so I programmed by hand in machine code 07:11:14 but I needed eprom to make my devices which I sold in those days 07:12:00 tp, the 8-bit AVRs were designed to work well with C 07:12:16 because I didnt have any software, I added a large rotary switch which simply switched the address and chip select lines between the ram and eprom 07:12:43 MrMobius, yes, I remembered that after veltas said it wasnt the Z80 07:13:00 veltas, and the dat lines of course 07:14:00 vel so Id develop on ram tiil it was good to go, rotate the switch to eprom and a small program burnt the ram to eprom, no relocator needed 07:15:01 Cool 07:15:56 MrMobius, after looking thru the STM StdPeriph library I must admit, it's pretty easym but still to abstracted for me. It did give my some idea why people have so much trouble grasping the config of periperals tho 07:16:42 MrMobius, and it also gave me some extra insight int problem areas I've encountered with various peripherals 07:22:36 tp, ive only had to mess with it once and the config is definitely tough 07:27:17 MrMobius, now i have a nice doxygen webpage with all that stuff it's a big bonus for me 07:27:44 great for insight into the perepherals as they even have a lot of useful notes 07:28:28 and they do much as I do, multiple lines for bitfields 07:29:23 MrMobius, so the discussion we had has been very beneficial for me and I appreciate you pov 07:32:05 --- quit: MrMobius (Ping timeout: 260 seconds) 08:28:23 --- join: reepca joined #forth 08:40:17 tp: Part of why I keep capitalising my Forth is because I am writing dictionary defs manually and I have chosen caps as the canonical stored names for words 08:40:23 So it's become a proper habit now 08:41:16 But I might start writing lower-case when I have my interpreter working *shrug* 08:42:07 veltas, Im sure it's no problem. quite a few people here use CAPS for Forth code 08:42:20 I do prefer looking at lower-case Forth 08:42:20 it doesnt bother me 08:42:36 I really liked how the gforth examples looked 08:43:20 yeah I have everything in lower case across the board here except capitals for text 09:03:04 --- join: Vedran joined #forth 09:03:31 --- quit: Zarutian_HTC (Ping timeout: 250 seconds) 09:06:58 --- join: MrMobius joined #forth 09:11:12 does mecrisp stellaris have reliable tail call optimization or stack *over*flow detection? 09:12:14 because i tried to loop over the dictionary in a (tail) recursive word and crashed the system with "unhandled interrupt 3" 09:13:51 i replaced the (not really) tail recursion with a begin/until loop and it works 09:15:11 --- part: Vedran left #forth 09:15:27 --- join: Vedran21 joined #forth 09:15:50 --- part: Vedran21 left #forth 09:16:49 --- join: Vedran joined #forth 09:26:51 --- join: Zarutian_HTC joined #forth 09:45:54 --- quit: gravicappa (Ping timeout: 256 seconds) 09:46:21 --- join: gravicappa joined #forth 10:01:46 --- quit: webchat9 (Ping timeout: 256 seconds) 10:05:03 --- join: webchat9 joined #forth 11:33:36 --- quit: proteus-guy (Ping timeout: 264 seconds) 11:43:16 --- quit: dddddd (Ping timeout: 240 seconds) 11:50:47 --- quit: Zarutian_HTC (Ping timeout: 250 seconds) 11:55:06 --- quit: webchat9 (Ping timeout: 256 seconds) 12:01:37 --- quit: jsoft (Ping timeout: 250 seconds) 12:51:00 --- join: Zarutian_HTC joined #forth 13:55:52 --- join: WickedShell joined #forth 14:42:36 --- quit: gravicappa (Ping timeout: 264 seconds) 15:05:28 --- join: dave0 joined #forth 15:32:38 --- join: X-Scale` joined #forth 15:35:04 --- quit: X-Scale (Ping timeout: 265 seconds) 15:35:05 --- nick: X-Scale` -> X-Scale 15:49:42 --- quit: reepca (Ping timeout: 256 seconds) 16:01:17 --- join: dddddd joined #forth 16:07:17 --- join: reepca joined #forth 16:44:14 --- join: jsoft joined #forth 16:46:22 --- quit: Zarutian_HTC (Ping timeout: 256 seconds) 17:57:28 --- join: X-Scale` joined #forth 17:59:19 --- quit: X-Scale (Ping timeout: 256 seconds) 17:59:19 --- nick: X-Scale` -> X-Scale 18:04:39 --- join: Zarutian_HTC joined #forth 18:42:54 --- join: boru` joined #forth 18:42:57 --- quit: boru (Disconnected by services) 18:43:00 --- nick: boru` -> boru 18:58:15 --- quit: jsoft (Ping timeout: 265 seconds) 18:59:11 --- quit: reepca (Remote host closed the connection) 18:59:24 --- join: reepca joined #forth 19:02:00 crest, yes on stack *over*flow detection, dunno about reliable tail call optimization but probably 19:03:03 * tabemann now has defer, defer!, and defer@ in zeptoforth 19:03:23 crest you need to use calltrace.fs from common and do a # init.calltrace to halt on a hardware exception and tell you what caused it 19:03:54 tabemann, nice, I have no defer in Mecrisp-Stellaris 19:04:19 I didn't bother with the other associated words that are in ANS like IS and ACTION-OF 19:04:37 because really, all one needs are defer, defer!, and defer@ 19:05:24 note that zeptoforth differs from ANS in that you can only call defer! on a word once... because that word may be in flash and may be only writable once 19:05:58 only writable once ? 19:06:21 Mecrisp-Stellaris only allows flash to ever be written once 19:06:21 well yes, because flash is only writable once without doing a mass erase 19:06:34 ah yes, it's a hardware thing 19:06:46 the flash controller wont allow it 19:08:12 so much stuff in ANS doesn't fit an embedded environment where much of the code is in flash 19:10:26 yeah, all one can do is try and follow ANS and disregard it where it doesnt fit 19:10:57 chuck wouldnt care, he said that 'standards' kill Forth or something like that 19:12:24 --- join: jsoft joined #forth 19:13:11 I've done things that are blatantly un-ANS, like using b@ b! b, instead of c@ c! c, and having two different here pointers, which can be explicitly referred to or can be accessed in a compilation mode-dependent fashion 19:14:27 yes I know, I reported them to the ANS prosecution department for my $50 reward 19:14:38 lol 19:14:45 ;-) 19:20:59 I've been looking at something called CollapseOS 19:21:18 apparently the author thinks that civilization will collapse in the coming decades 19:21:35 and the only surviving computer architectures will be the likes of the Z80 19:21:57 so the Z80 machines that survive will form the basi of future computing 19:22:49 it originally was all written in Z80 assembly 19:22:57 but now they're adding Forth to it 19:23:08 yeah I read that also 19:24:03 i think the only chips that will survive a collapse are Chinese clones of the STM32F103C8 .... 19:24:21 must be billions of them around 19:25:35 --- join: proteus-guy joined #forth 19:25:41 hey 19:25:44 tp: I agree 19:26:03 if any computers survive, they'll be cheap Chinese MCU clones 19:30:30 I havent seen a Z80 in anything for years 19:30:47 and I last programmed one in the mid 80's 19:30:49 tp: Do calculators count, heh? 19:31:04 siraben, not usually 19:31:30 Haven't seen them outside TI calculators 19:31:31 siraben, have you ever pulled a calculator apart ? 19:32:16 usually the chip is die bonded and covered in a blob of hard epoxy, impossible to reuse 19:32:59 more expensive models such as the opensource calculator has a decent cortex-m in smt and not blobbed 19:33:14 but theyre like $250 a piece 19:33:43 you can be absolutely certain a $3 cheap and nasty calculator will just have 'the blob' 19:35:10 hmm, I actually have a TI34 on my desk, it's awesome, solar powered and quite old now 19:35:36 still works like new, no batteries required, Im sure that unit would survive a collapse 19:35:55 theres calculators and then theres calculators 19:36:07 MrMobius, so true 19:36:22 a mid range TI is like a souped up computer from the mid 80s with way more memory and several times more speed 19:36:31 back 19:37:14 MrMobius, Ti always made good calculators, second only to HP (the old hp) 19:38:44 MrMobius, I took out a loan once to buy the Ti with the programmable mag stripe, it was just outstanding but the keys were pretty ordinary compared to the HP units 19:38:45 I had a TI-89 with a 12mhz 68000 in it 20 years ago that I learned C on 19:38:51 the thing was a speed demon 19:39:09 wow, that's definitely a serious calculator 19:39:31 the DSO on my desk right now has a 68000 in it as well 19:39:45 made in 1994 19:39:56 by HP 19:40:33 boots up in about 2 seconds, try that with a Rigol ARM based Digital Storage Oscilliscope ? 19:40:39 nice. I bet its still going strong 19:41:19 oddly the bloody main board died 5 years after I bought it new (demo from HP @ $4600) 19:41:38 HP said they had no spares as they ditched them after 5 years! 19:42:03 I put a search on ebay and about 6 months later a brand new board showed up for $25! 19:43:00 that mobo has been flawless the last 21 years 19:44:22 I have the rs232 module and use that to dl picture data for my projects, no where near as good as a 2gB/s Rigol, but I find Chinese homemade scopes impossible to use 19:45:52 here is a pic from my scope https://mecrisp-stellaris-folkdoc.sourceforge.io/project.3temp.sensors.html?highlight=temperature#individual-pulse-timing 19:48:10 Im get one too someday when im rich :P 19:48:17 okay, I'm gonna head to bed - g'night all 19:48:45 cya tabemann 19:49:10 MrMobius, I had to take out a loan for that scope 19:49:29 some people buy new cars, I buy new test gear 20:16:04 --- join: rdrop-exit joined #forth 20:23:40 good morning Forthwrights c[] 20:24:12 good morning Zen Forth Guru 20:24:30 hi Forth Master Tech (tm)! 20:25:03 hows is life in Manila today ? 20:25:22 very quiet outside 20:25:31 rdrop-exit, I actually live 200km away from the town of Manilla in NSW 20:25:42 cool 20:25:54 it's the site of the World Parasailing competition each year 20:26:21 where contestants parasail unassisted over a 40 km route 20:26:59 neat 20:27:23 on the news yesterday they were showing a motorized hydrofoil surfboard 20:27:24 about 10 years ago a German contestant was sucked up into a stormcloud and reached about 7000m ! 20:27:36 yeah, theyre pretty neat 20:27:36 wow 20:27:55 thats above the 'altitude of death' 20:27:56 2 of my kids are into surfing 20:29:10 I was more into water skiing as a kid 20:29:25 sh was sucked up rapidly and blacked out, and her parasail collapsed, and it then fell like a rock as her 'sleeping bag' like wrap filled with hailstones 20:29:43 =8-O 20:29:58 at some point the parasail reopened and she landed unconscious in the bag full of ice 20:30:59 when she woke she was freezing and her gear including radio comms was busted but her cellphone still worked and she was able to call for help 20:31:26 her phone had also logged the journey inc height profiles 20:31:40 amazing 20:31:56 she got oyt of it with part of a ear and the side of her face damaged by frostbite 20:32:04 yeah, incredibple 20:32:15 incredible even! 20:33:29 I had a friend who lost 8 toes to frostbite climbing Choy Oyu 20:33:40 * Cho Oyu 20:36:04 https://en.wikipedia.org/wiki/Ewa_Wi%C5%9Bnierska 20:36:18 yeah, nasty stuff 20:36:47 that wikepedia article sums up her ordeal being sucked into a thunderstorm 20:38:01 harrowing 20:38:48 until that happened I didnt know that thundrstorms have a vert strong updraft 20:40:55 I've always wanted to make some Forth powered glider/parasailer flight instruments 20:41:23 battery powered, wrist mounted 20:41:42 gyro, compass, altimeter 20:54:31 nice 20:54:56 and very easy to do thesedays 20:55:16 --- join: webchat9 joined #forth 20:55:54 I have all the sensors and displays to make a dual vacuum guage for tuning my V twin motorbike, thats project #999 ;-) 20:56:05 solid state vac sensors 20:56:54 if this Coronavirus goes on for a few more months I may actually get them started 21:05:53 --- quit: dave0 (Quit: dave's not here) 21:13:16 lunch is on the table, catch you later, stay healthy 21:13:21 --- quit: rdrop-exit (Quit: Lost terminal) 21:26:14 --- quit: Zarutian_HTC (Quit: Bye) 21:34:27 --- join: ornxka_ joined #forth 21:35:23 --- join: naraic_ joined #forth 21:40:42 --- quit: ornxka (*.net *.split) 21:40:42 --- quit: naraic (*.net *.split) 22:11:58 --- join: rdrop-exit joined #forth 22:18:30 --- join: gravicappa joined #forth 23:06:30 --- quit: webchat9 (Ping timeout: 258 seconds) 23:28:05 --- join: mtsd joined #forth 23:48:49 --- join: webchat9 joined #forth 23:59:59 --- log: ended forth/20.04.13