Hi, below is the code snippet I am using to try out calling as asm func from a C module. What happens is the asmtest func occupies memory location 0000h and C startup code is unable to execute correctly. How can I relocate the asm func to some other location ? ; in asm file asmtest: MOV A, #64 MOV R0,#16 INC A RET END ----------------------- // in C module #include <reg52.h> extern void asmtest(void); void main() { char i = 2; asmtest(); } -----------------------
The i++ is not executed. When control is supposed to return back to that statement, I get NOP. Meanwhile the c2asm2c sample seems to be in an infinite loop, wherein the main() keeps repeating. after the calls from C to asm & asm to C are over. J
Hmmm, It works correctly on my compiler. It even executes the i++. I'm using the V7.06a tools with the uVision2 debugger. Jon