PDA

View Full Version : Adding PBPro code to an ASM file - how to?



wjsmarine
- 8th January 2010, 13:16
Hi Folks,

I know how to add some asm into my PBPro code but what if I already have a working application (all in assembly) that I want to add some PBPro code to?

Attached a nice SLA battery charger that I want to change from an F88 to an F876 in order to add serial output and LCD with PBPro.

I don't know assembly so any pointers or example to do this to the attached would be very welcome. I'm sure others have come across this before so this may be a common problem?

Kind regards to all,
Bill

Acetronics2
- 8th January 2010, 13:44
Hi, WJS

Having had a quick look to this program ...

1) Best solution is to rewrite it into PBP ... you could be surprised about the length of the PBP source you'll get . Source is well commented ... so, there's no headache to fear !!!

Easy to say ??? ... I just did translate such a SLA Charger "C" program from a Z8 Encore processor to a 16 F 876 Pic, With PBP ... really a child's game ...

2) you simply could add some assembler routines ( lots, widely commented, available on the web ...) by " cut and paste " and very slight adjustments.


Of course you could include most of the existing asm program into a PBP program ... but that will lead you to examine asm listing to cut all what PBP already does ...
solution 1) will become obvious to you, then ...

Alain

wjsmarine
- 9th January 2010, 06:00
Hi Alain,

Thanks for your input, always good information from you.

I will do as you suggest and see what I get but I have quite a few other asm programs I've been storing for future use/ideas which would take a great deal of time and effort to convert to PBP... So I still want to know the answer to the original question - for this reason I attached the smallest of my asm listings so the task would not be too daunting for assistance.

I agree there is a lot to be learnt from doing what you suggest and examining the result - anything else you can offer will be welcome.

Kind regards,
Bill

mackrackit
- 9th January 2010, 17:00
I have never tried it...

What would happen if you stripped the configs from the ASM file, make a "container" with PBP, set configs as normal. Then insert the ASM file into the PBP "container".

Kind of like adding a little ASM to a PBP code.
???

ScaleRobotics
- 9th January 2010, 18:49
I just found this manual today. Looks like there is at least one link to it from the forum, but it is a very useful reference to assembly commands, macro's, etc. It might help in your integration or dissection of assembly code.

MPASM™ Assembler,
MPLINK™ Object Linker,
MPLIB™ Object Librarian
User’s Guide
http://ww1.microchip.com/downloads/en/DeviceDoc/33014j.pdf