2
\$\begingroup\$

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 ?

\$\endgroup\$
  • \$\begingroup\$ That is not happening. A single 8-bit word is copied into A. But the address dptr might be a 16bit address. \$\endgroup\$ – Marcus Müller Aug 13 '17 at 15:06
1
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.