2023-12-09 10:15:55 I'm also looking into storing comments separately from the source itself. I'm not 100% sure exactly what sort of display options I have in mind. I've thought about popping comments open in a separate text box, but another possibility is to be able to toggle on/off whether some of them display "inline" with the source. 2023-12-09 10:16:30 I do want the connections between the source and the comments to be "explicitly stored" in some way, though. I've thought a b+tree seems like it could do that well. 2023-12-09 12:08:16 Honestly I've regarded my averstion to the visual appearance of comments as a bit of a problem. I recognize the value of good comments. But I've been known to put them in and then go back and take them out because I think they're making my source ugly. :-( 2023-12-09 12:09:16 I watched a bunch of Aaron Hsu's APL codefns stuff, and some of it was on his "philosophy" of proramming. In one he actually said outright that you didn't have to feel bad for not commenting, and I wanted to clap. It felt like a degree of vindication. :-) 2023-12-09 12:09:49 "Maybe I'm ok after all..." 2023-12-09 12:14:27 noobs need a lot more comments 2023-12-09 12:20:31 And it's hard for me to imagine code more "dense" that Hsu's APL code. It's generally just a solid page-filling slab of text. 2023-12-09 12:21:05 asyncBigGrid config image? 2023-12-09 12:21:15 Bit* 2023-12-09 12:47:21 how do i convert single precision integers to floats 2023-12-09 12:48:01 IEEE 754 single precision floats? 2023-12-09 12:48:06 yea 2023-12-09 12:48:35 like if i have 1 on stack how do i get 1e on the float stack 2023-12-09 12:49:03 depends on the forth but I guess I->F or some such 2023-12-09 12:49:34 gforth 2023-12-09 12:50:19 what does gforth documentation say? 2023-12-09 12:50:52 it has double to float 2023-12-09 12:51:07 but i didn't find single to float 2023-12-09 12:51:18 integer to float? 2023-12-09 12:51:23 yea 2023-12-09 12:51:36 no such? 2023-12-09 12:51:55 yes. they have d>f but no equivalent for single precision integers 2023-12-09 12:52:35 here's the source i'm using: https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/index.html 2023-12-09 12:53:40 s>f 2023-12-09 12:54:19 oh thanks :) 2023-12-09 12:54:29 https://forth-standard.org/standard/float/StoF 2023-12-09 12:55:06 ACTION hasnt used floats in any of the forths he had used 2023-12-09 12:56:06 ACTION also thinks it's very niche, but they are doing Codewars katas which for some reason like using floats 2023-12-09 12:56:14 gforth also has f.s for printing out the floating point stack 2023-12-09 12:56:32 (I just guessed at that and it worked :P ) 2023-12-09 12:57:34 Never let 'em know your next move... s>d d>f 2023-12-09 13:02:56 Joa003: I use the floating point instructions to do that. 2023-12-09 13:03:08 There's a "load integer" instruction, that will just handle the whole job. 2023-12-09 13:03:32 You can slurp it into the FP circuitry as an int and then store it back out as a bit pattern. 2023-12-09 13:04:08 I also used the floating point hardware to input floats directly; I capture the mantissa and the exponent as integers and then do some calculations. 2023-12-09 13:04:30 You can't do 10^x "directly," but you can get there with a few instructions. 2023-12-09 13:05:07 I also count the digits to the right of the decimal point when processing the mantissa as an integer, and correct for that (change the power of 10) later on. 2023-12-09 13:05:54 I'm not sure I can find that code, though - I haven't written it in my current system yet, and I think my old source has gotten away from me. 2023-12-09 13:10:24 I think a case could be made for doing it without fp instructions back when fp was an optional coprocessor thing, but these days if you're writing x86 code you have those capabilities. That makes it the slam dunk way to go in my opinion. 2023-12-09 13:12:07 Also, in that process of achieving 10^x there is one unexpected wrinkle - one of the instructions you have to use requires that its argument be in the range 0-1, or 1-2, or something like that. That involves a little hoop jumping (some shifting) and you have to remember to correct for that later too. 2023-12-09 13:16:40 ls 2023-12-09 13:17:40 crc: directory is empty 2023-12-09 13:18:51 :) 2023-12-09 16:24:50 comprehensively verifying an assembler scares the bajeezus out of me 2023-12-09 16:25:02 why? 2023-12-09 16:25:21 seems like an overwhelming undertaking 2023-12-09 16:25:46 depends on the architecture you are targetting 2023-12-09 16:26:02 i've only written the basic ALU instructions so far and the number of different registers and addressing mode permutations is turning out to be enormous 2023-12-09 16:26:38 aah, Crappy Istruction Set Computing 2023-12-09 16:26:44 yes :( 2023-12-09 16:27:15 it's x86 2023-12-09 16:27:33 i have some idiotic fantasy of being self hosting before i start targetting good ISAs 2023-12-09 16:27:58 you can just target a subset of the addressing modes 2023-12-09 16:29:46 true. i'll probably never get any value from actually supporting the 8-bit instructions. and i sure as hell don't plan to implement the full instruction set 2023-12-09 19:06:36 zelgomer: I wrote up a 1-2 kb of source that will do all the 64-bit binary operations, including the moves. Supports reg/reg and indirect with and without offsets. I have no idea how to verify it, though. Everything I checked (just a random sampling) was encoded correctly. 2023-12-09 19:10:35 It's here if you're interested: 2023-12-09 19:10:37 https://pastebin.com/Fn1U77Mt 2023-12-09 19:11:09 A handful of unary operations too, but I was just starting those when I set it aside for a while. 2023-12-09 20:23:59 KipIngram: thanks. i'm verifying mine by assembling all of the permutations with gas, then with mine, and then use objdump to disassemble and diff 2023-12-09 20:26:28 i have all of the add, sub, and, xor, etc. group working, all register sizes and addressing modes. well, except for indirect through rbp and the SIB byte because i broke those refactoring something 2023-12-09 21:07:55 RSP and RBP are exceptional someone. I don't know exactly a "textbook" way of describing it, but there's a difference in those patterns. 2023-12-09 21:08:09 Wait, I'm sorry. 2023-12-09 21:08:14 Not RBP and RSP. 2023-12-09 21:08:25 rsp and the r8-r15 equivlaent one. r13 I think. 2023-12-09 21:30:32 yeah. and it's r12 2023-12-09 21:31:20 and then there's bullshit with the new 8-bit regs spl bpl sil and dil 2023-12-09 21:32:22 they correspond to ah, ch, dh, and bh but with a rex prefix, so there's no way to address the *h registers and spl/bpl/sil/dil in the same instruction 2023-12-09 21:34:47 and then there are special case instructions when src is immediate value and dest is al or *ax, but they don't apply to r8b/r8w/r8d/r8 2023-12-09 21:35:05 for some reason i can't fathome 2023-12-09 21:36:04 at least gas and objdump didn't recognize them. i didn't actually try to execute it to see what it does. probably causes my cpu to explodw 2023-12-09 23:12:38 That sounds so trying. :-| 2023-12-09 23:13:14 I am primarily interested in the instructions I need for writing "most of" a Forth. That is, I don't mind poking bytes for a few primitives. I just don't want to have to do it for all of them. 2023-12-09 23:13:25 So i might be able to avoid the 16-bit and 8-bit variants. 2023-12-09 23:16:10 Also, in a lot of his chips Chuck doesn't even offer less than cell access. If you need that you shift and mask. He probably sees it as a) simplifying the hardware and b) encouraging us to write the most performant algorithms. Just design your application so you don't need to do extensive 8/16 bit accesses. But if you're working with an x86, it's a shame to not take advantage of the capabilities when 2023-12-09 23:16:12 they're RIGHT THERE.