> Van: James & Ili > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: Clarification on variables > Datum: donderdag 19 maart 1998 6:51 > > Hello, > I'm just trying to grasp the concept of 2 byte variables. Remember how you first added 1 to 9. That doesn't fit into one digit. What did you do ? You carried the result to the next digit. Thats all there is to it really ... Subtraction is the same. Just take your 'carry' or 'borrow' into the next digit. If your 'digit' is a byte, so be it. it does not change the concept. > Suppose I had a counter and I wanted to count into a > 2 byte variable, could I use code like this? > > incf count, f Yes, but that would only cover the lower-half of your 2-byte variable ... > or would I have to use something like > > incf count.low, f > skpnc > incf count.high, f Something like that. Use 'skpnz' in place of 'skpnc' > Would the Carry bit be the one to check or would I check the > Digit Carry? The Carry bit shows a overflow for 8-bit Subtraction & Addition. The Digit-carry does the same for the lower nibble (bits 0 thru 3) Both Carry & Digit-carry are un-affected by Increment/Decrement instructions The Zero-flag changes, among others, on a Increment or Decrement. > Pardon my ignorance on this matter. If you wouldn't be 'ignorant' I couldn't boast my knowledge ;-) By the way, we _all_ start ignorant ... altough some people can't remember that far back. > James & Ili > Irving, TX. 75038 Greetz, Rudy Wieser