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 ?
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.