There’s an old joke about two mathematicians in a cafe. They’re arguing about whether ordinary people understand basic mathematics. The first mathematician says yes, of course they do! And the second disagrees.
The second mathematician goes to the toilet, and the first calls over their blonde waitress. He says to her, "in a minute my friend is going to come back from the toilet, and I’m going to ask you a question. I want you to reply, “one third x cubed.'”
“One ther desque,” she repeats.
“One third x cubed,” the mathematician tries again.
“One thir dek scubed.”
“That’ll do,” he says, and she heads off. The second mathematician returns from the toilet and the first lays him a challenge. “I’ll prove it. I’ll call over that blonde waitress and ask her a simple integration question, and see if she can answer.” The second mathematician agrees, and they call her over.
“My friend and I have a question,” the first mathematician asks the waitress. “Do you know what is the integral of x squared?”
“One thir dek scubed,” she answers and the second mathematician is impressed and concedes the point.
And as she walks away, the waitress calls over her shoulder,
“Plus a constant.”
I would not consider integration to be basic maths, honestly. Basic maths is addition and multiplication, and maybe vector geometry.
You probably wouldn’t consider x86 opcodes to be basic computer literacy either ;-)
I mean I’m only missing int3
I think it is 0xCC, or in long form 0xCD03
I didn’t even know they released int2
You guys have int?
It’s one of my six dump stats.
Bro missing the wis gains
I rolled a 14, so I have a +2 modifier.
I’ve got intelligible but that’s about it
I’m missing the joke… would anyone be so kind to help me understand?
That’s a great website that I didn’t know existed, thanks for sharing!
The people in the picture are so used to working with assembly language, that even though they know the average person doesn’t know much about assembly, they assume the average person knows a little, which is already way more than the average person actually knows.
I speak fluent x86, I’ve been writing
xor eax, eax
beforerax
was a thing and you had to wonder whether you shouldn’t be usingxor rax, rax
(you shouldn’t), I figured out how to write linux binaries in pure assembly before arch was a thing, just don’t throw sse or something arcane likeaaa
at me. But damned if I know a single opcode.Reverse engineers are a whole different kind of breed. And apparently they hate rust.
NOPe
I mean who hasnt watched “Assembly Language in 100 seconds” by Fireship
Just looked this up and subscribed to the channel.
Is there any situation where you’d want to remember the opcodes? Disassemblers should give you user-friendly assembly code, without any need to look at the raw numbers. Maybe it’s useful to remember which instructions are pseudo instructions (so you know stuff like
jz
(jump if zero) being the same asje
(jump if equal) making it easier to understand the disassembly), but I don’t think you need to remember the opcode numbers for that.Edit: Maybe with malware analysis where the malware in question may be obfuscated in interesting ways to make the job of binary analysis harder?
The important thing is to be important. Engineering has to deal with teammates that don’t have these problems, so they equalize.
NOP is $EA, of course, and… um…
…sorry, I’m just a Commodore 64 scrub, I don’t know nothing about this high and mighty Intel 8086 nonsense.
[looking up]
…it’s 0x90 on IA-32? WHAT? Someone told me every processor used 0xEA because that was commonly agreed and readily apparent. …guess I was wrong
My daughter told me the other day, “I bet I could figure out a Commodore 64 if I had one.”
Good luck figuring out LOAD “*”,8,1 by yourself, kid.
With the ubiquity of C64 emulators, that’s easy enough to demonstrate by experiment
deleted by creator
deleted by creator
I can’t tell if you’re joking and deliberately invoking the original comic above
She meant she could figure it out just playing around with it, not reading a manual or asking around. I told her she’d have to read a manual.
Erm I might be showing my inexperience here.
Is there no equivalent to
man LOAD
in the commodore world? Or even justhelp
?That thing had 16K of ROM. Every byte was sacred. Only manual was on paper.
Not that I remember.
Someone told me every processor used 0xEA
Not sure if this is a riff on the joke or not.
Back in the day I dabbled in 6510 code, and up until today hadn’t even bothered to look at a chart of opcodes for any of its contemporaries. Today I learned that Z80 uses $00 for NOP.
Loth as I am to admit it, that actually makes sense. Maybe more sense than 65xx which acts more like a divide-by-zero has happened.
The rest of the opcode table was full of alien looking mnemonics though, and no undocumented single byte opcodes? Freaky, man.
But the point is that not even Z80 used $EA. If the someone was real they probably meant every 65xx processor.
*Lolth
What? This is system programming, not web development.
I was making a joke about their spelling error.
And I was making a joke about the D&D spider goddess.
But the word is “loath,” which has an accepted alternate spelling of “loth”. “Lolth” is the Dungeons and Dragons spider goddess, commonly worshiped by Drow.
Oh Christ, I can’t believe I missed that.
Operating on low sleep and responding before coffee.
I shall flog myself now
I thought NOP was 0x90. Edit: oh I just read the rest of the comment.
Alt text: “How could anyone consider themselves a well-rounded adult without a basic understanding of silicate geochemistry? Silicates are everywhere! It’s hard to throw a rock without throwing one!”
Silicates are everywhere! It’s hard to throw a rock without throwing one!
If that’s all that’s needed to consider yourself having a basic understanding, then I already had it by the time I passed HS.
Unfortunately, the Alt text doesn’t tell us the bar, so we can’t know how round we are.
As a bytecode tinkerer, I’d say considering NOP to be global knowledge is a slippery slope.
Might want a sled and a ROPe to have a smooth descent
Careful you aren’t thrown off by a retpoline
I’m pretty sure I’ve had this exact conversation. Took me a minute to understand what the point was.
NOP
0x90
there is an additional layer to this joke for those who understand turing completeness. And it elevates it to a whole other level of snark.
Are you implying that an assembly language consisting of just ret, int3 and jmp (and nop, of course) is turing-complete? …are you sure about that?
Bookmarking your comment so I can come back to it in a couple hours, if I hopefully remember to.
But yes, almost. I don’t think the interrupt is necessary and the return isn’t under certain architectures. I have a doc on my computer somewhere where I was investigating what the absolute minimum was to make a turning complete machine and, to my recollection, there was only 4-6 instructions that were absolutely necessary. The ones I remember off the top of my head are NAND, MOV, JUMPIF, and then I believe I included NOP in accordance with some principle. RET and INT were convenience features in this design.
Fun fact: apparently on x86 just MOV all by itself is Turing-complete, without even using it to produce self-modifying code (paper, C compiler).
The key here I think is the NAND. I know you can do practically anything with only NAND gates. But without it, and with just control structures, I don’t think there’s a way to perform computation unless there is some theoretical voodoo withcraft possible, something like nop-padded cellular automata given the infinite memory. But I don’t have any qualification to talk about this, I’m just some random dude who flunked out of the university but finished all Zachtronics games.
You’re remembering correctly, every other logic gate can be built from NAND gates, which is the foundation of this sort of minimal-instruction-set exercise. Beyond that, you need to be able to move data and change your program counter (jump, often conditionally). Then, if you want parity with modern instruction sets beyond just being turning complete, you need return and interrupt for control flow.
Alright this is my cue that I don’t belong here
lol why?
It’s insane how close that handwriting is to randall’s, did he make multiple versions of this comic or was this written by a professional forger?
There was that one comic that Randall did (Lorenz) where you could choose one of several paths and write your own text in the last panel. In order to implement that Randall had to create a font of his own handwriting. I wouldn’t be surprised if OP just ripped the .woff file or similar.
For context, here’s the original comic:
Holy shit. I remembered the original comic, but didn’t remember what the subject matter of it was. So if you hadn’t left this comment, I would have just gone on believing that the OP’s version was Randall’s version.
Yeah, I’ve seen people riff on xkcd comics before but they usually do a bad job of matching the handwriting/font (I don’t know if Randall hand-letters these or if he types in a handwritey font). It’s often a deliberately bad job, because indicating that they are changing the original is a part of the message/artistic expression. Like when a word is covered with a black bar with white letters in it in a different font, an obvious revision, it’s like hearing a different voice interrupt.
deleted by creator
Their format and style makes them highly meme-able.
Why does it not surprise me at all that this exists?
Wait, that’s actually a great font
Here’s the source:
And the alt text:
How could anyone consider themselves a well-rounded adult without a basic understanding of silicate geochemistry? Silicates are everywhere! It’s hard to throw a rock without throwing one!
“oh you laughed at that joke despite the fact that the bridge followed the falling action instead of preceding the punch word? Amateurs shouldn’t be allowed to watch comedy.”
Now I want to know what int3 does.
https://en.wikipedia.org/wiki/INT_(x86_instruction) (scroll down to INT3)
https://stackoverflow.com/a/61946177
The TL;DR is that it’s used by debuggers to set a breakpoint in code.
For example, if you’re familiar with gdb, one of the simplest ways to make code stop executing at a particular point in the code is to add a breakpoint there.
Gdb replaces the instruction at the breakpoint with 0xCC, which happens to be the opcode for INT 3 — generate interrupt 3. When the CPU encounters the instruction, it generates interrupt 3, following which the kernel’s interrupt handler sends a signal (SIGTRAP) to the debugger. Thus, the debugger will know it’s meant to start a debugging loop there.
Hey thank you!
Not what I thought it was for sure 😃
How does it work if an instruction gets replaced by the INT3 though?
Excellent question!
Before replacing the instruction with INT 3, the debugger keeps a note of what instruction was at that point in the code. When the CPU encounters INT 3, it hands control to the debugger.
When the debugging operations are done, the debugger replaces the INT 3 with the original instruction and makes the instruction pointer go back one step, thereby ensuring that the original instruction is executed.
Whoo that seems complicated, I mean you akready compile a debug version.
Thanks for the explanation!
The debug version you compile doesn’t affect the code; it just stores more information about symbols. The whole shtick about the debugger replacing instructions with INT3 still happens.
You can validate that the code isn’t affected yourself by running objdump on two binaries, one compiled with debug symbols and one without. Otherwise if you’re lazy (like me 😄):
https://stackoverflow.com/a/8676610
And for completeness: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Debugging-Options.html
Thanks, excellent information!
How come debug exes are bigger? Is the nifty stuff tucked on at the end?
You’re sixteen, you’re beautiful, I’m under arrest
I love that I’m getting downvoted for a Ringo Starr reference
what ? I’m nowhere near sixteen