Well, then edit my 1st post to properly credit the original author. (You, Bruce, I don't remember where I first saw it, but I don't think it was in the optimization thread. I think it goes farther back than that to a thread about sending arrays out using SEROUT or something along those lines)
It shouldn't wipe out anything the array is declared at 255 bytes (except that the stringpos would probably need to be defined as a word rather than a byte). If they only want 32, and they're advanced enough to be messing around with macro's, then I would think that a thinking person, which is becoming a rarity these days, would be able to figure out how to shorten the string to X number bytes.What if the person doesn't want a 255 byte string? Maybe they only need 32. Your routine will wipe out other variables well beyond the array.
Again, a thinking person should be able to figure out how to copy 'string' to another array the old fashioned way.What if they have more than 1 array? It only copies to an array called string.
Maybe they should think about moving over (not necessarily UP) to an 18F.What if they're using a 16F?
The macro only has to be changed once depending on the PIC's total memory. CW works up to 64K, CN works below 64K. Why not just leave it as CN all the time? CN takes more space.Why do they have to manually change MOVE?CW to MOVE?CN.
The person compiling the program should be able to figure out quick enough if they use a LONG (i.e. the addr variable) that they need to use PBPL (they'll get an error otherwise). Says right in the manual that LONGs need PBPL. A person can type, a person must be able to RTFM.Why not detect when PBPL is used,
Sure...let's complicate things just a bit more, make it a bit harder to remember which macro to use.or have a separate macro for 32-bit addresses.
The code works great for me. I don't remember stating that it was an 'All Inclusive' fix it for everybody. And ReadCode seems to work well above 64K with PBPL.Or better yet, do the tblrd's or EECON rd's manually, instead of relying on ReadCode. Then it's easy to handle over 64k or 16F's.
For me, it is an Extension...Make it a true "PBP Extension".
Move the thread over to 'Off Topic' or 'Bluetooth' or something.
Bookmarks