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
C-Code error using asm
-
- 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
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.
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.