kamenges
Member
Guys-
In Warren's defense, you aren't answering his question. He's going to do what he's going to do anyway. We might as well answer the detailed question. You know, the type of question we always ask for.
From post #9:
Warren, Lancie1's post in #8 gave you the info you needed. These are two free-standing byte values stacked into a word. In AB's infinite wisdom they will do stuff on the firmware level that uses byte access but don't allow the end users to easily do the same. Having done higher level programming before it surprises me a little you didn't notice this. The value in N7:1 needs to be shifted down by 8 bits before you can subtract N7:0 from it. Because there is no way to perform an 8-bit shift in a single scan in an SLC and the MSB in the high byte may be set the quickest way I can think to do this is to shift everything down one bit then divide by 128.
Keith
In Warren's defense, you aren't answering his question. He's going to do what he's going to do anyway. We might as well answer the detailed question. You know, the type of question we always ask for.
From post #9:
Originally posted by Warren Boswell:
The code looks something like this (from memory):
MVM S:3 00FFh N7:0
MVM S:3 FF00h N7:1
SUB N7:1 N7:0 N7:3
LEQ N7:3 2 TND
Warren, Lancie1's post in #8 gave you the info you needed. These are two free-standing byte values stacked into a word. In AB's infinite wisdom they will do stuff on the firmware level that uses byte access but don't allow the end users to easily do the same. Having done higher level programming before it surprises me a little you didn't notice this. The value in N7:1 needs to be shifted down by 8 bits before you can subtract N7:0 from it. Because there is no way to perform an 8-bit shift in a single scan in an SLC and the MSB in the high byte may be set the quickest way I can think to do this is to shift everything down one bit then divide by 128.
Keith