Microcontroller Articles - Page 33 of 33

8051 Program to Add two 8 Bit numbers

Chandu yadav
Updated on 31-Oct-2023 02:58:32

35K+ Views

Intel 8051 is an 8-bit microcontroller. It has many powerful instructions and IO accessing techniques. In this section, we will see one of the simplest program using 8051.Here we will add two8-bit numbers using this microcontroller. The register A(Accumulator) is used as one operand in the operations. There are seven registers R0 – R7 in different register banks. We can use any of them as the second operand.We are taking two number 5FH and D8H at location 20H and 21H, After adding them, the result will be stored at location 30H and 31H.  AddressValue...20H5FH21HD8H...30H00H31H00H...ProgramMOVR0, #20H;set source address 20H to R0 ... Read More

Advertisements