ASM IN FLOWCODE

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
raghavmonga
Posts: 14
Joined: Thu Apr 17, 2008 10:10 am
Contact:

ASM IN FLOWCODE

Post by raghavmonga »

i got the following errors when i wrote-:

asm
{
bsf 03h,5 ;Go to Bank 1
movlw 00h ;Put 00000 into W
movwf 85h ;Move 00000 onto TRISA – all pins set to output
bcf 03h,5 ;Come back to Bank 0
}

error: error in built-in assembly

i m using FlowcodeV3 for PIC

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: ASM IN FLOWCODE

Post by Steve »

Hello,

It looks like the compiler must use actual register names, rather than their addresses in RAM. The following code should work fine:

Code: Select all

asm
{
  bsf _status,5   ;Go to bank 1
  movlw 00h       ;Put 00000 into W
  movwf _trisa    ;Move 00000 onto TRISA - all pins set to output
  bcf _status,5   ;Come back to Bank 0
}

raghavmonga
Posts: 14
Joined: Thu Apr 17, 2008 10:10 am
Contact:

Re: ASM IN FLOWCODE

Post by raghavmonga »

Thanks Steve

Post Reply