0
6.7kviews
Explain the following instructions of 8051 uc:
1 Answer
0
314views
  1. MOV A, @R0: The instruction is in indirect addressing mode. In this mode the data is copied to the accumulator which is stored at an 8-bit address location is pointed by register R0 which holds only 8-bit addresses. For example if register R0 holds 56H which is the address and on this address location 25H is the data stored so 25H is moved to the accumulator (A).

  2. SETB Px.y: This instruction is used to set a particular pin on the microcontroller 8051. fro example, SETB P2.2; This instruction will make the P2.2 high.

  3. MOVC A, @A+DPTR : This instruction falls under indexed addressing mode. In this instruction the contents of the ROM location pointed by A+DPTR are moved to the accumulator. The data pointer (DPTR) holds the base address which is 16 bits and the accumulator (A) holds the index which is 8 bits long. For example if DPTR = 0508H and A= 06H then the contents of ROM location pointed by 0512H are copied to the accumulator(A).

  4. CPL C: This instruction will complement the carry flag. For example if CY=1 then after execution of "CPL C" instruction the CY flag will be 0.

  5. MUL AB: This instruction multiplies the contents of A and B registers and stores the results in A and B. The lower bytes are stored in the accumulator(A) and the higher bytes are stored in register B. For example If A= 25H and B=65H then after the execution of this instruction 25H * 65H =E99H and the result will be stored as B=0EH and A= 99H.

  6. INC 0x45: After execution of this instruction the memory location is incremented by one. i.e it becomes 0x46.

  7. ANL A,@R0: The ANL instruction ANDS the two contents. This instruction is used for masking of the particular bits. After execution of this instruction by the processor the contents of the memory location pointed by register R0 are ANDED with the contents of A and the result is stored in the accumulator (A).

  8. CJNE destination, source, label: This instruction states compare and jump if not equal. The source and destination are compared and if they are not equal it goes to the location denoted by a label which is specified in that instruction. For example: CJNE A, #99, Back; after execution contents of the accumulator (A) are same are the direct data specified, the loop keeps executing till the values are same.

  9. INC @R0: After execution of this instruction the contents of the memory location pointed by register R0 gets incremented by one.

  10. SWAP A: After execution of this instruction the higher nibbles of A gets swap with the lower nibbles of A and the result is stored in the accumulator (A).

Please log in to add an answer.