Was trying to embed some AVR assembler code using the C box and placing “asm” in front of the mnemonics but when you generate the hex the compiler returns an error saying it doesn’t understand the assembler mnemonic .... even simple ones like CLC (clear carry) is not recognised.
Can anyone help ?
Avr ASM and Flowcode 8
Moderator: Benj
-
- Posts: 97
- Joined: Tue Jul 14, 2009 4:37 pm
- Has thanked: 13 times
- Been thanked: 9 times
- Contact:
-
- Valued Contributor
- Posts: 1188
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: Avr ASM and Flowcode 8
Try something like:
http://www.ethernut.de/en/documents/arm-inline-asm.html
Note that you MUST' have the "\n\t" (or possibly just "\n") - on each line except the last - so to add 'CLC' - as the last line add the "\n\t" to the final mov command line. This had me scratching my head for several minutes
Martin
and see:http://www.ethernut.de/en/documents/arm-inline-asm.html
Note that you MUST' have the "\n\t" (or possibly just "\n") - on each line except the last - so to add 'CLC' - as the last line add the "\n\t" to the final mov command line. This had me scratching my head for several minutes
Martin
-
- Posts: 97
- Joined: Tue Jul 14, 2009 4:37 pm
- Has thanked: 13 times
- Been thanked: 9 times
- Contact:
Re: Avr ASM and Flowcode 8
Thanks Martin,
Now thats something I would never had figured out on my own !!
Much appreciated !!
iain
Now thats something I would never had figured out on my own !!
Much appreciated !!
iain
-
- Valued Contributor
- Posts: 1188
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: Avr ASM and Flowcode 8
Just needing to get a little asm in for an ATTiny85 project - and I can't figure out how to define a label in FC.
Gives a
Any ideas?
Martin
Gives a
error message...C:\Users\mn_fi\AppData\Local\Temp/cc5Ko2yh.s: Assembler messages:
C:\Users\mn_fi\AppData\Local\Temp/cc5Ko2yh.s:564: Error: symbol `labl1' is already defined
Any ideas?
Martin
- 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: Avr ASM and Flowcode 8
Hi Martin,
The connection point icons create labels and gotos without using assembler. Assembler in AVR is very nasty unlike PICs and not something I've ever really delved into.
The connection point icons create labels and gotos without using assembler. Assembler in AVR is very nasty unlike PICs and not something I've ever really delved into.
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
-
- Valued Contributor
- Posts: 1188
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: Avr ASM and Flowcode 8
As an aside:
Having written a program with some asm either in the supplementary code or in a macro - looking at the .lst file and the code is 'replaced' by ...
For example:
FC8 seems to do this rather more aggressively than FC7 - and I've tried various levels of compiler optimisation and also inlining / not inlining the functions.
Martin
Having written a program with some asm either in the supplementary code or in a macro - looking at the .lst file and the code is 'replaced' by ...
For example:
The actual functions (declared inline or not) - are invisible (in FC7 and in FC8) - and I'm unable to verify that the correct code is being generated (or indeed any code?) Is there any way to get the complete assembly code listing? Note that the C listing does include the functions - but because the asm code is not expanded here I can't check that the code looks correct. Note that the address of the instructions (230, 24a) in this example look appropriate for the inline function being included?230: 28 9a sbi 0x05, 0 ; 5
...
24a: 28 98 cbi 0x05, 0 ; 5
...
FC8 seems to do this rather more aggressively than FC7 - and I've tried various levels of compiler optimisation and also inlining / not inlining the functions.
Martin