Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/22/04 02:27
Read: times


 
#70911 - RE: ADD command
Responding to: ???'s previous message
Okay, Michael and Eric are right. Download and read the instructional things they refer to. That being said, this might help also.

Assume you're moving an address of 1A2B into DPTR. 1A goes into DPH (data pointer high) and 2B goes into DPL (data pointer low).

Since the accumulator (or any other register) is 8 bits, the largest number it can hold is 11111111 = FF = 255. Anytime the ADD instruction results in a number larger than 255, it would result in the carry bit being set. In that regard you can think of the carry bit as a ninth bit. Do not interpret this to mean that you can use the carry bit as a ninth bit, just that you can think of it as such. Now consider this. The largest addition you can do directly is 8 bits plus 8 bits. In a worst case that would be 255 + 255 = 510 = 1FE = 111111110 (the bold bit represents the carry bit). The point is that you can not overflow the carry bit in a single addition operation, but you can in two or more addition operations. So if it matters that you might lose data, be sure to check the carry bit.

List of 4 messages in thread
TopicAuthorDate
ADD command            01/01/70 00:00      
   RE: ADD command            01/01/70 00:00      
      RE: ADD command            01/01/70 00:00      
   RE: ADD command            01/01/70 00:00      

Back to Subject List