User:Tepples/mnemonic puns

From Pin Eight
Jump to: navigation, search

Some assembly language mnemonics look like something else.

ADC (MOS Technology 6502, ARM)
Looks like "analog to digital converter", but means "add with carry". In fact, it may be used to build a ramp-compare ADC using a comparator and time base, similar to the 555-based paddle reading circuit of 8-bit home computers, if the system provides an easy way to get the comparator's state into carry.
ASL (6502, Motorola 68000)
Looks like American Sign Language or "What are your age, sex, and location?", but means multiply a value by 2. "Add to self" is closer, because it's reportedly how left shifts are implemented inside the 6502, but it officially stands for "Arithmetic Shift Left".
BBC0 through BBC7 (WDC 65C02 with bit manipulation[notes 1])
Looks like British Broadcasting Corporation, but means branch if bit 0-7 of a value at a given address on zero page is cleared to 0. Some assemblers use BBR (reset as synonym for clear as in TRB) instead.
BBS0 through BBS7 (65C02 with bit manipulation)
Looks like "bulletin board system", but means branch if bit 0-7 of a value at a given address on zero page is set to 1.
BLT (6502)
Looks like a sandwich, but means "branch if less than". On the 6502 series, it's a synonym for the instruction BCC (branch if carry clear) that WDC made official when it published the 65816 datasheet.
BMI (6502, 68000)
Looks like body mass index or Broadcast Music Inc., but means "branch if most significant bit of previous result was true".
BRA (65C02, 68000)
Looks like an undergarment, but means "branch always" for a PC-relative jump.
CLI (6502)
Looks like command-line interface, but means clear the interrupt priority level to 0. (The 6502 has two priority levels: 0 for IRQ and 1 for NMI.)
COP (WDC 65816/65802)
Looks like a police officer, but means emulate a coprocessor that would otherwise hijack the data bus.
DEA (65816)
Looks like a U.S. government agency specializing in fighting the War on Some Drugs, but means subtract 1 from register A.
DEC (6502)
Looks like Digital Equipment Corporation, but means read an address, subtract 1, and write back the resulting value.
JAM (6502)
Looks like "jam" (fruit preserves) or NBA Jam or the "Jam It In" Internet meme (NSFW), but it's a rarely used synonym for any of the 6502's twelve halt opcodes.
LAX (6502)
Looks like an airport on the west coast of the U.S. or the opposite of phonologically tense, but means load a value into register A and copy it to register X.
LDR (ARM)
Looks like "long-distance relationship" but means copy a 32-bit value from memory to a register.
LES DI (Intel 8086)
Looks like Spanish for "I gave them" but means "load a far pointer into ES (segment part) and DI (offset part)". For example, LES DI,mi_direccion resembles the Spanish for "I gave them my address."
LINK (68000)
Looks like a character from the video game The Legend of Zelda, but means create a stack frame.
LUI (MIPS)
Looks like "lazy", "rent", or "him" depending on the language, but means load a 16-bit literal value multiplied by 0x10000.
MVP (65816)
Looks like most valuable player, but means a block copy in ascending order.
PEA (65816)
Looks like a vegetable, but means push an immediate 16-bit value on the stack.
PHB (65816)
Looks like "pointy-haired boss", but means push the data segment.
PHD (65816)
Looks like "doctor of philosophy", but means push the frame pointer.
PHK (65816)
Looks like a long-time FreeBSD maintainer, but means push the code segment.
PHP (6502)
Looks like PHP: Hypertext Preprocessor, Physicians Health Plan, or any of several other meanings, but means push the status flags to the stack.
SAX (6502)
Looks like the inventor of the saxophone, but means store the bitwise AND of the values in registers A and X to memory.
SAX (Hudson Soft HuC6280)
Also looks like Sax, but means swap the values in registers A and X.
SAY (HuC6280)
Looks like "say", but means swap the values in registers A and Y.
SEC (6502)
Looks like a U.S. stock market regulator or a collegiate athletic conference covering most of the former Confederacy, but means set the carry flag in preparation for a subtraction.
SED (6502, except 2A0x)
Looks like the Spanish word for "thirst" or a text transformation utility for UNIX shell scripts, but means enable binary-coded decimal arithmetic for addition and subtraction.
SEI (6502)
Looks like the Italian word for "six", but means set the interrupt priority level to 1, blocking IRQ but allowing NMI.
SEX (Motorola 6809)
Looks like sex or the the Latin word for "six", but means sign extension of a ones' or two's complement value from a narrow word length to a wider one. For example, on an 8-bit machine, it might copy bit 7 of a register to all other bits.
SEX (RCA 1802)
Also looks like sex, but means "set X" or "select index", designating which CPU register is used for indexing.
SMB3 (65C02 with bit manipulation)
Looks like Super Mario Bros. 3, but means read a zero page address, set bit 3 to true, and write back the resulting value. Roughly the same as LDA dd ORA #$08 STA dd.
STP (6502 (as unofficial opcode), late 65C02 revisions[1], 65816)
Looks like a gasoline additive or the band Stone Temple Pilots, but means halt until reset.
SWINE (ARM)
Looks like pigs but means perform a system call only if the last operation produced a nonzero result. This might be done, say, if a particular system provides division as a syscall[2] in order to avoid division by zero.
TAS (68000)
Looks like a tool-assisted speedrun, but means grab a mutex. The memory controller in the original Sega Genesis didn't implement this; two games rely on this instruction not working and will not work on compact revisions of the console made in 1998 and later that have "fixed" the bug.
TAS (65816)
Also looks like a tool-assisted speedrun, but means copy the accumulator to the stack pointer. Synonym of TCS.
TAX (6502)
Looks like theft of private wealth by a government, but means copy the value from register A to register X.
TDD (HuC6280)
Looks like teletypewriters used by deaf people, but means a block copy in descending order.
TIN (HuC6280)
Looks like the chemical element tin, but means a block copy in ascending order to an MMIO port at a constant address.
TSA (65816)
Looks like a U.S. government agency known for touching travelers' junk, but means copy the stack pointer to the accumulator. One might use this as part of a subroutine prolog or epilog to set up or tear down a stack frame. Synonym of TSC.

Notes

  1. The bit manipulation instructions associated with the HuC6280 originated in Rockwell and WDC versions of the 65C02. They are missing in some second-source brands of 65C02, such as the ones used in Apple IIc and enhanced Apple IIe computers. Sources contradict one another on which revision was called the "65SC02".

References

  1. Only the WDC 65C02 has WAI and STP instructions according to Graham & Magervalp's opcode matrix
  2. Section "BIOS Arithmetic Functions" of Martin Korth's GBATEK