pbp - asm variable passing


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default pbp - asm variable passing

    I have a growing number of ASM routines in my program. Whenever I want to pass variables between ASM and PBP, I define the variable as "BankA system". This has always worked fine, but now I get the msg ""cannot fit variable in the selected bank". I obviously have too many variables. My question is - must I always define the common variables in bankA? Is there something else I can do to allow access to a variable from both ASM and PBP now that I have bankA filled?

    I'm using an 18F series chip.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    You can access any variable in any bank you want. They don't need to be in BANKA.

    If you put them in BANK0, it works almost identical to BANKA since you always start in BANK0 from the beginning of an ASM block.

    If they are in another bank, you can use CHK?RP _VarName to find the bank any variable is in. Just be sure to put it back to BANK0 before exiting the ASM block (RST?RP).

    Best bet... use BANK0 and don't use SYSTEM.
    SYSTEM variables usually end up in BANKA, whether BANKA is specified or not. Then they'll push other variables out of BANKA that were specified to be there.
    <br>
    DT

Similar Threads

  1. EEPROM Variables (EE_Vars.pbp)
    By Darrel Taylor in forum Code Examples
    Replies: 79
    Last Post: - 26th October 2012, 00:06
  2. PBP, ASM and LST files
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2010, 13:43
  3. ASM or PBP First?
    By mackrackit in forum Off Topic
    Replies: 4
    Last Post: - 10th October 2009, 12:08
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. asm and pbp
    By pic beginner in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th October 2004, 05:33

Members who have read this thread : 2

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