Accessing MultiByte Variables in Assembler


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Location
    TURKIYE-KONYA
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Code:
    Is there a "banksel" function equivalent in PM assembler?
    NO THERE ISNT ANY EQUIVALENT FUNCTION.

    I KNOW THAT , PIC BASIC PRO MAKES THE BANKSEL FUNCTION ITSELF.

  2. #2
    Join Date
    Aug 2009
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Hmm....

    I'm trying to use inline Assembler, but I use multiple arrays which means I need to address multiple banks. How can I tell which bank a given array is stored in?
    Also, I'm not certain how you mean that banksel is produced by PM itself. I'm using 2.5, and it's choking on errors - all related to my attempts to use banksel.

    This may all be simplified if I just specify which bank I want each variable in.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Altruist
    I'm having trouble figuring out how to access the High and Low Bytes of 16-bit Words in Assembler.
    Code:
    MyWord  VAR WORD BANK0
    
    ASM
        movf     _MyWord,w      ; this gets the LowByte
        movwf    PORTB
    
        movf     _MyWord + 1,w  ; this gets the HighByte
        movwf    PORTC
    ENDASM
    You can use the CHK?RP macro to locate the bank for any variable.
    But if you're accessing arrays, it's probably better to use an FSR/INDF.
    <br>
    DT

Similar Threads

  1. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  2. PIC assembler forum?
    By Lajko in forum Off Topic
    Replies: 1
    Last Post: - 29th September 2008, 05:34
  3. Assembler problem
    By om3bc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th March 2008, 19:12
  4. Variables not appearing in Watch Window MPLabv7.3
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2006, 14:36
  5. Problems with variables
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2004, 18:37

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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