??? 01/10/08 21:04 Modified: 01/10/08 21:06 Read: times |
#149283 - reply from SILabs Responding to: ???'s previous message |
Hi Erik,
Feel free to post my comment to the thread you referenced. I read through the entire thread and then wrote some code to run a test to add all combinations of two packed-BCD numbers (0-99) together and perform a DA instruction on the results. It appears that the instruction is working correctly for all of these cases, including setting the carry bit when the result is >= 100. If you can provide me with more details of what the error appears to be, I will investigate further. I am guessing, as Brett pointed out, that the cases where things go different than expected are not an adjusting the results of adding two BCD numbers together. Such cases appear to be undefined in the MCS-51 spec. Regards, -Bill my comment: it seems Bill and Brett agree. I think we can consider this a sleeping dog and let it lie. What seems to be "the error" in "the bible" is that resulting from the earlier addition must be taken literally. I.e. the flags and AC must be at a state which is a possible result of an addition of two BCD values. With all the confusion etc resulting from this I really wonder how some of the "'51 cores" behave :) Erik |