Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Write a program in Assembly for P3 Assembler and Simulator that for any given puzzle calculates the Manhattan distance from the empty space to

a) Write a program in Assembly for P3 Assembler and Simulator that for any given puzzle calculates the Manhattan distance from the empty space to the inferior right corner. The program should have has an entry a vector of 16 positions, wich representes a given puzzle , showed in memory sequence , from the position 8000h. The exit of the program, i.e the Manhattan distance asked , should be in R1. If there is an error , should be returned in R1 the value of FFFFh.

b) Write a program in Assembly for P3 Assembler and Simulator that takes a given puzzle as an entry , in the same format as the previous point , and returns in R2 the total number of inversions of each of the 16 positions of the puzzle board till the final position. In case there is an error shoud be returned in R2 the value of FFFFh.

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions