1. Engineering
  2. Computer Science
  3. this is the code i been working on but i...

Question: this is the code i been working on but i...

Question details

E2.7 Write a sequence of instructions to add the three numbers stored in data memory loca- tions at 0x2000, 0x2001, and 0x2002 and store the sum at data memory location at 0x2010.

This is the code I been working on, but I need help for some reason the last two lines are not correct (Atmel Studio Assembly)

;solution: To read three numbers from memory, then add them and store result ldi XL,exee ; let X point to ex2000 ldİXH,0x20 ; ldİ YLexal ; let Y point to 8x2001 ldǐ YH, 8x29 ; ldi ZL, exe2 ; let Z point to ex2002 ldi ZH, 0x29 ; ld re,x ;load the contents of ex2ee0 to re ld r1,Y load the contents of ex2001 to rl ld r2,Z ;load the contents of 0x2002 to r2 add r2,r1,re; add the two numbers std X+0x20,r1; store the sum at 0x2010 List e Solution 2 ErrorsWarnings 0 Messages Build IntelliSense Description ▲ Invalid register Wrong number of operands

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution