13.07.2015 Views

Digital Electronics: Principles, Devices and Applications

Digital Electronics: Principles, Devices and Applications

Digital Electronics: Principles, Devices and Applications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

536 <strong>Digital</strong> <strong>Electronics</strong>OperationRegister nameRegisterData(a)MOV A,R109H06H22HR0R1R2(b)Figure 13.7Register direct addressing mode.OperationRegister numberRegisterMemoryMemoryData(a)MOV A,@R0R030H09072231H30H29H(b)Figure 13.8Register indirect addressing mode.MOV A, @R0 moves the contents of the memory location whose address is stored in R0 into theaccumulator. The value of the accumulator in this example is 07H [Fig. 13.8(b)]. This addressing modecan also be enhanced with an offset for accessing data structures in data space memory. This is referredto as register indirect with displacement. As an example, the instruction MOVC A, @A+DPTR copiesthe code byte at the memory address formed by adding the contents of A <strong>and</strong> DPTR to A.13.5.5 Indexed Addressing ModeIn the indexed addressing mode, the address is obtained by adding the contents of a register to aconstant (Fig. 13.9). The instruction ‘move the contents of accumulator A to the memory locationwhose address is given by the contents of register 1 plus 5’ is an example of indexed addressing. Theindexed addressing mode is useful whenever the absolute location of the data is not known until theprogram is running. This addressing mode is used to access a continuous table or array of data itemsstored in memory. The content of the constant gives the starting address, while the contents of the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!