๐Ÿ’พ Archived View for bbs.geminispace.org โ€บ u โ€บ stack โ€บ 5080 captured on 2023-11-04 at 13:42:23. Gemini links have been rewritten to link to archived content

View Raw

More Information

โฌ…๏ธ Previous capture (2023-09-28)

โžก๏ธ Next capture (2023-11-14)

๐Ÿšง View Differences

-=-=-=-=-=-=-

nForth - trouble in paradise

Just as I was beginning to enjoy low-level assembly coding after a long break, and looking forward to whumpin' on some home-made forth, the bastards got me!

My mom tried to tell me to be normal, and do things the way other people do them, but no! I had to be this weirdo who just gets more and more restless doing things the 'normal' way.

And so, 32-bit code is apparently over, just when I was really embracing the i386, with its limited registers. But I love being able to have a 3-byte, two-instruction NEXT which uses 32-bit execution tokens. And I really miss pusha and popa instructions in 64-bit code. Compactness.

Linux will run static self-contained 386 code, the way I like to write it, but apparently choke (without a meaningful error message, mind you!) on code compiled normally with gcc and libraries, because modern distros come without 386 library support -- even basic things like libc. Because my 1.5GB distro was so concerned about space to add a basic library that's like a couple of megs? And why is libc so big anyway? Why is linux 1.5GB? Maybe my mother was wrong after all, and everyone is in fact insane, just like I always suspected.

Lack of Error Message on executing 32-bit binaries with no 32-bit support

Also, the 32-bit version of Address Space Layout Randomization (which is not that helpful in preventing attacks anyway) is BROKEN, screwing up my nforth by loading code at a fixed address but creating a disjoined segment when I try to adjust memory break.

address randomization tribulations

32-bit support is less important than including at least 10 different visual themes, with multi-megabyte backgrounds created by people who failed art appreciation in high school. More mauve and green zigzags, please! And don't forget a sunrise over stylized Jupiter, please!

So to get my 4Kb forth running, I have to treat the core as a separate segment, which means I can't use 16-bit back-offsets for heads. I suppose it's a kluge, and I can make it a proper 32-bit address, and since heads are aligned to 4-byte boundaries, I can steal the low 2 bits for things like IMMEDIATE bit.

The other option is to make the code truly relocatable, but that is sort of against the grain of this particular, minimalistic project.

๐Ÿš€ stack

2023-09-03 ยท 2 months ago

3 Comments โ†“

๐Ÿ˜บ gemalaya

Your mom was trying to make you abandon assembly code and turn to Javascript but you resisted ? You're strong.

๐Ÿš€ stack

That is correct.

2023-09-04 ยท 2 months ago

๐Ÿš€ stack

Well, I changed over to 32-bit link pointers, and it works now with address randomization.