C-Code error using asm

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

Moderators: Benj, Mods

Post Reply
jgriffin
Posts: 22
Joined: Sat Jan 07, 2006 6:47 pm
Location: USA
Contact:

C-Code error using asm

Post by jgriffin »

I am attempting to use Flowcode (V3/PIC 16F877A) to demonstrate assembly language commands in a single C-Code block between BEGIN and END.

The C-Code block contains the following:

asm
{
bsf 3,5
movlw 000
mowf 0x85
bcf 3,5
movlw 0x00f
mowf 005
}

However, I get the following errors:

C:\Temp\Flowcode1.c(84): error: error in built-in assembly
C:\Temp\Flowcode1.c(86): error: error in built-in assembly
C:\Temp\Flowcode1.c(87): error: error in built-in assembly
C:\Temp\Flowcode1.c(89): error: error in built-in assembly

Could you tell me what I am leaving out?

Thanks,

Jack

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: C-Code error using asm

Post by Sean »

Hello Jack,

The assembler does not allow direct addressing of registers. The special function registers have pre-defined labels (_status etc.) so your asm code should look like this:

asm
{
bsf _status,5
movlw 0
movwf _porta
bcf _status,5
movlw 0x0f
movwf _trisa
}

Also the mowf command should be movwf.

jgriffin
Posts: 22
Joined: Sat Jan 07, 2006 6:47 pm
Location: USA
Contact:

Re: C-Code error using asm

Post by jgriffin »

Sean,

Got it. Thanks a million.

Jack

Post Reply