C Code (asm)

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

Moderator: Benj

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

C Code (asm)

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

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

Re: C Code (asm)

Post 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

Post Reply