We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am aware that during addition/subtraction in the accumulator, if a 9-bit value is resulted the carry bit is set, but what if this is used:
mov A,-200
-200 is a 9-bit value in 2's compliment form. what's going to happen if I move it to accumulator? Is the extra bit going to drop off or go set the carry?
A is an 8-bit register.
But -200 is not an eight-bit value. When clipped to 8 bits, it's the value 56 - and 56 is well within range.
In this case, an assembler could decide to convert -200 to +56. Or it could decide to produce a warning/error that -200 doesn't make sense in an 8-bit assign.
The first place that you must always look for a question like that is the Manual for the tool in question.
Keil's assembler manual is here: http://www.keil.com/support/man/docs/a51
And the specific page about instructions is here: http://www.keil.com/support/man/docs/a51/a51_wp_instructions.htm
Linking to: http://www.keil.com/support/man/docs/is51/is51_overview.htm
The MOV instruction is described here: http://www.keil.com/support/man/docs/is51/is51_mov.htm
As Per says, the immediate operand is 8 bits - there is no MOV instruction which takes a 9-bit immediate operand!
Or, to be pedantic,
there is no MOV instruction with an 8-bit target which takes a 9-bit immediate operand!
I can think of no 8051 instruction that takes a 9-bit immediate operand.
MOV DPTR, #immediate
Takes a 16-bit immediate operand - so it could accommodate a 9-bit value.
But you're right - there's nothing that takes an actual 9-bit operand.