Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an LC - 3 assembler program that checks whether the player is within a certain Manhattan distance of a specified goal point. a )

Write an LC-3 assembler program that checks whether the player is within a certain Manhattan
distance of a specified goal point.
a) Place your code in the assembly file manhattan_dist.asm.
b) The assembly file contains predefined constants, G_X, G_Y and G_Z, that specify the
position of the goal point.
c) An additional predefined constant, GOAL_DIST, specifies the distance bound to be checked.
You may assume that GOAL_DIST >0.
d) The Manhattan distance between the player and the goal point is given by:
dmanhattan =|(playerPos.x - G_X)|+|(playerPos.y - G_Y)|+|(playerPos.z - G_Z)|
If this inequality is met, the program should output The player is within Manhattan
distance of the goal to Minecraft chat. Otherwise, it should output the following string to
the Minecraft chat: The player is outside the goal bounds.
Starter code in the file,
.ORIG x3000
HALT
; Note: Please do not change the names of the constants below
G_X .FILL #7
G_Y .FILL #-8
G_Z .FILL #5
GOAL_DIST .FILL #10
.END
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

Develop skills for building positive relationships.

Answered: 1 week ago

Question

Describe techniques for resolving conflicts.

Answered: 1 week ago

Question

Give feedback effectively and receive it appropriately.

Answered: 1 week ago