We don't have the bot, so let me step in: this thread is not for serious in depth discussion of weighty topics, this thread is not for anything Culture War related. This thread is for Fun. You got jokes? Share 'em. You got silly questions? Ask 'em.
Friday Fun Thread for September 09, 2022
- 56
- 8
What is this place?
This website is a place for people who want to move past shady thinking and test their ideas in a
court of people who don't all share the same biases. Our goal is to
optimize for light, not heat; this is a group effort, and all commentators are asked to do their part.
The weekly Culture War threads host the most
controversial topics and are the most visible aspect of The Motte. However, many other topics are
appropriate here. We encourage people to post anything related to science, politics, or philosophy;
if in doubt, post!
Check out The Vault for an archive of old quality posts.
You are encouraged to crosspost these elsewhere.
Why are you called The Motte?
A motte is a stone keep on a raised earthwork common in early medieval fortifications. More pertinently,
it's an element in a rhetorical move called a "Motte-and-Bailey",
originally identified by
philosopher Nicholas Shackel. It describes the tendency in discourse for people to move from a controversial
but high value claim to a defensible but less exciting one upon any resistance to the former. He likens
this to the medieval fortification, where a desirable land (the bailey) is abandoned when in danger for
the more easily defended motte. In Shackel's words, "The Motte represents the defensible but undesired
propositions to which one retreats when hard pressed."
On The Motte, always attempt to remain inside your defensible territory, even if you are not being pressed.
New post guidelines
If you're posting something that isn't related to the culture war, we encourage you to post a thread for it.
A submission statement is highly appreciated, but isn't necessary for text posts or links to largely-text posts
such as blogs or news articles; if we're unsure of the value of your post, we might remove it until you add a
submission statement. A submission statement is required for non-text sources (videos, podcasts, images).
Culture war posts go in the culture war thread; all links must either include a submission statement or
significant commentary. Bare links without those will be removed.
If in doubt, please post it!
Rules
- Courtesy
- Content
- Engagement
- When disagreeing with someone, state your objections explicitly.
- Proactively provide evidence in proportion to how partisan and inflammatory your claim might be.
- Accept temporary bans as a time-out, and don't attempt to rejoin the conversation until it's lifted.
- Don't attempt to build consensus or enforce ideological conformity.
- Write like everyone is reading and you want them to be included in the discussion.
- The Wildcard Rule
- The Metarule
Jump in the discussion.
No email address required.
Notes -
Yay! Funnily enough I made a thread too, but I guess you beat me through the moderation queue.
Without further adieu. I've been continuing my adventures in x86 assembly.
When last we met, I had just gotten Visual Studio Code to compile, link and run my asm files in DOSBOX. Since then I wrote a javascript file which node.js can execute which will ingest the dbg file from NASM, a map file from ALINK, and the exported breakpoints from Visual Studio Code, and create a list of breakpionts for DOSBOX to set in memory. Using a patched version of DOSBOX which will autoexec debugger commands, it ingests this file, and viola! My breakpoints set in Visual Studio Code get set in DOSBOX. I'm still refining the script, as well as the tasks in VSC. I went from writing tasks for each asm file, to writing a generic tasks which will compile, link and execute any single asm file. I don't have it adding the breakpoints yet though.
This has made it super easy to spit out a random asm file to test or experiment with one specific feature. I went to the effort of creating some code snippets to fill out new asm files with everything I need to start a new program. I also began taking notes in a composition notebook. Because there is just something about synthesizing lots of information from numerous websites, books and forum posts into exactly the concise information you need and writing it down, which seems to etch it into stone in your memory.
For example, the 8088/8086 has 4 "generic" registers. AX, BX, CX and DX. Except they are generic in name only. Sure, you can use them in a brute force fashion. Except near as I can tell, AX, the accumulator, is faster, if not required, in most math functions. BX, the base register, is the only register that allows you to use various forms of indirect addressing in the data segment. CX, the count register, is used for any instruction that repeats like LOOP or assorted bit rotations. DX, the data register, often functions as an auxilary for AX in the case of division or multiplication. Knowing these things really helps you plan ahead your register usage, but wasn't really spelled out super clearly in the sources I saw. So I spent an hour making a single page of notes, scanning all the 8088/8086 instructions for their special usage of AX, BX, CX and DX. I think it was productive.
The NASM documentation lies. A lot of contemporary 8088 documentation I'm reading uses what I can only assume is the Intel assembler's syntax. So indirect addressing is shown as "[di]", "label[bx]" or "label[bx][si]" for increasingly convoluted forms of offsetting and indexing. NASM claims it doesn't support this. That the entire address needs to be either inside or outside of square brackets. So "label[bx][si]" should be "[label+bx+si]. This is a blatant lie as I've compiled "label[bx]", "label[bx,di]" and "label[bx+di]". In fact, "label[bx,di]", "label[bx+di]", "[label+bx,di]" and "[label+bx+di]" all compile to the exact same byte code. More or less the only illegal syntax in NASM is the original Intel? syntax of "label[bx][di]". It won't support multiple square brackets.
But it's nice having a toolchain where I can just belt out a quick asm test file to inquire about these things. Sure, it's DOSBOX, not a real machine. But I'm mostly confident DOSBOX has it's shit together for basic stuff like this. As I've delved deeper into BIOS, DOS and VGA interrupt programming, some of the documentation I've read goes deep into all the assorted bugs various hardware possessed. For example, a lot of hardware erroneously wipes out the BP register on INT 10h calls! That's kind of a big deal. I'd be shocked if DOSBOX reproduced this. But maybe!
Anyways, it's been fun. Hope to have my first very simple assembly game belted out in the next few days. Also, I shouldn't be surprised, but it's remarkable how fucking small assembly executables are. These little test programs often weigh in at less than 200 bytes. Several of KB for even a simple "Hello World" in any modern language isn't uncommon.
The a-d registers, to the best of my knowledge, are named generic because it's in contrast to the other registers with very specific functions. For example, sp and ip aren't something you'd ever store data in just for funsies, so ax is very generic by comparison (even if it does have some special uses for certain instructions).
I imagine that the special uses come from the need to reduce binary size back in the day. If you needed to specify "mul rax, rcx" instead of just "mul rcx" that's extra encoding which would add up over time. Nowadays not such a big deal, but at the time the instruction set was designed it would've been quite a big deal.
For what it's worth, in long mode you get 8 extra generic registers (r8-r15), and those really are generic if the OG generic registers aren't generic enough for your taste. 😉
Although the 80386 Programmer's Manual lists
eax
,ebx
,ecx
, andedx
as "general-purpose registers", you sometimes see them referred to as "accumulator", "base", "counter", and "data". Example: therep
instruction works oncx
orecx
as a loop counter and you don't have any choice in the matter. Not sure whether that's documented intent or folklore.More options
Context Copy link
More options
Context Copy link
Mine had more comments because people kept finding it via search =) Also, nepotism helps!
More options
Context Copy link
More options
Context Copy link