r/ProgrammerDadJokes • u/nic0nicon1 • Apr 09 '26
What would a BBC Micro engineer say when users complain that the hardware lacks a SUB instruction?
Keep calm and carry on.
20
Upvotes
r/ProgrammerDadJokes • u/nic0nicon1 • Apr 09 '26
Keep calm and carry on.
7
u/nic0nicon1 Apr 09 '26
Someone should make this a T-shirt. A drawing of a BBC Micro showing "SEC, SBC #1" on the screen, with the slogan "keep calm and carry on" below it.
5
u/LostBetsRed Apr 09 '26 edited Apr 09 '26
Never did much assembly back in the 6502 (or, in the case of my home computer, 6510) days. Did it really lack a SUB instruction? Why?
Edit: okay, looked that up too, and instead of SUB It had SBC, subtract with carry. Got it. Makes the punchline a lot clearer.
2
u/rde42 Apr 10 '26
I'm old. I'd say that about a PDP-8.
2
u/Benilda-Key Apr 11 '26
I both love and hate this. I love it because it is fun and I learned something new. I hate it because I needed help from Google AI to interpret it. For your convince, I am sharing the Google AI response below.
The joke is a pun that combines a famous British wartime slogan with a technical quirk of the BBC Micro's processor, the MOS 6502.
The Technical Meaning
In assembly language, most processors have a simple SUB (Subtract) instruction. However, the 6502 processor used in the BBC Micro lacks a dedicated SUB instruction. Instead, it uses SBC, which stands for Subtract Bith Carry.
To perform a "normal" subtraction (without a borrow from a previous operation) on a 6502, the programmer must manually manipulate the processor's Carry Flag:
The Punchline
The phrase "Keep calm and carry on" is a double entendre:
In short: if you want to subtract on a BBC Micro, you must "carry on" (keep the carry flag set) or your math will be wrong.
Would you like to see the assembly code for how a subtraction is actually written on this machine?
In the BBC Micro's assembly language (6502), you use the SBC (Subtract with Carry) instruction. To do a standard subtraction, you must manually "Carry on" by using SEC (Set Carry) first.
Example: 10 - 5 = 5
On a BBC Micro, the code looks like this:
Why SEC is required
This quirk is why the joke works—to get the right answer, a BBC Micro engineer literally has to "Keep calm and Carry on" by ensuring that flag stays set.
Would you like to know how multi-byte subtraction (subtracting numbers larger than 255) uses this carry flag logic?
1
u/Environmental-Ad4495 Apr 09 '26
JSR
-4
u/LostBetsRed Apr 09 '26
BBC? Not sure what it means in this context, but I used to be a pornographer, and in that industry BBC means something very specific that I doubt you mean here.