under http://www.edsim51.com/8051Notes/index.html Address Modes Source: http://www.edsim51.com/8051Notes/8051/instructionSetSummary.html under http://www.edsim51.com/8051Notes/index.html
What does an assembly instruction do? Instructions tell the processor which operation to carry out. For example, the instruction MOV A, #5EH tells the processor to move the data 5EH to the accumulator.
Instructions result in the processor performing some operation on some data (the data being 5EH in the example above). The instruction above (i.e., MOV A, #5EH) is an example of what's known as immediate addressing. The reason for this is because the data 5EH immediately follows the instruction in code memory.
Address Modes The available ways of how a processor accesses data from registers or memory are called the “address modes”. The following are the address modes provided for 8051 processor: Immediate Register Direct Indirect Indexed Relative Absolute Long
“Immediate” address mode The machine code of “MOV A, #5EH” is “74H, 5EH” stored at addresses 0000H and 0001H. The datum “5EH” is stored immediately after the opcode “74H”.
“Register” address mode
“Direct” address mode
Quiz: what are the address modes in “MOV 65H,#43H” Q: What are the address modes? Q: How does the datum flow?
“Indirect” address mode In the indirect address mode, R0 and R1 are used as pointer registers. With the indirect address mode, the source or destination address can be altered while the program is running. With the direct address mode, the source or destination address can be altered while the program is running.
“Indexed” address mode MOVC A, @A+DPTR
“Indexed” address mode MOVC A, @A+PC
“Relative” address mode
“Absolute” address mode
“Long” address mode