3 ms·
You have a register dedicated to zero?
by mcguire 11y ago
You have a register dedicated to zero?
- robertelder 11y agoYes, I also have a register dedicated to the word size (4). Since these values are used so commonly, I felt that it didn't make sense to constantly have to load them manually. You'll also notice that there is no move instruction. With the existence of the zero register, move becomes unnecessary because you can just do add r1 ZR r2; Moves the contents of register r2 into r1. There are a number of other similar situations where it makes sense to have zero handy all the time.
- shoover 11y ago"Changing the value in the zero register is not recommended." Hee hee.
- robertelder 11y ago:p
- tptacek 11y agoNot uncommon in real architectures, either by convention (ARM r0) or design (the MSP430 CG, which, like this architecture, also generates other useful constants).