Need once your help one please


Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm i'm not sure of the question but i assume you want a translation from assembly to PICBASIC.

    My assembly language is really primitive but i think this can be the solution.
    Code:
    B_OUT   var PORTB.0 ' B_OUT is assign to PORTB.0
    B_IN    var PORTB.1 ' B_IN is assign to PORTB.1
    R_DATEN var BYTE
    
    ' ---------------------------------------------
    ' Btfss R_DATEN,0 ; immediately edition of the
    ' bsf PORTB,B_OUT ; .. bits #0 of 
    ' btfsc R_DATEN,0 ; .. R daten at 
    ' bcf PORTB,B_OUT ; .. DATA_OUT
    ' ---------------------------------------------
    
    if R_DATEN.0 = 0 then 
       B_OUT=1
    else
       B_OUT=0
    endif
    
    ' ----------------------------------------
    ' btfss PORTB,B_IN ; Bit at the entry
    ' bsf STATUS,C ; .. DATA-IN to the
    ' btfsc PORTB,B_IN ; .. To
    ' bcf STATUS,C ; .. shift register into C
    ' rrf R_DATEN,F ;To daten () negates
    ' ----------------------------------------
    
    if B_in = 1 then
       STATUS.0 = 0
       R_DATEN = R_DATEN >> 1
    else
       STATUS.0 = 1
    endif
    I'll really appreciate to be corrected by somebody here if i'm not right on that.
    Last edited by mister_e; - 6th February 2005 at 20:28.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts