this post was submitted on 15 May 2025
187 points (95.6% liked)
Programmer Humor
35791 readers
76 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Only because 6502 has no BIT immediate -- only BIT zero page and BIT absolute. But the contemporary z80 and gameboy cpu too have dedicated bit instructions, e.g. BIT c,6 (set z flag to bit 6 of register c).
I think it's intended for checking the same bit in multiple bytes. You load the mask instead of the data.
So much 6502 ASM involves turning your brain inside-out... despite being simple, clever, and friendly. Like how you can't do a strided array sensibly because there's no address register(s). There is no "next byte." Naively, you want separate varied data at the same index is separate arrays. Buuut because each read address is absolute, you can do *(&array+1)[n], for free.
What I really miss on NES versus Game Boy is SWAP.