Page 1 of 1

asm code into fcd

Posted: Thu May 24, 2012 12:38 pm
by jeannoor
hi to all
please can anyone adapted this code to be inserted into asm code in flowcode

Code: Select all

asm{
clk
    bsf PORTA,0                     
    nop                         
    bcf PORTA,0                      
    nop
return   
                   
reset_card
   bcf  STATUS,RP0                       
   bsf  PORTA,1                   
   bsf  PORTA,0                      
   ;//call  dealy               
   bsf  PORTA,1                     
   bcf  PORTA,0                        
   ;//call  dealy                  
   bcf  PORTA,1                      
   bcf  PORTA,0                      
;//   call  dealy                 
   return 

;//custom it please
}
tankss

Re: asm code into fcd

Posted: Thu May 24, 2012 1:25 pm
by medelec35
Hi jeannoor,
Registers within ASM need to be in lower case and is preceded with an underscore. E.g _porta,0
Bits to Registers are in uppercase e.g RP0
Labels are proceeded with a colon:
Bank switching is nor required.

Try the code below

Code: Select all

asm{
clk:
    bsf _porta,0                     
    nop                         
    bcf _porta,0                      
    nop
  
                   
reset_card:
   bcf  _status,RP0                       
   bsf  _porta,1                   
   bsf  _porta,0                      
   //call  dealy               
   bsf  _porta,1                     
   bcf  _porta,0                        
   //call  dealy                  
   bcf  _porta,1                      
   bcf  _porta,0                      
//   call  dealy                 
}
I have also moved this topic to a more suitable section.

Martin

Re: asm code into fcd

Posted: Thu May 24, 2012 5:35 pm
by jeannoor
hi medelec35
i want really to thanks you for this code.
& it's working :D

Re: asm code into fcd

Posted: Thu May 24, 2012 5:45 pm
by medelec35
Glad it's working for you.
Thanks for letting us know. :)

Martin