0

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!

Alex Bravo
  • 1,601
  • 2
  • 24
  • 40
AdrienNK
  • 850
  • 8
  • 19
  • It's a bit hard to get what you want to ask. And what microcontroller do you use? What is the problem with the ADDLF instruction? What did you try instead? – harper Jan 27 '14 at 13:47
  • My guess is that the OP is using smaller PIC. – turboscrew Jan 27 '14 at 22:08

1 Answers1

1

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.

turboscrew
  • 676
  • 4
  • 13