Question: 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
 Write an LC-3 assembler program that checks whether the player is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!