Avr ASM and Flowcode 8

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
iain wilkie
Posts: 94
Joined: Tue Jul 14, 2009 4:37 pm
Contact:

Avr ASM and Flowcode 8

Post 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 ?

mnf
Valued Contributor
Valued Contributor
Posts: 723
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: Avr ASM and Flowcode 8

Post by mnf »

Try something like:
asm.JPG
asm.JPG (9.64 KiB) Viewed 1285 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

iain wilkie
Posts: 94
Joined: Tue Jul 14, 2009 4:37 pm
Contact:

Re: Avr ASM and Flowcode 8

Post by iain wilkie »

Thanks Martin,

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

Much appreciated !!

iain

mnf
Valued Contributor
Valued Contributor
Posts: 723
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: Avr ASM and Flowcode 8

Post 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 775 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

User avatar
Benj
Matrix Staff
Posts: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: Avr ASM and Flowcode 8

Post 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.

mnf
Valued Contributor
Valued Contributor
Posts: 723
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: Avr ASM and Flowcode 8

Post 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

Post Reply