PDA

View Full Version : Assembly Language + PBP



Charles Linquis
- 9th January 2006, 21:41
I have been stumped for the longest time trying to figure out how to transfer variables between PBP and assembly.
After looking at a bunch of examples, it appears that when I'm in an assembly language routine, all I have to do is put an underscore in front of a PBP variable name and I can transfer the contents of that variable between assembly and PBP.

Will this always work? Do I have to worry about banks?
I only use 18F parts.

Bruce
- 10th January 2006, 05:30
Will this always work?

Yes. The underscore is all you need, but you can also declare a variable as SYSTEM, and then you don't need the underscore. Just don't get too carried away doing this. All PBP variables need to fit into bank 0 on 14-bit core or bank A on 16-bit core.


Do I have to worry about banks?

Yes.


I only use 18F parts.

Bad news is, (unless all your variables fit into access RAM) you still need to fiddle with bank switching when using assembler. Good news is, you don't need to worry about program memory page nonsense or bank switching for SRF access with 18F parts.

Acetronics2
- 10th January 2006, 13:54
Hi, Charles

A happy new year for yours.

Have a look to page 179 of the 3.04 Manual ... written in full letters !!!

Alain