Roland wrote : > Hi All > > I'm moving an assembly program from a 16F877 to a 18F452 > > Still editing the syntax at the moment, and wondered if I'm > on the right track. I'm simply building and editing until all > the errors go away. Might be OK, if you just need a "working" prog. It will probably not be "18-optimized" though... > > Basically; > - I'll need to attend to some new SFR's, and some name changes Obviously, yes... :-) > - Interrupts can be split to high and low priority But just becuse you can, do you need that ? From what I have understod, most just use the single level interrupt system. > - I intend to use Bank1 of ram, so; Why ? Are you not using (the lower half of) bank0 at all ? If so, you miss the whole "access bank" thing. That is one of the realy nice things with the 18-line. > - my Cblock starts at 0x100 I bet *someone* will add that you *should* look at RES and use the linker instead... :-) You don't have to do that, but I would... > - all my old FSR and INDF become FSR1 and INDF1 > - many of the 'goto's become 'bra' (within branch limits) > > What I'm unsure of is: > - in the old code I had; goto $ + 5 Do yourself a big favour and throw them out at once ! Add lables and goto (or branch) to them instead. If you had done that in your PIC16 code in the first place, that had been portable as-is. > - in the new code do I have to use; bra $ + 5 > but I still get: "Warning 226: Destination address must be > word aligned" Correct. As expected. Since each instruction is on an even address, and you are adding an odd value, you will end up on an odd address, right ? "even" + "odd" = "odd"... > what do I do to alleviate this? The manual say's > > " > 226 UNKNOWN WARNING > A warning has occurred which the assembler cannot understand. > It is not any > of the warnings described in this appendix. Contact your > Microchip Field > Application Engineer (FAE) if you cannot debug this warning. > " Don't bother. Just get those goto/bra $-something out and add lables instead. > Any other common snags to watch for? The rotate instructions, if I'm not wrong. I think there are som changes how the carry bit is handled in some arithmetic instruction, but I'm not sure... Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist