Program Code and Program Memory


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    4

    Default Program Code and Program Memory

    I am using MicroCode Studio Plus (V2.3.0.0), PBP 2.47, and MPASM.
    I thought that the porgrams were stored from high memory down (as in the MSLoader hex file).
    I just noticed that the code I am loading is going in at the the begining of program memory. It doesn't even skip the Interup Vector locations.

    ????????????

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Program code for 12-bit & 14-bit core parts always starts at 0. For 18F
    parts, you have the option of using DEFINE RESET_ORG to force the
    reset vector to another location.

    If you're using the MCS loader, just use DEFINE LOADER_USED 1 to leave
    space from 0-4 for the loader jump.

    The MCS loader occupies high memory - so it's out of the way of normal
    program code space.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Feb 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Interesting, but the code is being written into locations 0008h thru 0018h which the data sheet indicates is for interrupt vectors.

    ??

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Unless you tell PBP to do otherwise, it's always going to drop code in the
    hardware interrupt vector locations.

    Try something like this;
    Code:
    DEFINE  INTHAND HIGH_INT  ' High Priority Ints
    DEFINE  INTLHAND LOW_INT ' Low Priority Ints
    
    ASM
    HIGH_INT
       blah
       blah
    ENDASM
    
    ASM
    LOW_INT
       blah
       blah
    ENDASM
    Now PBP will insert jumps to both of your .asm interrupt handlers at both high
    and low hardware interrupt vectors.

    If you use the BASIC ON INTERRUPT option, PBP will just drop a RETURN at
    location 4.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 18:38
  4. fatal error [301] out of memory with 4 lines of code????
    By George in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th October 2005, 21:26
  5. oscillator code and placement within program
    By bartman in forum mel PIC BASIC
    Replies: 14
    Last Post: - 14th December 2004, 02:39

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