Bank A System


Closed Thread
Results 1 to 2 of 2

Thread: Bank A System

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default Bank A System

    When your PBP program has an assembly-language subroutine, what determines
    whether or not you need to define variables as 'bankA system'?

    For example, my assembly-language subroutine has 3 basic types of variables:

    1. Variables that hold the context registers - WREG, STATUS, FSR0L, FSR0H
    2. Variables that I need to pass back and forth between PBP and assembly
    3. Temporary variables that are first assigned in PBP, but otherwise are used only within the assembly-language subroutine.

    It is my belief that the 'bankA' designation forces PBP to put the variables in the first 256 bytes of RAM, but what does the 'system' nomenclature mean?

    Is there some rule for how these labels are used?
    Charles Linquist

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis
    It is my belief that the 'bankA' designation forces PBP to put the variables in the first 256 bytes of RAM.
    Actually, in the PIC18F, 'bankA' forces PBP to put the variables into the "Access Bank" which is location 00h-7Fh (first 128 bytes) plus the "SFR" section of memory, which will be the last 128 bytes of memory. EDIT:A little clarifaction of the previous statement. PBP won't actually assign a variable in the SFR section of the "Access Bank". So only 128 bytes are available as GPR for variables. When this is done, it makes access to these varible easier, as you can force the ASM commands to ignore the BSR value and use only "Access Bank" varibles. Any varible that I use in my ASM ISRs I declare with 'banka" so that I don't have to fuss with the BSR. Just a technique though. See section 5-Memory Organization of you datasheet.

    but what does the 'system' nomenclature mean?
    'System', I far as I can tell, just makes PBP declare the variable in ASM without the leading underscore. So, without 'system', the PBP varible 'wsave' would be '_wsave' in the ASM portion of the code. I think section 7.3-RAM Usage of the PBP manual addresses this topic.

    Steve
    Last edited by SteveB; - 9th July 2006 at 04:18.

Similar Threads

  1. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 03:37
  2. Replies: 14
    Last Post: - 26th September 2007, 05:41
  3. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  4. calibration clock 12f508
    By volcane in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th December 2006, 10:33
  5. PIC10F202 Variable trouble
    By George in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 13th October 2006, 02:14

Members who have read this thread : 1

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