8051 Architecture – In-depth explanation using old and modern variants, AT89C51 Pins – Ultimate guide to the 8051’s pin configuration, Ports of 8051 – Functions and specifications of the four I/O ports, 8051 Memory Organization – ROM and RAM Structure, Arithmetic instructions in 8051 – with examples, Logical instructions in 8051 – with example codes, Boolean (bitwise) instructions in 8051 for bit manipulation, Interrupts in 8051 microcontroller – With examples, 8051 external memory interfacing guide: RAM and ROM, Set up Keil c51 for 8051 microcontroller simulations – A step by step guide, Serial communication with UART in 8051 – Simple in-depth explanation, Interfacing of 8051 with 8255 Programmable Peripheral Interface, Interfacing 8051 with ADC 0808 – Stepwise tutorial, LED interfacing with 8051 – Direct and with 8255, LED and switch interfacing with 8051 – Including switch debouncing, LCD interfacing with 8051 – 8-bit, 4-bit mode, and with 8255 PPI, Seven segment interfacing with 8051 – Single and Quad module, Servo Motor Interfacing with 8051 – Simple tutorial, Stepper Motor Interfacing with 8051 – Simple tutorial, DC motor interfacing with 8051 using L293D and L298N, Interfacing 8051 with relays to drive high power peripherals, Interfacing 4×4 Keypad matrix with 8051 microcontroller, Bluetooth (HC-05) interfacing with 8051 with practical application, 8051 – Power Down and Idle mode – Comparative Study, 8051 Microcontroller MCQ | Quiz | Interview Questions, [Data at Address]<-[Data at Address] AND [A], [Data at Address]<-[Data at Address] AND [Data], [Data at Address]<-[Data at Address] OR [A], [Data at Address]<-[Data at Address] OR [Data], [Data at Address]<-[Data at Address] XOR [A], [Data at Address]<-[Data at Address] XOR [Data], Shifts the value in accumulator to the left, Shifts the value in accumulator to the left through the accumulator, Shifts the value in accumulator to the right, Shifts the value in accumulator to the right through the accumulator, Swaps the upper nibble of the accumulator with the lower nibble, Performs the AND operation on the data stored in the accumulator and the register Rn. The XRL instruction performs a logical exclusive OR Ports 1 and 2 are used for normal I/O. The result is then stored at the given address, Performs the OR operation on the data stored in the accumulator and the register Rn. The result is then stored at the given address, Performs the XOR operation on the data stored at the given address and the data given by the programmer. We hope that reading this article made you understand logical instruction in 8051. Looping inside a Loop. About the authorNischay KhannaAn Engineering Graduate with a specialization in Embedded systems, who loves to dabble with IoT automation cause switching lights on with switches is to mainstream. If you have any doubts regarding the same feel free to reach us through the comments section. By continuing to use our site, you consent to our cookies. When this instruction is SECTION II - BIT MANIPULATION / INPUT OUTPUT PROGRAMMING IN 8051:Bit Manipulation is a powerful feature of an 8051.Ways of Accessing the Entire 8 bits data:Example # 1:Lets examine an example in which the entire 8 bits of Port 1 data are accessed.BACK: MOV A,#55H MOV P1,A ACALL DELAY MOV A,#0AAH MOV P1,A ACALL DELAY SJMP BACKIn the example above, the code … Note:-8051 micro controller belongs to the MCS-51 family of micro controllers. Here one machine cycle consists of 12 oscillator periods. Port 3 provides control lines for the external RAM. As a typical 8-bit processor, the 8051 Microcontroller instructions have 8-bit Opcodes. The RRC command performs the same operation but includes the carry bit in the operation as well. Easier/faster to just do it by hand, just look at an 8051 instruction set reference. Instructions written in a progra… THE 8051 INSTRUCTION SET All commands in alphabetic order: ACALL addr11 DIV AB LJMP addr16 RETI ADD A, A 7-4, swap the nibbles of the accumulator. 8051 instruction set-opcode,operand,size in bytes,M-cycle. used to modify an output port, the value used as the port data is The instruction sequence, MOVX A,@R1. So just, go through it. The full 64KB may be accessed using MOVX A,@DPTR and MOVX @DPTR,A. The result is then stored in the accumulator, Uses the data stored in the register as an address and performs the XOR operation on the data stored at that address and the accumulator.