Move code in codespace


Closed Thread
Results 1 to 4 of 4
  1. #1
    sinoteq's Avatar
    sinoteq Guest

    Default Move code in codespace

    Hi,
    I would like to have 2 different programs in the same PIC, one in the low part of the flash memory and the other one starting from the midle. Startup is always done in the first program and in very special cases we will jump to the second program. I have found I can move code by adding
    ASM
    ORG 50
    ENDASM
    in the begining of my code. Look at No I2C.gif

    When I add I2C or similar functions from the PBP strange things starts. These functions ignore the ORG 50 statement and creates code between 0 and the area where I want to start. Why is this and how do I stop it?

    It is possible to change the order so I always use the high program and jump to the low if that makes it easier to solve this problem.

    Any ideas or input?
    Attached Images Attached Images   

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Wink The good question ...

    Hi,

    Where do PbP place its library files ???? .... so: RTFM, ...

    nothing strange here.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default Rtfm :)

    I have read the manual cover to cover many times and I can't find this information. Would you please be so kind and tell me where I can read about this. The manual is kind of weak in this subject.

    I don't get why PBP ignores the ORG statement in the BASIC file or is this a Bill Gates function? (forget what the user wants and do according to own ideas)

    The idea of using PBP is to minimize the ASM part of programing.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Chapter 8.3 : Placement of in-line assembly ...

    ... reason to place libs here is probably the handling of page bits ... far before the 18xxx devices existed.

    sooooo ... , why do you want to give the low part adress ??? let PbP do it !!! and ONLY if necessary ( ! ) give the High part address.

    ( and think an asm statement resets to page 0 ... if you use something else than a 18xxx device !!! you must also care with PCLATH )

    Alain
    Last edited by Acetronics2; - 20th July 2006 at 14:40.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  2. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26

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