Skip to main content

8-bit addition program of the 8051

8 bit addition program of the 8051.

1)8-bit addition program simply use the 8 bit memory location to store  element that need to be add. We can use both the internal as well as the external memory location for the addition. In the following program we use the external memory location to fetch the data and add them.

program:


ORG 0000H;                   starting memory location
MOV B,#00H;                 load the 00h in the resistor b
MOV DPTR,#2000H;      load the memory pointer in the DPTR
MOVX A,@DPTR;           move  content of  memory location 2000h in the acc
MOV R2,A;                      store the content of the accumulator in the resistor R2
INC DPTR;                       increment memory pointer
MOVX A,@DPTR;           move the 2001h content into accumulator
ADD A,R2;                      add the both content
JNC SKIP;                        check if carry
INC B;                             if the carry generated increment the resistor B
SKIP: INC DPTR;            increment memory pointer
      MOVX @DPTR,A;      move the content of the acc into 2002h
      MOV A,B;                  move the content of the b in the acc
      INC DPTR;                increment the memory pointer
      MOVX @DPTR,A;     load the value of the acc in the 2003h
      END;                         stop



Comments

Popular posts from this blog

Delay generation technique in the 8085:

Delay generation technique in the 8085: There is a lot of the method for the delay generation in the 8085 one of the most commonly used one is with the help of the software. There is nothing complicated in the programming in all the technique same logic is applied so don't worry you will be fine............. Delay subroutine using the only 8-bit register:                                          MVI B, COUNT;                              LOOP: DCR B;                                          JNZ LOOP;                                          RET; calculation of  the count: The require coun...

Static switch

Static switch 1) Static switches use semiconductor elements such as SCR to perform the shifting of load between two power sources. 2)Circuit offers very fast switching time, usually in the range of the milliseconds. This help to maintain the uninterrupted power supply to the load. 3) The static switch consists of three parts:     a) Breaker.    b) SCR.    c)  Control system. 4) current sensing device constantly monitors the output of the switch and provide the necessary input to the control relay circuit. 5)If the AC source fails to supply the voltage to the load, the control circuit switches connection to the inverter input source. Block Diagram of the static switch is as follows: Application of the static switch: 1) The static switch is used in the UPS system. 

Antennas: Type of antennas

ANTENNAS: TYPE OF ANTENNAS Definition:   An antenna is a structure that is generally metallic object, often a wire or group of wire used to convert the high-frequency current into electromagnetic waves, and vice-versa Type of antennas: 1) Omni-directional antennas:  Omni-directional antennas propagate the radio wave signal in all horizontal directions.  Dipole antennas: This is the type of the omnidirectional antenna whose propagating radio frequency (RF) energy in 360 degrees in the horizontal plane. This antenna can be as simple as two pieces of wire cut to the proper length or can be encapsulated. An antenna exhibits a typical impedance, allowing antenna of the transmitter for maximum power transfer. Majority of the wireless access points and routers have these wireless antennas due to their reliable performance and uniform coverage. Example of omnidirectional antennas is   Rubber duck Omni Directional Antenna 2) S emi-direction...