118
votes
Accepted
Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?
One use is as a copyright mechanism. Many distributors would steal/copy programs and sell pirate or derivative copies, by changing the text strings inside the code and reordering the blocks, it was ...
85
votes
Could you reverse engineer silicon just by looking at it?
With a powerful enough microscope, you can see each transistor. Reverse-engineering silicon then boils down to carefully removing each layer (ceramic or plastic to expose the chip, then each metal ...
71
votes
Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?
The NES was also from the era where some sound and graphics resources were also executable code. (Typically, this worked the other way around. Identify a needed sound and listen to chunks of the ...
59
votes
Why were there no 32-bit versions of 65xx CPUs, or 64-bit versions of m68k CPUs?
The premise in the question is incorrect. There were such chips. The question also fails to allow for the way that the silicon-chip industry developed.
Moore's Law basically said that every 18 months, ...
58
votes
What languages are better fit for generating efficient code for 8-bit CPU's than C?
One language that was popular on early 8-bit micros, including those that used the 6502 CPU, was Forth. Forth is exceptionally good for this use case, and superior to a C compiler, because Forth can ...
54
votes
Accepted
Why does the 6502 have the BIT instruction?
Early MOS documentation (KIM-1 Programming Manual, Synertek SY6500/MCS6500 Microcomputer Programming manual, etc) states:
The BIT instruction actually combines two instructions from
the PDP-11 ...
53
votes
Could you reverse engineer silicon just by looking at it?
(More of a memory dump related to Stephen's answer)
At a time when ICs were of low complexity (compared today), could you actually see each transistor on the silicon and reverse engineer it?
Yes.
...
52
votes
Why did so many early microcomputers use the MOS 6502 and variants?
First, for Commodore's part, it should be obvious the reason for choosing the 6502 microprocessor for all their 8-bit machines (notwithstanding the dual-processor SuperPet and C128) - Commodore owned ...
52
votes
Accepted
Why are old CPUs like MOS Technology 6502 and Motorola 68000 considered better for real time systems applications than modern x86 based CPUs?
On a typical 6502, Z80, or 68000 system, it's possible to predict very precisely exactly how long a piece of code will take to execute. The same is true, incidentally, of many small microcontrollers ...
50
votes
Accepted
Why are different emulators needed to run platforms that use 6502 assembly code?
The 6502 CPU is just one piece of the puzzle
Emulators emulate entire machines, not merely CPUs. Even the likes of QEMU emulate an entire generic computer.
It helps if you think of the Apple II and ...
49
votes
Accepted
Did anyone ever run out of stack space on the 6502?
Unlike its main rival the Z80, the 6502 had a size limit of 256 bytes for the hardware stack.
The 6502 stack is mainly meant as a return stack and for register preservation - which usually isn't a ...
48
votes
What happened to the SEV instruction on the 6502?
Setting and clearing carry, the decimal or interrupt flags is useful:
the carry flag because the 6502 offers only add and subtract with carry;
the decimal flag because it changes the mode of the ...
47
votes
Accepted
Why did Sinclair choose the Z80 for its range of home computers?
Sinclair didn't always use the Z80 for its computers. The MK14 computer, sold in kit form (like the ZX80 was), used a National Semiconductor INS8060.
The ZX range of home computers have a video ...
46
votes
Accepted
How slow was the 6502 BASIC compared to Assembly
Yes, BASIC is much slower than assembly for many operations. For an
easy example, try out this program on a Commodore 64 or emulator:
for i = 1024 to 1984 : poke i,peek(i) or 128 : next
You will see ...
45
votes
How did Elite do vertex transformation?
Like all games from that era, cheating and tables.
Two 256 byte tables and logarithms gave a 10x speed boost on multiply and divide on Commodore 64 at least.
Matrix operations using addition only for ...
43
votes
Accepted
Comparing raw performance of the Z80 and the 6502
Both processors are cacheless. So the process is fetch instruction, decode instruction, execute instruction, forget what you saw. That provides a first line of comparison.
The Z80's fastest memory ...
42
votes
Accepted
What is the purpose of mirrored memory regions in NES's CPU memory map?
It is not intentionally mirrored, it is just a side effect of making the address decoding hardware for RAM as simple and cheap as possible with a single common 74LS139 chip used for the task, when an ...
40
votes
Why does the 6502 have the BIT instruction?
I'm having a hard time picturing a use for this [BIT]
It's mainly an I/O issue.
The 6502 is in many ways designed especially for control/embedded applications and BIT is a part of this. 6500 specific ...
39
votes
Accepted
What is the relative code density of 8-bit microprocessors?
An instruction set can be considered as a Huffman coding of an idealised instruction stream. So the question is really asking which CPUs have a good balance of short encodings for common tasks to ...
38
votes
Was leaving all xxxxxx11 opcodes unused on the 6502 a deliberate design choice?
The instruction decode is quite simple on the 6502.
If we call the bits in the opcode byte aaabbbcc, then one of the first things that happens is that cc, the two bits you're talking about, gets ...
37
votes
Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?
A mistake?
The instruction $89 on the 6502 is a two-byte NOP. Based on adjacent instructions in the opcode matrix, especially LDA #ii ($A9 ii), it would have been STA #ii, a store to an immediate ...
37
votes
Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?
I'm just speculating here, but one possible reason for using a 2-byte NOP would be if you wanted to change an existing 2-byte instruction into a NOP (to fix a bug, for instance), without changing the ...
35
votes
Accepted
What does "jmp *" mean in 6502 assembly?
MADS uses * in three ways (See MADS "Manual")
Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to.
Multiplying in expressions.
Mark the ...
34
votes
Why are branches relative in many 8-bit CPUs?
TL;DR:
It is all about making one of the most important instructions as performant as possible, while keeping everything manageable for tools at the time (plus a little bit of dogma). The branching is ...
34
votes
Accepted
Why didn't the 6502 have increment/decrement opcodes for A?
The designers figured that you'd use X and Y for looping, indexing etc, and use A for adding and subtracting, shifts etc. So they saw a need for INX and INY, but didn't see a enough of a need for an ...
33
votes
Late 1970s and 6502 chip facilities for operating systems
The simple answer is that early operating systems for the systems you mention did not provide those features.
Apple DOS, for example, makes no use of interrupts, and has no concept of processes or ...
32
votes
Why are different emulators needed to run platforms that use 6502 assembly code?
There are many answers to this and none might satisfy you.
First of all, an emulator doesn't just do a CPU, but a machine. The same way you can't run an NES game on an Apple II. So while one emulator ...
32
votes
Could you reverse engineer silicon just by looking at it?
It's worth noting what you can see, and what you can't.
First, you cannot see any feature that is much smaller than the wavelength of light that you are using. In 1995 I designed a chip for my Master'...
31
votes
Why does 6502 indexed LDA take an extra cycle at page boundaries?
The 6502 had 16-bit addressing but only an 8-bit adder. For an indexed load or store, the index register had to be added to the base address in two steps. As an optimization, the 6502 will load from ...
31
votes
Accepted
Can the two CPUs in a Commodore 128 run at the same time?
No, they cannot.
They share both the data and the address bus of the C128, so they can only run exclusively at any one point in time.
The address bus is apparently directly connected, the data bus ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
6502 × 171assembly × 38
commodore-64 × 20
z80 × 14
apple-ii × 13
programming × 11
instruction-set × 10
hardware × 9
interrupt × 7
cc65 × 7
history × 6
nes × 6
microprocessor × 6
basic × 5
memory-layout × 5
design-choices × 5
memory × 4
commodore × 4
cpu × 4
nintendo × 4
binary-coded-decimal × 4
65c02 × 4
emulation × 3
8080 × 3
atari × 3