Page 1 of 1

Avr ASM and Flowcode 8

Posted: Sat Jan 05, 2019 9:15 pm
by iain wilkie
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 ?

Re: Avr ASM and Flowcode 8

Posted: Sun Jan 06, 2019 11:49 am
by mnf
Try something like:
asm.JPG
asm.JPG (9.64 KiB) Viewed 4928 times
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

Re: Avr ASM and Flowcode 8

Posted: Sun Jan 06, 2019 8:05 pm
by iain wilkie
Thanks Martin,

Now thats something I would never had figured out on my own !!

Much appreciated !!

iain

Re: Avr ASM and Flowcode 8

Posted: Wed Oct 16, 2019 12:48 pm
by mnf
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.
label.JPG
label.JPG (9.23 KiB) Viewed 4418 times
Gives a
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
error message...

Any ideas?

Martin

Re: Avr ASM and Flowcode 8

Posted: Wed Oct 16, 2019 4:53 pm
by Benj
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.

Re: Avr ASM and Flowcode 8

Posted: Wed Oct 16, 2019 5:02 pm
by mnf
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:
230: 28 9a sbi 0x05, 0 ; 5
...
24a: 28 98 cbi 0x05, 0 ; 5
...
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?

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