hi, I'm writting code (8051) that has both C and assambly in the same file. for example: void main() { long temp; #pragma asm mov a, #0; //assambly #pragma endasm temp = a*1000; //C } problems: 1. a (acc) is not recognizable in the C part.what is the BEST thing to do? 2. if I'll continue this proram and add another asm part will the last value of a,for example zero, and other reg/ptr will be saved?
Also consider writing anything that has to be very tight in assembler, then link it to the 'c' routines. This is easy to do. The manual contains examples of 'c' calling asm and asm calling 'c'. In our projects this has proved much easier to maintain and debug.