Appendix A: 8051 Microcontroller Instructions Set

Appendix A: 8051 Microcontroller Instructions Set

Appendix A: 8051 Microcontroller Instructions Set Data transfer operations Instruction Byte Cycles Code Symbolic representation Movement within the microcontroller (no flag is affected) The content of the second register/memory is copied to the content of the first register/ memory MOV A,Rn 1 1 1110 1rrr (PC) (PC) + 1 The program counter is (A) (Rn) added by one unit, and the content of the Rn register is copied to the content of the accumulator (A) register. No flag is affected MOV A, 2 1 1110 0101 (PC) (PC) + 2 The program counter is direct direct (A) (direct) added by two units, address and the content of the position of the internal RAM whose address is direct is copied to the content of the accumulator (A) register MOV A, 1 1 1110 011I (PC) (PC) + 1 The program counter is @Ri (A) ((Ri)) added by one unit, and the content of the memory location whose address is given by the content of the Ri register is copied to the content of the accumulator (A) register MOV A, 2 1 0111 0100 (PC) (PC) + 2 The program counter is #data immediate (A) #data added by two units, data and the date value is copied to the content of the accumulator (A) register (continued) # Springer International Publishing AG, part of Springer Nature 2019 293 S. P. Gimenez, 8051 Microcontrollers, https://doi.org/10.1007/978-3-319-76439-9 294 Appendix A: 8051 Microcontroller Instructions Set Data transfer operations Instruction Byte Cycles Code Symbolic representation MOV Rn,A 1 1 1111 1rrr (PC) (PC) + 1 The program counter is (Rn) (A) added by one unit, and the content of the accumulator (A) register is copied to the content of the Rn register MOV Rn, 2 2 1010 1rrr (PC) (PC) + 2 The program counter is direct direct (Rn) (direct) added by two units, address and the content of the internal RAM location whose address is direct is copied to the content of the Rn register MOV Rn, 2 1 0111 1rrr (PC) (PC) + 2 The program counter is #data immediate (Rn) #data added by two units, data and the date value is copied to the content of Rn register MOV direct, 2 1 1111 0101 (PC) (PC) + 2 The program counter is A direct (direct) (A) added by two units, address and the content of the accumulator (A) register is copied to the content of the internal RAM location whose address is direct MOV direct, 2 2 1000 1rrr (PC) (PC) + 2 The program counter is Rn direct (direct) (Rn) added by two units, address and the content of the Rn register is copied to the content of the internal RAM memory location whose address is direct MOV direct, 3 2 1000 0101 (PC) (PC) + 3 The program counter is direct dir.adr.src (direct) (direct) added by three units, dir.adr. and the content of the dest position of the internal RAM whose address is direct is copied to the content of the internal RAM memory location whose address is direct MOV direct, 2 2 1000 011i (PC) (PC) + 2 The program counter is @Ri direct (direct) ((Ri)) added by two units, address and the content of the internal RAM position whose address is given (continued) Appendix A: 8051 Microcontroller Instructions Set 295 Data transfer operations Instruction Byte Cycles Code Symbolic representation by the content of the Ri register is copied to the content of the internal RAM memory location whose address is direct MOV direct, 3 2 0111 0101 (PC) (PC) + 3 The program counter is #data dir. adr. (direct) #data added by three units, immed. and the date value is data copied to the content of the internal RAM location whose address is direct MOV @Ri, 1 1 1111 011i (PC) (PC) + 1 The program counter is A ((Ri)) (A) added by one unit, and the content of the accumulator (A) register is copied to the content of the internal RAM position whose address is given by the content of the Ri register MOV @Ri, 2 2 1010 011i (PC) (PC) + 2 The program counter is direct direct ((Ri)) (direct) added by two units, address and the content of the internal RAM location whose address is direct is copied to the content of the internal RAM position whose address is given by the content of the Ri register MOV @Ri, 2 1 0111 011i (PC) (PC) + 2 The program counter is #data immediate ((Ri)) #data added by two units, data and the content of the internal RAM position whose address is given by the content of the Ri register is initialized with the date value MOV 3 2 1001 0000 (PC) (PC) + 3 The program counter is DPTR, imme. (DPH) #data15,8 added by three units, #data16 data15,8 (DPL) #data7,0 and the value data16 is imme. copied to the content of data7,0 the 16-bit DPTR register (continued) 296 Appendix A: 8051 Microcontroller Instructions Set Data transfer operations Instruction Byte Cycles Code Symbolic representation Moving the content from the program memory to the content of the accumulator (A) register (no flag is affected) MOVC A, 1 2 1001 0011 (PC) (PC) + 1 The program counter is @A + DPTR (A) added by one unit, and ((A) + (DPTR)) the content of the program memory position addressed by the sum of the contents of the accumulator (A) and DPTR registers is copied to the content of the accumulator (A) register MOVC A, 1 2 1000 0011 (PC) (PC) + 1 The program counter is @A + PC (A) ((A) + (PC)) added by one unit, and the content of the program memory position addressed by the sum of the contents of the accumulator (A) and PC registers is copied to the content of the accumulator (A) register Moving the content from the external data memory to the content of the accumulator (A) register and vice versa (no flag is affected) MOVX A, 1 2 1110 001i (PC) (PC) + 1 The program counter is @Ri (A) ((Ri)) added by one unit, and the content of the memory location of the external RAM whose address is given by the content of the Ri register is copied to the content of the accumulator (A) register MOVX A, 1 2 1110 0000 (PC) (PC) + 1 The program counter is @DPTR (A) ((DPTR)) added by one unit, and the content of the memory location of the external RAM whose address is given by the content of the DPTR register is copied to the content of the accumulator (A) register (continued) Appendix A: 8051 Microcontroller Instructions Set 297 Data transfer operations Instruction Byte Cycles Code Symbolic representation MOVX 1 2 1111 000i (PC) (PC) + 1 The program counter is @Ri,A ((Ri)) (A) added by one unit, and the content of the accumulator (A) register is copied to the content of the memory location of the external RAM whose address is given by the content of the Ri register MOVX 1 2 1111 0000 (PC) (PC) + 1 The program counter is @DPTR,A ((DPTR)) (A) added by one unit, and the accumulator (A) register is copied to the content of the memory location of the external RAM whose address is given by the content of the DPTR register Storing data with direct addressing in the stack (no flag is affected) PUSH direct 2 2 1100 0000 (PC) (PC) + 2 The program counter is direct (SP) (SP) + 1 added by two units, the address ((SP)) (direct) content of the stack pointer (SP) register is added by one unit (it points to the next memory location), and the content of the register/memory location < src > is copied to the content of the memory location whose address is given by the contents of the SP register Reading data from the stack to the content of data memory with direct addressing (no flag is affected) POP direct 2 2 1101 0000 (PC) (PC) + 2 The program counter is direct (direct) ((SP)) added by two units, the address (SP) (SP) – 1 content of the memory location whose address is given by the content of the SP register is copied to the content of the register/memory location <dest>, and the content of the stack pointer (SP) register is (continued) 298 Appendix A: 8051 Microcontroller Instructions Set Data transfer operations Instruction Byte Cycles Code Symbolic representation decremented by one unit (it points to the memory position of the previously stored data in the stack) Data exchange (no flag is affected) XCH A,Rn 1 1 1100 1rrr (PC) (PC) + 1 The program counter is (A) $ (Rn) added by one unit and exchanges the content of the accumulator (A) register with the content of the Rn register XCH A, 2 1 1100 0101 (PC) (PC) + 2 The program counter is direct direct (A) $ (direct) added by two units and address exchanges the content of the accumulator (A) register with the content of the position of internal RAM whose address is direct XCH A,@Ri 1 1 1100 011i (PC) (PC) + 1 The program counter is (A) $ ((Rn)) added by one unit and exchanges the content of the accumulator (A) register with the content of the internal RAM position whose address is given by the content of the Ri register XCHD A, 1 1 1101 011i (PC) (PC) + 1 The program counter is @Ri (A3–0) $ ((Rn3–0)) added by one unit and exchanges the content of the least significant 4 bits of the accumulator (A) register with the content of the least significant 4 bits of the content of the internal RAM position whose address is given by the contents of the Ri register Arithmetic operations Addition (all flags are affected) ADD A,Rn 1 1 0010 1rrr (PC) (PC) + 1 The program counter is (A) (A) + (Rn) added by one unit, and (continued) Appendix A: 8051 Microcontroller Instructions Set 299 Data transfer operations Instruction Byte Cycles Code Symbolic representation the result of the addition operation between the contents of the accumulator (A) register and Rn register is stored in the content of the accumulator (A) register ADD A, 2 1 0010 0101 (PC) (PC) + 2 The program counter is direct direct (A) added by two units, address (A) + (direct) and the result of the addition operation between the contents of the accumulator (A) register and the position of the internal RAM whose address is

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    30 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us