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
Acquisition of resources from an external source is called?
densk [106]

Answer:

subcontracting

Explanation:

I hope this is right

6 0
3 years ago
Choose the three questions that an engineer should ask himself or herself when identifying the need of a problem.
boyakko [2]

Answer:

What is the goal? What will a successful solution look like? What is it that the client expects me to accomplish?

Explanation:

5 0
2 years ago
Read 2 more answers
A driver complains that his front tires are wearing
Margarita [4]

Answer:

The correct option is;

Neither A nor B

Explanation:

The location of the where the thread wears in tire that has too high inflation is at the thread pattern center due to the reduced size of the contact patch with the load of the car resting on the central portion of the tire's contact surface

When the wear occurs at the outer edges of the tire, the load of the car rests on the outer edges as the contact patch increases due to the tire being under-inflated

Camber is the slope provided in road pavement to drain off water from the road

Roads with camber has a raised middle portion and wear due to camber includes outer-edge tread wear, inner-edge tread wear and tire feathering

8 0
3 years ago
How do Consumers sometimes interact with a producers?
Vika [28.1K]
I really don’t know good luck
7 0
3 years ago
Examples of reciprocating motion in daily life
bonufazy [111]

Answer:

Examples of reciprocating motion in daily life are;

1) The needles of a sewing machine

2) Electric powered reciprocating saw blade

3) The motion of a manual tire pump

Explanation:

A reciprocating motion is a motion that consists of motion of a part in an upward and downwards (\updownarrow) or in a backward and forward (↔) direction repetitively

Examples of reciprocating motion in daily life includes the reciprocating motion of the needles of a sewing machine and the reciprocating motion of the reciprocating saw and the motion of a manual tire pump

In a sewing machine, a crank shaft in between a wheel and the needle transforms the rotary motion of the wheel into reciprocating motion of the needle.

8 0
3 years ago
Other questions:
  • Work-producing devices that operate on reversible processes deliver the most work, and work-consuming devices that operate on re
    6·1 answer
  • Compute the fundamental natural frequency of the transverse vibration of a uniform beam of rectanqular cross section, with one e
    11·2 answers
  • A capillary tube is immersed vertically in a water container. Knowing that water starts to evaporate when the pressure drops bel
    11·1 answer
  • What causes decay in the amplitudes of vibration?
    11·1 answer
  • Determine the average power, complex power and power factor (including whether it is leading or lagging) for a load circuit whos
    9·2 answers
  • 8- Concentration polarization occurs on the surface of the.......
    15·1 answer
  • Could I please get help with this​
    11·1 answer
  • Hey any one ride dirtbikes here
    5·2 answers
  • The notation on one's license that the person must wear glasses
    9·1 answer
  • What is the correct procedure for mounting the m240 on the m122a1 tripod after the pintle is attached to the receiver?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!