Develop an assembly language program for 89c51 to do following {Marks 10} Store any 8 values of...

90.2K

Verified Solution

Question

Advance Math

  1. Develop an assembly language program for 89c51to do following {Marks 10}
  1. Store any 8 values of one byte each anywhere in Scratch Padarea of RAM. You are bound to use loop to store values.
  2. Find Mean of these 8 values (use shift operator for division)and send it to port P2 (formula for to find mean is givenbelow)
  3. Find the lowest number among the numbers saved in part (1),take its 2’s complement and send it to P3

Formula for mean

?=i=1nXin

Where X is values,and n is total number of values

  1. Develop an assembly language program for 89c51to do following
  1. Store any 8 values of one byte each anywhere in Scratch Padarea of RAM. You are bound to use loop to store values.
  2. Find Mean of these 8 values (use shift operator for division)and send it to port P2 (formula for to find mean is givenbelow)
  3. Find the lowest number among the numbers saved in part (1),take its 2’s complement and send it to P3

Formula for mean

?=i=1nXin

Where X is values,and n is total number of values

Answer & Explanation Solved by verified expert
4.1 Ratings (471 Votes)
Here the RAM of 89c51 is given as followsTherefore we can store the 8 8bit values in the scratchpadarea 30H 7FHInstructions in 89c51MOV It copies a value from one location toanotherSyntax MOV destination sourceADD This instruction adds a source operand with the content ofaccumulator and store the result in accumulatorSyntax ADD A source operandDIV Divides the unsigned value of the Accumulator by the unsignedvalue of the B register The resulting quotient is placed in theAccumulator and the remainder is placed in the B registerSyntax DIV ABINC It increments the register value by 1Syntax INC register This instruction incremets the address inregisterDJNZ It is a conditional instruction which first decremet thecorresponding stored value and jump to the destination whether theresult    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students