We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I use KeilC uVision4 for 89C51 MCU. By "Inline ASM", i can easily direct write value to R7 register, like this :
#pragma ASM MOV R7, #10 #pragma ENDASM
But now, there are some reason that i have to write to R7 register direct from C (not from inline ASM), eg:
R7 = 10;
Of course, the C compiler does not understand R7 as MCU Register (not Inline ASM).
-> Is there anyway to solve this problem. Please help me if anyone know, thanks a lot !
Actually, that's about the one thing that's not at issue!
We're talking about software delays - so wasting processor cycles is the object of the exercise!
The problem is that the proposed macro approach is so horribly cumbersome and error-prone - especially when doing it as an assembler module is so clean, simple, and easy!
to compensate for his register usage in the middle of it
Erik
I merely trying to convince the OP (without much success, I guess...!) of the cascade negative impact his design will have - include impairing other piece of software that are supposed to have "well-known behavior".
.. to tell a young truly modern person not to write unmaintainable code.
today, the typical shop has 5 testers for each programmer, so who gives an iota if code is good, if it fails, the teaters will catch it.
Always worth leaving the accidental on purpose error in to test whether the teaters are awake ;)