The F register unused bits
I'm doing some reading and trying to organize my Spectrum ML apprenticeship and while looking in greater detail at the flag register one question popped.
Can I manipulate this register directly or make use of bits 3 and 5 indirectly? From all I can see from the instructions set, I can't. But those two unused bits surely look very tempting...
Can I manipulate this register directly or make use of bits 3 and 5 indirectly? From all I can see from the instructions set, I can't. But those two unused bits surely look very tempting...
Post edited by rahtgaz on
Comments
Patrik
Edit: I understand I can test this myself :) I just don't have the means right now but am curious still...
EDIT 2: Nevermind. You answered this already. My apologies. Those bits get reset. A shame though.
Thank you :)
Looks like they replaced the page, and the link should now point here:
http://www.myquest.nl/z80undocumented/
PD: fixed in the wiki
If I could give you some advice Rahtgaz, if you have just started to learn Z80 assmebler, don't learn about unused bits (which are however sometimes changed in complicated and indirect way), undocumented instructions and other esoteric stuff. You won't need it now IMHO. Z80 has a lot of registers to store your data (not like 6502 used in Commodore ;-))
The most useful flags in F registers are carry and zero flag (maybe parity also can be useful). I never used any other of them.
You know, it's not being an easy task as I thought it would. I have used assembly before as a support for C and C++ programming. Although quite different naturally in form and meaning, it still spills over and confuses my mind. I often think the worst knowledge is some knowledge. It gets in the way when trying to learn something new, it makes you skip important information you would otherwise be willing to read through and it makes exceedingly hard the task of organizing your apprenticeship. A blank mind on the other hand is much better.
Trying to blank my mind of any preconceived ideas and start from a clean slate is what I should do. But... not easy.