Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/05/06 10:55
Read: times


 
#121691 - Getting result of inline asm with Keil
Hi,

I have written an asm program to analyse the baudrate of the input signal. It measures the low and high level time. The result of the inline asm routine is stored in R6 and R7.
The is some code of the function :
unsigned short MeasurePeriodTime(void)
{
	// configure timer 1
	TMOD &= 0x0F;
	TMOD |= 0x10;
	TAMOD &= 0xEF;
#pragma asm
$REGUSE MeasurePeriodTime(R0,R1,R2,R6,R7)
	CLR		EA				
.....
.....
	MOV  	A,TL1
	XCH	A,R7
	MOV  	R6,A
TimerOverflow:
	CLR 	TR1
	CLR	TF1
	SETB	EA
#pragma endasm
}


Now I get a warning if I compile the program. The compiler gives this warning: C173: missing return-expression
How can I fix the problem that R6 and R7 are recognized as result of this C function? I looked already on the keil site, but they had a solution that I can't use for my code (with input variables).
I want to keep the asm code in the C-routine, because I may need to add some c code afterwards.
I hope you can help. Thanks in advance.

Kind regards,
Mark

List of 7 messages in thread
TopicAuthorDate
Getting result of inline asm with Keil            01/01/70 00:00      
   Return value from an auto            01/01/70 00:00      
   Do not fight you tools            01/01/70 00:00      
      Adding some C code afterwards            01/01/70 00:00      
         That will be another post            01/01/70 00:00      
      The asm routines in a a51 file            01/01/70 00:00      
   mixing            01/01/70 00:00      

Back to Subject List