Hi,
I am having problems calling a macro from within asm. The help file says to call _FCM_MACRO() but the compiler doesn't like it.
asm
{
call _FCM_MACRO()
}
Any ideas on what I'm doing wrong please? (the name MACRO is just an example).
Thanks,
Dave.
calling a macro from assembler
Moderator: Benj
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: calling a macro from assembler
Hi Dave. After a bit of experimentation the syntax seems to be:
This is case sensitive (the macro was created lower case) and does not have closing brackets. I am not familiar with PIC assembly but Im assuming you will have to push each argument you need first. You can view the C code and cut-paste the exact definition from there.
Out of curiosity, may I as what you are doing to require calling a macro from assembly?
Cheers,
Jonny
Code: Select all
asm
{
call FCM_macro
}
Out of curiosity, may I as what you are doing to require calling a macro from assembly?
Cheers,
Jonny
Re: calling a macro from assembler
Hi Jonny,
Thanks for that, I'll try it first thing in the morning. (Doesn't agree with the help file though!)
I've written a routine in assembler which receives data from a transmitter and I want to output the data via RS232 to check it has been received correctly using the flowcode macro.
I'll let you know how it goes.
Thanks again,
Dave.
Thanks for that, I'll try it first thing in the morning. (Doesn't agree with the help file though!)
I've written a routine in assembler which receives data from a transmitter and I want to output the data via RS232 to check it has been received correctly using the flowcode macro.
I'll let you know how it goes.
Thanks again,
Dave.
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: calling a macro from assembler
Yeah - different C compilers have slightly different ASM syntax. It may have been that the help file documented a way to do it with one compiler which differed from another, or that the compiler documented used to behave like that but doesnt any more. We will hopefully try to make things like this clear in the future.
Its always difficult with ASM to pinpoint exact syntax as it varies so much from chip to chip and compiler to compiler. Thats why I was suprised that you were calling Flowcode macros from ASM, as it will be difficult to port, but thats the only reason really and there is no reason why you shouldnt be able to do this.
Good luck with the code,
Jonny
Its always difficult with ASM to pinpoint exact syntax as it varies so much from chip to chip and compiler to compiler. Thats why I was suprised that you were calling Flowcode macros from ASM, as it will be difficult to port, but thats the only reason really and there is no reason why you shouldnt be able to do this.
Good luck with the code,
Jonny
Re: calling a macro from assembler
Hi Jonny,
Your syntax works fine, thanks again.
I'm not sure what you meant by "I am not familiar with PIC assembly but Im assuming you will have to push each argument you need first. You can view the C code and cut-paste the exact definition from there"
The line "call FCM_macro" can be inserted into the assembler and works as is.
Porting will not be a problem, I just want to output RS232 for debug purposes.
Dave.
Your syntax works fine, thanks again.
I'm not sure what you meant by "I am not familiar with PIC assembly but Im assuming you will have to push each argument you need first. You can view the C code and cut-paste the exact definition from there"
The line "call FCM_macro" can be inserted into the assembler and works as is.
Porting will not be a problem, I just want to output RS232 for debug purposes.
Dave.
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: calling a macro from assembler
Dont worry about it - I meant if you were calling a macro with multiple arguments, or using a different macro name, which youre not. Glad it all works OK.I'm not sure what you meant by "I am not familiar with PIC assembly but Im assuming you will have to push each argument you need first. You can view the C code and cut-paste the exact definition from there"
Jonny