Thursday, April 29

8051 INSTRUCTION SET

 In order to program any processor or controller we should have an idea about its architecture details and instruction set. 8051 is an 8 bit micro controller and is a well preferred micro controller for many small electronic projects. This article aims to give you an idea about the different categories of instructions available in 8051.

  1. DATA TRANSFER
  2. ARITHMETIC
  3. LOGICAL
  4. BOOLEAN
  5. PROGRAM BRANCHING
Standard Registers of 8051:


A total of 49 mnemonics are available in 8051



DATA TRANSFER INSTRUCTIONS

MOV----For moving data

MOVC---For moving code

MOVX--For moving data to external memory

PUSH-- Move data into stack

POP--Move data out of stack

XCH--Exchange of data between two registers

XCHD--Exchange lower order data between two registers

ARITHMETIC INSTRUCTIONS

ADD---Addition operation

ADDC--Add along with carry

SUBB--Subtract along with borrow

INC-- Increment operation

DEC--Decrement operation

MUL-- Multplication

DIV--Division

DA A-- Decimal Adjust Accumulator

 

LOGICAL INSTRUCTIONS

ANL--Logical AND operation

ORL-- OR operation

XRL--XOR operation 

CLR--Clear

CPL--Complement

RL--Rotate left

RLC--Rotate left through carry

RR--Rotate Right

RRC--Rotate Right through carry

SWAP--Exchange lower and higher nibble of a byte

BOOLEAN INSTRUCTIONS 

8051 has many bit addressable registers. These are the instructions that can be used for bit manipulation

CLR

SETB

MOV

JC

JNC

JB

JNB

JBC

ANL

ORL

CPL


 PROGRAM BRANCHING INSTRUCTIONS

This category of instruction aims at changing the control of program this can be through either conditional jump or unconditional jump. 

LJMP---Unconditional Long Jump  


AJMP--Unconditional Absolute Jump 


SJMP--Unconditional Short Jump 


JZ--Jump if A is equal to 0


JNZ--Jump if A is not equal to 0


CJNE--Compare and Jump if Not Equal


DJNZ--Decrement and Jump if Not Zero


NOP--No Operation


LCALL--Long Call to Subroutine


ACALL--Absolute Call to Subroutine 


RET--Return from Subroutine


RETI--Return from Interrupt


JMP--Jump to an Address 

 

Click on this link below to have an in depth knowledge of various instructions:

8051 insruction set 


No comments:

Post a Comment