This article from Keil's support knowledge database shows that one can directly write to ACC from C51 code. http://www.keil.com/support/docs/1619.htm I would like to know if there are any rules when writing to ACC from C code. I have noticed that the following line in my code was entirely commented out when I chose Code Optimization Level-9.
unsigned char data uDataIndex, uDataArray[5]; void main() { . . ACC=uDataArray[uDataIndex%5]; . }
"a get_parity function" I wrote my parity() function in assembler precisely to avoid any possible doubt about what the compiler might get up to... ;-)
I use the following to get the parity after loading the accumulator.
// Disable Interrupts parity = (ACC=0x12,P); // Restore Interrupts