I want to define a variable called asmtest in asm. I thought I could do this in a C block (for an 18F4455 PIC):
asm{
asmtest equ 0x00000006
// rest of the asm code
}
But I get a syntax error. Could you tell me what the proper syntax is please?
Cheers,
Bert
Define variable in asm
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Define variable in asm
Hello Bert
You can create a C variable and then call it in assembler by using an underscore in front of the variable name. Would that work?
char varname
asm{
movlw _varname
// rest of the asm code
}
You can create a C variable and then call it in assembler by using an underscore in front of the variable name. Would that work?
char varname
asm{
movlw _varname
// rest of the asm code
}
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Define variable in asm
Hello Ben,
Yes that does work prerfectly, but I would prefer to declare the variable in assembler. Is that possible?
Cheers,
Bert
Yes that does work prerfectly, but I would prefer to declare the variable in assembler. Is that possible?
Cheers,
Bert
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Define variable in asm
Hello Bert
Its probably possible but I dont know how to do it off the top of my head, I avoid assembler where ever possible . It may say how to do it in the BoostC manual available from the Flowcode V3/BoostC folder.
Its probably possible but I dont know how to do it off the top of my head, I avoid assembler where ever possible . It may say how to do it in the BoostC manual available from the Flowcode V3/BoostC folder.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel