Init


Closed Thread
Results 1 to 15 of 15

Thread: Init

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    My only concern is that I have my INIT vector hard-coded at 0x59a, and I'm worried that it won't always work.
    It's a good reason for concern, because INIT is always located after the system library code. Some day you'll use a statement that hasn't been used yet in the program and the library size will increase. Then INIT will be moved along with it, and it won't work anymore.

    When you compile a program, the first instruction at location 0000 is a GOTO INIT.
    But when MC Loader loads the program, it relocates that instruction to an address just before the bootloader code.

    I don't have an 18F8722 to look at, but on an 18F452 the bootloader code starts at 0x7D84, and the GOTO gets relocated to 0x7D70.

    You can see from the disassembly here, the highlighted line is where the GOTO instruction was moved to.
    0x4a is the address of INIT for this test program.



    So all you need to do is figure out where it gets relocated with that chip, then jump to that address, which in turn jumps to INIT.

    HTH,
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    This is just the information I was looking for.

    After I make my first million, I'll buy the rights to PBP from MELabs, and I'll be at your doorstep begging you to work for the company.


    Thanks for the hundredth time.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    If anyone else cares, the "magic address" Darrel is referring to for an 8720/8722 is 0x1fcf0 using MCLoader. Jump there, sit back and smile.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    Sweet!

    +confirmation

    Well, you get the rights to PBP, and have the ability to pay a modest salary... and I'll take that job.

    Knock off some of those wish list items from 4-5 years ago.
    <br>
    DT

Similar Threads

  1. Help Pbasic to PBP
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd March 2009, 18:35
  2. Using LPT port dot matrix printer with PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th January 2007, 11:48
  3. Startup power higher than while program running - why?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th December 2006, 10:25
  4. RS232 to Parallel Printer Converter
    By Squibcakes in forum Code Examples
    Replies: 6
    Last Post: - 19th September 2006, 16:11
  5. do i need to init the CG or DD in 4 bit lcd?
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th May 2005, 02:18

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