What is the operation performed by the following assembly language program of 8051?

             CLR        A

             MOV       R1, # 100H

             MOV       R7, # 21H

AGAIN: MOV      @ R1, A

             INC         R1

             DJNC      R7, AGAIN

This question was previously asked in
UGC NET Paper 2: Electronic Science 29 Oct 2022 Shift 1
View all UGC NET Papers >
  1. Clears the 21 RAM locations starting from address 100 H
  2. Clears 100 RAM locations starting from address 21 H
  3. Clears 33 RAM locations starting from address 100 H
  4. Clears 33 RAM locations starting from address 21 H

Answer (Detailed Solution Below)

Option 1 : Clears the 21 RAM locations starting from address 100 H
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
10.8 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

 Assembly program of 8051:

8051 microcontroller is the CISC based Harvard Architecture and it has peripherals like 32 I/O, timers/counters, serial communication and memories. 

The microcontroller requires a program to perform the operations that require a memory for saving and to read the functions. The 8051 microcontroller consists of RAM and ROM memories to store instructions.

 Step 1: CLR A: It clears the Accumulator value and make all bits set to 0. [A= 0]

 Step 2: MOV  R1, # 100H : The # symbol represents the value being data. This instruction means the value 100H is moved to the register R1.

 [ R1=100]

 Step 3: MOV R7, # 21H : This instruction means the value 21H is moved to the register R7. [ R7=100]

 Step 4: AGAIN: MOV @ R1, A

 Step 5:INC R1

 Step 6: DJNC R7, AGAIN

 In the above instructions, MOV @ R1, A, will copy the contents of memory whose address is in R1 to the accumulator.

INC R1 : it increments the register value by 1.

DJNC R7: It decrements the register R7 by one and jump to the step 4 if the value in R7 is not zero and the loop continues until the value in the R7 decrements to Zero.

From the above mentioned steps, it is clear that the above program clears the 21 RAM locations starting from address 100 H.

 

Hence option 1 is correct.

Latest UGC NET Updates

Last updated on Jun 11, 2025

-> The UGC NET Exam Schedule 2025 for June has been released on its official website.

-> Check UPSC Prelims Result 2025, UPSC IFS Result 2025, UPSC Prelims Cutoff 2025, UPSC Prelims Result 2025 Name Wise & Rollno. Wise

-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.

-> The UGC NET 2025 online application form submission closed on 12th May 2025.

-> The June 2025 Exam will be conducted from 21st June to 30th June 2025

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

Get Free Access Now
Hot Links: teen patti gold new version teen patti master gold download teen patti master list teen patti customer care number teen patti 51 bonus