Questions tagged [instruction-set]
For questions regarding the instruction sets of microprocessors.
78
questions
6
votes
2
answers
1k
views
What’s the last x86 CPU that didn’t place a limit on the size of a single instruction?
Although useless, it’s widely known the first Intel and derivative CPUs like the Z80 didn’t set a limit on the instruction size. This means that it was possible to fill the whole RAM/ROM with a single ...
1
vote
3
answers
1k
views
How do multi-byte instructions work?
Let's say you have a hypothetical 8-bit processing machine with 256 bytes of memory. You want to load the value stored in memory location $f2 into a register.
However, with a data bus of just 8 bits, ...
5
votes
1
answer
936
views
6502 - AND instruction updates flags differently than other logic operations
Why AND instruction updates flags in the fetch step?
Others logic instructions like ORA and EOR update flags in the same step that they update accumulator, in the decode step.
Is it a bug of ...
16
votes
1
answer
2k
views
What are the "ports" used via IN/OUT, vs. the PEEK/POKE address space?
This is something of a followup to How much control of TRS-80 Model III disk drives was possible from its Cassette (ROM) BASIC? but on a more general topic:
I know that PEEK and POKE enable direct ...
19
votes
1
answer
4k
views
How did the 6502 ALU perform a decrement?
Assuming that this diagram is correct:
Instructions like INC, INX, and INY can easily perform increment using ALU sum with data on B input, 0 on A input and carry_in set.
But how do instructions like ...
25
votes
1
answer
969
views
Reconstruct the loop from "The Story of Mel"
From Ed Nather's hacker-epic "The Story of Mel" (using the original paragraph-formatting to save space in this question):
The firm manufactured the LGP-30, a small, cheap (by the standards ...
17
votes
5
answers
2k
views
Has there ever been a instruction set architecture that did not require instruction decoding at all?
I am studying basic principles of instruction set architectures and am considering what it would take to not have any instruction decoding at all. I.e., all the control lines of the computer would be ...
88
votes
9
answers
16k
views
Why is the processor instruction called "move", not "copy"?
Many processors have an instruction called "move" (sometimes spelled MOV) which copies data from one location (the "source") to another (the "destination") in registers and/or memory. It does not do ...
24
votes
4
answers
4k
views
Why are branches relative in many 8-bit CPUs?
I was looking over an old article on the 6809 and was perusing the opcodes and noticed that the branch instructions came in two flavors, long and short. That sparked a memory about one of the 6502-...
47
votes
3
answers
6k
views
What happened to the SEV instruction on the 6502?
The 6502 has a group of opcodes which copy bit 5 from the opcode into one of the status flags.
(I know it's not implemented this way, but it looks as though the bit fields are: 2 bits to select the ...
5
votes
3
answers
519
views
In what way does the Straight-8 expand on the PDP-5?
A quote from the Wikipedia:
The PDP-5's instruction set was later expanded in its successor, the PDP-8, to handle more bit rotations and to increase the maximum memory size from 4K words to 32K ...
9
votes
1
answer
782
views
SYNC and the 65CE02 instruction timing
From the Wikipedia's 65CE02 page:
Internally, the pipeline of the 65CE02 was redesigned to reduce the
number of cycles required to execute an instruction. The 65CE02 can
recover faster from ...
11
votes
3
answers
4k
views
Behavior of the zero and negative/sign flags on classic instruction sets
It seems to me that there's effectively two ways that the zero bit could work.
Z is set iff the result of a computation is mathematically equal to 0.
Z is set iff a bit pattern consisting entirely of ...
52
votes
4
answers
12k
views
What did the 8086 (and 8088) do upon encountering an illegal instruction?
Preface: This question does in part intersect with Use of undocumented opcodes, but targets especially the 8086 instruction handling.
I was reading Tanenbaum's "Operating Systems, Design and ...
47
votes
6
answers
13k
views
Why does the 6502 have the BIT instruction?
The 6502 has a bit instruction which
copies two of the bits into the N and V flags,
pretends to and the byte with the accumulator, but discards the result and only affects Z.
I'm having a hard time ...