PDA

View Full Version : How do I upgrade MPASM, and have PBP3 notice?



scalerobotics
08-23-2011, 05:20 PM
Version 2.60 had a way for you to select a location for an assembler (mpasm) and also select a location for PBP.

PBP3 has one location for both? I am confused.

Trying to upgrade MPLAB to 8.76... But I can't get PBP3 to notice that MPLAB 8.76 has been installed.

Thanks,

Walter

Charles Leo
08-31-2011, 02:22 PM
The assembler can still be located manually, but the process has changed a bit. In PBP 2.60 and earlier, it was required that the assembler be located by an external method. MicroCode Studio compiled and assembled in separate steps, allowing it to specify the assembler location. Other IDEs relied on the user-modified PATH environment variable to make the assembler available to PBP.

In PBP3, the compiler takes on more responsibility for locating the assembler. Instead of selecting an assembler location from a dialog in the IDE, you select using a utility called MPASM-MPLAB Setup, found in the PBP3 program group on the start menu.

Since I've been asked about this frequently in the last few weeks, I'd like to disclose how it works.

When PBPX runs, it reads the PBP_MPASM variable and prepends the location found there to the system PATH value. For those familiar with Windows/DOS batch commands, this can be illustrated with:

set PATH=%PBP_MPASM%;%PATH%

In effect, the PATH environment is temporarily modified when PBPX runs.

The PBP_MPASM environment variable is manipulated during install/setup as follows.

The PBP3 installer sets the PBP_MPASM variable to the default "MPASM Suite" folder. This is mostly a shot in the dark because, during a first-install, MPLAB and MPASM don't exist on the drive yet. The installer also requests that the MPASM-MPLAB Setup utility be run on the next restart. The setup utility is where the real work is done.

The MPASM-MPLAB Setup utility does a couple of things in addition to setting the PBP_MPASM variable:


It copies the latest MPLAB8 language-tool plugin into the Windows System32 folder and registers it.
It attempts to locate the newest install of PBP and, if found, copies the latest version of the PBPMPLAB.BAT file into the PBP folder.
If a valid PBP installation was found, it overwrites the MPLAB8 registry key so as to update the PBP language-tool location.

Next, it tackles the PBP_MPASM variable with the following search sequence:


If the PBP_MPASM variable exists and either MPASMWIN or MPASMX exist in the specified folder, use this location as default and stop searching.
If the registry shows that MPLABX is installed, check for MPASMX in the listed folder. If found, use this location as default and stop searching.
If the registry shows that MPLAB8 is installed, check for MPASMWIN in the listed folder. If found, use this location as default and stop searching.
Prompt the user to select a folder in which the assembler exists. If valid, present the default selection from above.
No checks are performed from this point forward. The user may select any folder, regardless of the existence of the assembler. The user's selection always overrides everything else. When the user accepts the displayed folder location, the PBP_MPASM variable is overwritten.