PDA

View Full Version : Program Code and Program Memory



DenFrod
- 7th February 2007, 22:33
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.

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

Bruce
- 7th February 2007, 23:17
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.

DenFrod
- 8th February 2007, 14:31
Interesting, but the code is being written into locations 0008h thru 0018h which the data sheet indicates is for interrupt vectors.

??

Bruce
- 8th February 2007, 14:51
Unless you tell PBP to do otherwise, it's always going to drop code in the
hardware interrupt vector locations.

Try something like this;


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.