1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
My name is Ann [436]
3 years ago
12

LC3 Programming ProblemUse .BLKW to set up an array of 10 values, starting at memory location x4000, as in lab 4.Now programmati

cally populate the array with the numbers 0 through 9 – i.e. hard-code just the firstvalue (0), then calculate the rest one at a time, storing them in the array as you go.After you've stored them all, grab the seventh value (which would be 6) and store it in R2.As always, step through your program and examine the values as they are stored in the array, andexamine the final value stored in R2, to make sure your program works as expected.
Engineering
1 answer:
irga5000 [103]3 years ago
7 0

Answer:

Check the explanation

Explanation:

Code

.ORIG x4000

;load index

LD R1, IND

;increment R1

ADD R1, R1, #1

;store it in ind

ST R1, IND

;Loop to fill the remaining array

TEST LD R1, IND

;load 10

LD R2, NUM

;find tw0\'s complement

NOT R2, R2

ADD R2, R2, #1

;(IND-NUM)

ADD R1, R1, R2

;check (IND-NUM)>=0

BRzp GETELEM

;Get array base

LEA R0, ARRAY

;load index

LD R1, IND

;increment index

ADD R0, R0, R1

;store value in array

STR R1, R0,#0

;increment part

INCR

;Increment index

ADD R1, R1, #1

;store it in index

ST R1, IND

;go to test

BR TEST

;get the 6 in R2

;load base address

GETELEM LEA R0, ARRAY

;Set R1=0

AND R1, R1,#0

;Add R1 with 6

ADD R1, R1, #6

;Get the address

ADD R0, R0, R1

;Load the 6th element into R2

LDR R2, R0,#0

;Display array contents

PRINT

;set R1 = 0

AND R1, R1, #0

;Loop

;Get index

TOP ST R1, IND

;Load num

LD R3,NUM

;Find 2\'s complement

NOT R3, R3

ADD R3, R3,#1

;Find (IND-NUM)

ADD R1, R1,R3

;repeat until (IND-NUM)>=0

BRzp DONE

;load array address

LEA R0, ARRAY

;load index

LD R1, IND

;find address

ADD R3, R0, R1

;load value

LDR R1, R3,#0

;load 0x0030

LD R3, HEX

;convert value to hexadecimal

ADD R0, R1, R3

;display number

OUT

;GEt index

LD R1, IND

;increment index

ADD R1, R1, #1

;go to top

BR TOP

;stop

DONE HALT

;declaring variables

;set limit

NUM .FILL 10

;create array

ARRAY .BLKW 10 #0

;variable for index

IND .FILL 0

;hexadecimal value

HEX .FILL x0030

;stop

.END

You might be interested in
Two players find themselves in a legal battle over a patent. The patent is worth 20 for each player, so the winner would receive
Alborosie

Answer:

The solution and complete explanation for the above question and mentioned conditions is given below in the attached document.i hope my explanation will help you in understanding this particular question.

Explanation:

5 0
3 years ago
thermodynamics A nuclear power plant based on the Rankine cycle operates with a boiling-water reactor to develop net cycle power
IrinaK [193]

Answer:

(a) the percent thermal efficiency is 27.94%

(b) the temperature of the cooling water exiting the condenser is 31.118°C

Explanation:

3 0
3 years ago
2. What is an important aspect of the American free enterprise system that encourages people to
rusak2 [61]
Have a positive mindset and attitude
7 0
4 years ago
Read 2 more answers
A rigid insulated tank is divided into 2 equal compartments by a thin rigid partition. One of the compartments contains air, ass
Illusion [34]
Https://www.slader.com/discussion/question/an-insulated-rigid-tank-is-divided-into-two-equal-parts-by-a-partition-initially-one-part-contains-4/



there will be the answer

6 0
3 years ago
Tahir travel twice as far as ahmed, but onley one third as fast. Ahmed starts travel on tuesday at noon at point x to point z 30
shepuryov [24]

Answer:

6:00 pm the next day

Explanation:

Given that

Tahir traveled twice as far as Ahmed. We say,

Ahmed traveled a distance, D

Tahir would travel a distan, 2D

Tahir traveled 1/3 as fast as Ahmed, so we say

Ahmed traveled at a speed, S

Tahir would travel at a speed, S/3

If Ahmed starts travel on tuesday at noon at point x to point z 300km, by 9:00pm,

Time taken by Ahmed to travel is

9:00 pm - 12:00 pm = 9 hours

Ahmed, traveled 300 km in 9 hours, meaning he traveled at 33.3 km in an hour.

Speed, S that Ahmed traveled with is 33.3 km/h

Remember, we stated that Tahir travels at a speed of S/3, that is, The speed of Tahir is

33.3/3 = 11.1 km/h.

300 km would then be traveled in 300 km/11.1 km/h = 27 hours.

Tahir started traveling, 3 hours after Ahmed, that is 12:00 pm + 3:00 hrs = 3:00 pm, and if he's to spend 27 hours on the journey he would reach destination z at 6:00 pm the next day

7 0
3 years ago
Other questions:
  • In the combination of resistors above, consider the 1.50 µΩ and 0.75 µΩ. How can you classify the connection between these two r
    6·1 answer
  • There are 30 students in a class. Choose the statement that best explains why at least two students have last names that begin w
    12·1 answer
  • A 860 kΩ resistor has 34 μA of current. What is the supply voltage for this electric circuit?
    13·2 answers
  • A water agency stated that waterlines cannot have water flowing faster than 8 ft/s. What is the minimum standard pipe diameter t
    12·1 answer
  • Steven is starting a project that requires a specialized, experienced contractor. Which selection process is the most suitable f
    11·1 answer
  • Which one of these is not a successful budgeting strategy
    5·2 answers
  • Please answer i dont understand and dont know the answer​
    14·1 answer
  • From the top of a vertical cliff 80m high, the angles of depression of 2 buoys lying due west of the cliff are 23° and 15° respe
    13·1 answer
  • Is reinforcement needed in a retaining wall
    5·2 answers
  • One of the best ways to increase engine power and control detonation and preignition is to?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!