2 ms·
Why would you have to load 0 into memory somewhere (other than in the instruction itself)? Or did you mean that it is in fact in the instruction?
by AnimalMuppet 4y ago
Why would you have to load 0 into memory somewhere (other than in the instruction itself)? Or did you mean that it is in fact in the instruction?
- bombcar 4y agoBecause you’d either need a special “always zero” register (some chips have this), or a menomic for some or all of the instructions that assume zero as an operable (some chips have this), or wipe a register (this is the problem here - uses a register) or use memory. Adding an implicit zero may make sense for some instructions but probably not all.
- AnimalMuppet 4y agoLook at the format of the 68000's MOVEQ instruction. The zero is part of the instruction, and does not take an extra four bytes to hold it. There's no memory that's used (other than the instruction itself), no extra memory to hold the argument, and no "always zero" register. MOVEQ can move more than a zero. It can move any small number (-128 to 127), so 0 is not "special" here. Also check out the CLR instruction (though that may be what you meant by "a mnemonic for some or all of the instructions that assume zero").