PDA

View Full Version : Move code in codespace



sinoteq
- 20th July 2006, 10:35
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?

Acetronics2
- 20th July 2006, 12:36
Hi,

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

nothing strange here.

Alain

sinoteq
- 20th July 2006, 13:28
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.

Acetronics2
- 20th July 2006, 14:29
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