2026-06-01 01:03:39 tabemann: Sergeant's three-instruction Forth does have the ability to make new definitions! 2026-06-01 01:04:59 xentrac: in what way? if it doesn't have colon definitions... 2026-06-01 01:06:32 oh I see 2026-06-01 01:07:00 you literally write instructions into memory, and then you execute or write instructions to call those instructions 2026-06-01 01:17:03 yup 2026-06-01 03:25:10 I think Linux/m68k lasted significantly after that Linux/m68k page was last updated in 02000 2026-06-01 03:33:36 hmm, actually it still exists. I have linux-6.12.85/arch/m68k right here 2026-06-01 06:57:52 i8080: 2E 18 13 72 23 73 2B 2B 2B 46 23 4E 23 23 23 EB 09 EB D2 03 00 76 00 00 2026-06-01 06:59:03 Works on altair simulator it seems, but really should work on any 8 bit 8080/Z80 if zero is RAM. But if it's ROM, then you have to adjust addresses 2026-06-01 08:30:05 is that a Sergeant-style 3-instruction Forth? 2026-06-01 08:54:12 xentrac, no it's 16 bit fibonacci 2026-06-01 09:35:26 aha 2026-06-01 10:02:51 xentrac, I wonder if you can golf it down significantly. Because its output is only up to fib24=46368 2026-06-01 10:03:26 My code is 24 bytes, so it only saves 1/2 of size compared to simply filling with result 2026-06-01 10:22:11 I have signifcantly changed the memory layout of my spiritual successor to dc int main(){int 2026-06-01 10:22:11 x,y,z,t=9999,*g=malloc((sizeof(int))*9999),*h;while('\n'!=(g[--t]=getchar()));t++;while(1){z=(g+t)[0];x=(g+t)[1];y=(g+t)[2];switch(z){c('q',exit(0))c('-',g[x]-=g[y])c('<',g[x]=g[x] crc: 2026-06-01 10:25:09 lisbeths, you know code golf makes sense in machine code, but in C it just makes it less readable. Though I guess I can ask an AI to put tabs and linebreaks in right places. but it might change something subtly. 2026-06-01 10:25:31 the ungolfing of code is solved 2026-06-01 10:25:37 you can ask ai to ungolf this 2026-06-01 10:25:52 is this complete program? 2026-06-01 10:26:06 z.ai eats all ram 2026-06-01 10:26:07 yeah but its just a prototype I havent tested it 2026-06-01 10:26:39 may have some subtle bugs 2026-06-01 10:34:45 lisbeths, it could undeflow if you enter line longer than 9999 bytes 2026-06-01 10:34:58 yeah thats true 2026-06-01 10:35:12 you can add safeties to it if you want, its gpl2 2026-06-01 10:37:22 Why not gpl3? If realloc fails, you free g and keep going, so you probably need exit in this case 2026-06-01 10:39:43 lisbeths, anyway, it's still confusing. You have comparison and some arithmetic but then what? You have to use raw numbers to know where to put strings? 2026-06-01 10:43:47 yeah I will fix realloc later 2026-06-01 10:44:09 the only type is integer 2026-06-01 10:44:53 bignums are something you should consider to write in assembly 2026-06-01 10:45:27 or use something that already has them like lisp or i think python has bigunms 2026-06-01 10:48:27 dave0, or bc 2026-06-01 10:49:39 well theres this trick that chuck moore talks about that you can learn if you learn a circular slide rule 2026-06-01 10:50:11 chuck said in a talk that you dont need big numbers like five million 2026-06-01 10:50:26 you can just encode that as a 5 and as a 7 2026-06-01 10:50:51 the 5 is t value and the 7 is the magintude 2026-06-01 10:51:17 if you combine that with an additional integer to store a remainder, then you have something somewhat similar to a float 2026-06-01 10:52:28 someone did some research and found in programs most numbers fit in 8 bits and i think it was 99% fit in 16 bits 2026-06-01 10:52:55 i think it also said 30% of constants are zero 2026-06-01 10:54:29 wow thats cool 2026-06-01 10:55:01 i wonder if they counted initializations to zero 2026-06-01 10:55:31 maybe! it's a good point 2026-06-01 11:09:31 99% in 16 bits doesn't surprise me, yet if 99% of useful programs could fit in a 16-bit address space that would surprise me 2026-06-01 13:52:50 xentrac, actually you can get it down to 8 bytes 31 00 01 13 E5 19 EB D2 04 00 76 2026-06-01 13:53:13 I mean 13 E5 19 EB D2 04 00 76 2026-06-01 14:04:57 I mean 13 E5 19 EB D2 01 00 76 2026-06-01 15:55:30 E5 19 EB C7 31 1A 02 13 C7 this is slightly longer and has to start from 04, but it's self-terminating code 2026-06-01 16:45:53 Stalevar: that seems good 2026-06-01 16:46:40 code golf is mostly just fun in machine code too 2026-06-01 16:48:52 What is that code meant to do? 2026-06-01 16:51:45 veltas, fill memory with fibonacci 2026-06-01 16:52:36 Main purpose was to see if I still remember how to work with front panel computers 2026-06-01 16:52:47 I see 2026-06-01 16:53:03 Did you work with front panel computers back in the day? 2026-06-01 16:55:54 Nope. My first computer run Windows XP when bought 2026-06-01 16:56:13 Is it using PUSH to write the sequence? 2026-06-01 16:56:15 Unless you count NES clone and PSone and BrickGame pocket games 2026-06-01 16:56:43 veltas, yes. Because without push it takes 24 bytes while generating 24 numbers 2026-06-01 16:56:50 Not very efficient compression 2026-06-01 16:57:48 If you use Radio 86rk monitor though, which let you set a breakpoint and initial register values you can get it down to 5 bytes 2026-06-01 17:00:30 Or even 4 bytes, E5 19 EB C7 and you set SP to 021A and HL to 0001 2026-06-01 17:01:00 Or E5 19 EB C7 31 1A 02 13 C7 and start it from address 04 2026-06-01 17:01:33 Or if you don't overwrite its own code, then 13 E5 19 EB D2 01 00 76 2026-06-01 17:02:29 SP is set to 0000 on Altair and it wraps around, so you don't need to init it 2026-06-01 17:03:33 Or to be precise, 256 bytes of RAM is wired to 00-FF and high order byte of SP is ignored 2026-06-01 17:04:01 I guess really it helps to choose a scenario 2026-06-01 17:12:12 The Altair 8800? I can't find info about that 2026-06-01 17:12:30 Looks like there's no truncation of address bus? 2026-06-01 17:12:30 https://wixette.github.io/8800-simulator/ this one 2026-06-01 17:12:59 Memory only goes up to 0xff 2026-06-01 17:14:31 well, you could put 64K of RAM into it, or more with bank switching 2026-06-01 17:14:38 it just didn't come with it originally 2026-06-01 17:22:49 xentrac, ofc, but this sim can't run the self-overwriting version because it needs 538 bytes 2026-06-01 17:24:30 Though if you don't save two bytes by using RSTn instead of JNC 0xADD3, it will take less stack space 2026-06-01 17:24:40 you can certainly configure SIMH to have more memory than 256 bytes 2026-06-01 17:24:46 dunno about wixette's sim 2026-06-01 17:25:06 Does simh support front panel? 2026-06-01 17:25:23 Last time I only found z80pack which does 2026-06-01 17:25:34 It seems that online simulators are more numerous 2026-06-01 17:25:47 I guess my question is whether the 256 byte memory module is ignoring the high address bits, because the bus seems to support a full 64K address space 2026-06-01 17:25:51 Yet you said it wraps round 2026-06-01 17:26:22 I don't remember but I'm sure it at least had the option to not ignore them 2026-06-01 17:26:25 veltas, if high address lines are not connected anywhere, then of course it will wrap around 2026-06-01 17:26:26 well 2026-06-01 17:26:46 when we're talking about the 8800, "hardwired" decisions still weren't that hard to change 2026-06-01 17:27:06 also it was sold as a kit 2026-06-01 17:27:17 exactly 2026-06-01 17:28:01 imsai's better though 2026-06-01 17:28:05 So I am asking then whether the high address bits are left unconnected on that 256 byte memory module 2026-06-01 17:28:36 Where can you connect it anyway, if you only have 256 bytes? 2026-06-01 17:28:49 I guess chip select via logic gates? 2026-06-01 17:28:54 Yes 2026-06-01 17:29:04 That's how backplanes tend to work 2026-06-01 17:29:17 So you can have multiple modules with one address space shared 2026-06-01 17:29:17 It could also be this particular sim bug / feature 2026-06-01 17:29:32 I'd have to check schematic 2026-06-01 17:30:46 Anyway, it seems that 86rk is much easier to type program is. You just do M or M addr (0 by default) and write the hex codes and then run it with G which can set a breakpoint 2026-06-01 17:31:10 And you can set registers with X 2026-06-01 17:31:33 https://rk86.ru/ 2026-06-01 17:31:45 https://86rk.ru/ 2026-06-01 17:31:51 Both host online simulators 2026-06-01 17:32:08 Or you could take emu80 2026-06-01 18:54:42 I'm pondering buying a cheap ($18) graphing calculator or not. I already have HP 39gs and don't use it, but the other one is interesting in that it's strange noname and has PROG button 2026-06-01 22:08:33 Stalevar: What are some good projects for the Altair 8800?