ASM program to exhibit the RAM direct addressing

AIM: To exhibit the RAM direct addressing and bit addressing schemes of 8051 microcontroller.

ALGORITHM:

  1. For Bit addressing, Select Bank 1 of RAM by setting 3rd bit of PSW
  2. Using Register 0 of Bank 1 and accumulator perform addition
  3. For direct addressing provide the address directly (30 in this case)
  4. Use the address and Accumulator to perform addition
  5. Verify the results

PROGRAM:

        SETB	PSW.3
        MOV	R0,#data1
        MOV	A,#data2
        ADD	A,R0
        MOV	DPTR,#4500
        MOVX	@DPTR,A
HERE:	SJMP	HERE

Direct Addressing:

        MOV	30,#data1
        MOV	A,#data2
        ADD	A,30
        MOV	DPTR,#4500
        MOVX	@DPTR,A
HERE:   SJMP	HERE

OBSERVATION:

Bit addressing:

Input:54

25
Output:79 (4500)

Direct addressing:

Input:54

25
Output:79 (4500)

RESULT:

Thus the program to exhibit the different RAM addressing schemes of 8051 was executed.

Editorial Team
Editorial Team

We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in