Avr ASM and Flowcode 8

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

Moderator: Benj

iain wilkie
Posts: 89
Joined: Tue Jul 14, 2009 4:37 pm
Has thanked: 10 times
Been thanked: 8 times
Contact:

Avr ASM and Flowcode 8

Postby iain wilkie » Sat Jan 05, 2019 9:15 pm

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: 559
Joined: Wed May 31, 2017 11:57 am
Has thanked: 54 times
Been thanked: 314 times
Contact:

Re: Avr ASM and Flowcode 8

Postby mnf » Sun Jan 06, 2019 11:49 am

Try something like:
asm.JPG
asm.JPG (9.64 KiB) Viewed 795 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
These users thanked the author mnf for the post (total 4):
kersing (Sun Jan 06, 2019 6:57 pm) • iain wilkie (Sun Jan 06, 2019 8:04 pm) • medelec35 (Mon Jan 07, 2019 6:40 am) • Benj (Fri Jan 11, 2019 4:58 pm)
Rating: 21.05%
 

iain wilkie
Posts: 89
Joined: Tue Jul 14, 2009 4:37 pm
Has thanked: 10 times
Been thanked: 8 times
Contact:

Re: Avr ASM and Flowcode 8

Postby iain wilkie » Sun Jan 06, 2019 8:05 pm

Thanks Martin,

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

Much appreciated !!

iain

mnf
Valued Contributor
Valued Contributor
Posts: 559
Joined: Wed May 31, 2017 11:57 am
Has thanked: 54 times
Been thanked: 314 times
Contact:

Re: Avr ASM and Flowcode 8

Postby mnf » Wed Oct 16, 2019 12:48 pm

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 285 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: 14370
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4145 times
Contact:

Re: Avr ASM and Flowcode 8

Postby Benj » Wed Oct 16, 2019 4:53 pm

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: 559
Joined: Wed May 31, 2017 11:57 am
Has thanked: 54 times
Been thanked: 314 times
Contact:

Re: Avr ASM and Flowcode 8

Postby mnf » Wed Oct 16, 2019 5:02 pm

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