This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

calling subroutines from ISR

Hi,

I'm a newbie.

I've got some legacy code where I need to add some features. From the ISR routines I need to call some C functions. ISR is made up with assembly macros, the caller routine that uses the macro uses register bank 3. My functions takes 1 argument and doesn't return anything.
I found from manual that I need to pass argument to R7. So I have this in the ISR macro

mov r7, port
lcall _HandleRxUartInt

While declaring HandleRxUartInt I didn't specify any specific regiter bank to use.

RSEG  ?PR?_HandleRxUartInt?TIMER
	USING	0
_HandleRxUartInt:
;---- Variable 'port?244' assigned to Register 'R5' ----
	MOV  	R5,AR7

I find that the argument is not going to the function correctly. If I hardcode the argument value then the function works as expected. Any hints\docs pointing to properly declare\call the functions from assembly macros? Thanks, Hasan