asm code into fcd

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
jeannoor
Posts: 5
Joined: Wed May 23, 2012 10:36 am
Contact:

asm code into fcd

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: asm code into fcd

Post 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
Martin

jeannoor
Posts: 5
Joined: Wed May 23, 2012 10:36 am
Contact:

Re: asm code into fcd

Post by jeannoor »

hi medelec35
i want really to thanks you for this code.
& it's working :D

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: asm code into fcd

Post by medelec35 »

Glad it's working for you.
Thanks for letting us know. :)

Martin
Martin

Post Reply