Page 1 of 1

C Code (asm)

Posted: Thu Apr 18, 2019 4:24 pm
by Neon27
Hi there,

In previous versions of Flowcode, I used to be able to insert assembly code (asm) into my program via the 'C Code' component.
I used to do this as a workaround to the odd bug in Flowcode, or to ensure registers are set up correctly.
I would drop in the 'C Code' component, then enter my code as follows:

asm{
CLRF PORTG
BCF CM1CON, CON
CLRF LATG
BANKSEL ANCON2
MOVWF ANCON2
BANKSEL TRISG
MOVLW 0x04
MOVWF TRISG
}

Unfortunately, after switching to Flowcode 7, I've been really struggling with using the 'asm' command; when I compile I always get an error message - I've attached an image of a typical message.

Is there a way to get this feature to work again?

Re: C Code (asm)

Posted: Thu Apr 18, 2019 4:50 pm
by Benj
Maybe try this instead.

Code: Select all

#asm
CLRF PORTG
BCF CM1CON, CON
CLRF LATG
BANKSEL ANCON2
MOVWF ANCON2
BANKSEL TRISG
MOVLW 0x04
MOVWF TRISG
#endasm