Question

I'm currently working on an adress gestion system for a 8bits µprocessor.

My adresses are of the form 0000000C CCCCLLLL and I'll often have to use the adresses corresponding to CCCCC and CCCCC + 1. The problem is I am limited by the 8bits architecture and so I can't do ADDLF 16, Adr (0000000 00010000 + 0000000C CCCCLLLL) I have to work with the 8 bits parts.

My problem would be when I try to do that 00010000 + 1111LLLL and I have to report the addition to the next group of 8 bits.

I'm not proefficient with Assembly (esp. on µc) if someone could lead me to the right direction that would be great!

Was it helpful?

Solution

I'm not familiar with PIC instruction set, but many other processors have also some "add with carry" instruction: First you add the lower bytes and then highet bytes with carry. If there is no "add with carry, you add the lower bytes, and if that sets carry, you increment the upper result byte by 1 and then add the upper bytes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top