When I write SUB A, #-10, I get an out of range error.
When I write SUBW AX, #-10, I get an illegal operand error.
Is -1 interpreted as FF ?
Write the following:
SUB A,#LOW -10
In the above-described method you have been using, -10 is interpreted as FFF6, and the program's attempt to subtract this from the A register (8 bits) is what caused the error. This problem is solved by using the lower byte of the value to be subtracted.
Therefore, use the LOW operator.