As I was using this instruction movx a,@dptr . and I didnt udnerstand how a 16 bits number is being copied to the accumulator when the accumulator can only hold 8 bits ?
Asked
Active
Viewed 5,270 times
2
-
That is not happening. A single 8-bit word is copied into `A`. But the address `dptr` might be a 16bit address. – Marcus Müller Aug 13 '17 at 15:06
1 Answers
1
movx a, @dptr copies 8 bit data byte from external memory location addressed by 16 bit number stored in dptr (obviously, if it is properly interfaced).
For e.g. if you want to copy byte (i.e. 8 bit) data stored at 1500h in your external memory. You'd write :
mov dptr, #1500h
movx a, @dptr
Also, keep in mind that dptr (data pointer register) is actuality combination of two 8-bit special function registers, dph and dpl (having addresses 83h and 82h, in internal RAM respectively).
You might want to re-read atleast all indirect addressing mode instructions.

Deep
- 582
- 4
- 21