2024-10-06 02:09:32 just got an enhanced 8051 (CH559), planning on writing a Forth for it; other than what's in Moving Forth, does anyone have any 8051-specific advice? (The CH559 has flash as PMEM so I won't need the hardware mod from Moving Forth, at least...) 2024-10-06 02:14:30 remexre: neat! 2024-10-06 02:15:03 does it have two DPTRs? some models include that to speed up transfers which you can use for CMOVE 2024-10-06 02:16:23 it looks like it does 2024-10-06 02:16:38 that's convenient, yeah 2024-10-06 02:16:55 dunno what the hardware mod is. tying the XRAM and ROM chip selects together so you get one address range? if you dont have that you have to figure out what to do about the 3 different addressing systems 2024-10-06 02:17:52 yeah, effectively; the EPROM is used for the bottom 32k of PMEM, RAM for the upper half 2024-10-06 02:18:24 cool 2024-10-06 02:19:10 looks like 6kb XRAM internally which isnt much. does this chip have an external bus for code and/or data if you want to expand? some only have one or the other but not both 2024-10-06 02:19:12 or neither 2024-10-06 02:20:12 the datasheet says up to 32kB of XRAM, but I don't think my board includes it 2024-10-06 02:21:08 that's good. RAM is at more of a premium for forth. you should have no problem fitting your forth code in the 64k internal flash 2024-10-06 02:21:50 yeah, I've done an AVR forth before and I just put everything in flash from the get-go 2024-10-06 02:22:12 and I would just create separate versions of ! and @ for RAM and flash so they dont have to figure out from the address where to fetch from 2024-10-06 02:22:24 as in, e.g. VARIABLE was in flash, RAMVAR was in RAM 2024-10-06 02:22:57 yeah 2024-10-06 02:24:05 moving forth appears to put the return stack in the low 128 bytes of IRAM and the data stack in XRAM; I'm inclined to put the return stack in the higher half of IRAM and the data stack in the lower half, though 2024-10-06 02:26:22 might be better 2024-10-06 02:26:49 the original 8051 only had the low 128 bytes in IRAM. the high 128 bytes was added in the 8052. most modern "8051s" are actually 8052s 2024-10-06 02:27:18 ah; well, my datasheet definitely says they're there on my chip, thankfully 2024-10-06 02:27:47 ya it's definitely on all modern chips. i just mean the author may not have had access to it 2024-10-06 02:27:55 oh, right 2024-10-06 02:27:59 yeah that makes sense 2024-10-06 04:57:28 remexre: I'm interested in your reasons for preferring lower/upper there. 2024-10-06 04:57:40 For having a preference at all, I mean. 2024-10-06 05:32:49 KipIngram: preferring them ovver XRAM, or why I'd put the data stack in the low half? 2024-10-06 05:33:13 only needing an 8-bit register instead of a register pair would be the main reason 2024-10-06 12:05:27 KipIngram: the upper 128 can only be addressed indirectly. all ALU ops are on internal RAM. you only get load and store for XRAM even when the XRAM is internal to the chip 2024-10-06 12:09:21 in a weird way it feels like RISC 2024-10-06 14:06:22 remexre: the latter. The former could have any number of good explanations, though I'm not familiar with the part myself. I assume the IRAM is faster. 2024-10-06 14:06:44 MrMobius: I see - that makes sense. 2024-10-06 14:07:41 Yeah, RISC-like on the XRAM. Almost like the IRAM is a pseudo register bank. 2024-10-06 14:53:07 yep 2024-10-06 15:02:26 I think those were actually pretty good design decisions, given the resource limitations of the day. 2024-10-06 15:03:08 Some of those early micros were really pretty special things. 2024-10-06 15:03:31 And the history around that era is really entertaining too. 2024-10-06 15:03:58 Cleverness, little personal rivalries, the whole nine yards. 2024-10-06 19:50:53 remexre: awesome! the 8051 is one of the few 8-bit architectures that still matter today