I want to avoid the use of inline assembler in my code so I was hoping to replace RLC A with _crol(). Will this work or is _crol_() implemented with RL A (no carry bit)? Thanks in advance.
See this thread: http://www.keil.com/forum/docs/thread7190.asp "When you write in 'C', you delegate responsibility for register usage to the compiler. You should not be trying to fiddle directly with ACC!" The same applies to the Carry Flag. You have absolutely no guarantee whatsoever how any other line of 'C' may or may not affect the carry flag - so you should not try to second-guess any undocumented feature of any function such as _crol_(). The operation of _crol_() is defined in the Manual: http://www.keil.com/support/man/docs/c51/c51__crol_.htm Beyond that, you have no guarantees
Thanks for your reply. I guess it's safest to re-code the lot. The joys of porting assembler to C!
"The joys of porting assembler to C!" Err... why not just leave it in assembler?!
Err... why not just leave it in assembler?! Usually the correct response. However, I have ported a few (only a few) assembler modules to C for 2 reasons a) a major addition where porting what was and coding the addition in C would be less time consuming than adding in assembler and b) this would not be 'porting' but 'recoding' an inherited assembler module that would make any italian chef very proud. Erik