Write Program Assembly P3 Assembler Simulator Given Puzzle Calculates Manhattan Distance E Q43901721
a) Write a program in Assemblyfor P3 Assembler and Simulator that for any given puzzle calculatesthe Manhattan distance from the empty space to the inferior rightcorner. The program should have has an entry a vector of 16positions, wich representes a given puzzle , showed in memorysequence , from the position 8000h. The exit of the program, i.ethe Manhattan distance asked , should be in R1. If there is anerror , should be returned in R1 the value of FFFFh.
b) Write a program in Assemblyfor P3 Assembler and Simulator that takes a given puzzle as anentry , in the same format as the previous point , and returns inR2 the total number of inversions of each of the 16 positions ofthe puzzle board till the final position. In case there is an errorshoud be returned in R2 the value of FFFFh.
Expert Answer
Answer to a) Write a program in Assembly for P3 Assembler and Simulator that for any given puzzle calculates the Manhattan distanc…
OR