C Code (asm)

A forum where Flowcode v7 user created components can be shared, discussed and reviewed.

Moderator: Benj

Neon27
Posts: 6
Joined: Mon Aug 02, 2010 9:18 pm
Has thanked: 1 time
Been thanked: 2 times
Contact:

C Code (asm)

Postby Neon27 » Thu Apr 18, 2019 4:24 pm

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?
Attachments
002.jpg
002.jpg (51.5 KiB) Viewed 278 times
001.jpg
001.jpg (30.04 KiB) Viewed 278 times

User avatar
Benj
Matrix Staff
Posts: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: C Code (asm)

Postby Benj » Thu Apr 18, 2019 4:50 pm

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