`Hi all, i'm doing a course on the HC11 and i've been assigned a`

project that computes the distance between two points (given the

change in height and length) thus using pythagoras to compute the

hypoutenuse. I'm totally lost and stuck, since i'm not much of a

programmer...at all

So i'd appreciate any help at all!

here's the question:

The distance function, L2(x,y) computes the Euclidean distance

between two points, whose x

coordinates differ by x and whose y coordinates differ by y.

Mathematically, the distance function

is given by L2(x,y) = p(x)2 + (y)2.

Your job will be to write a subroutine that computes L2(x,y), but

only for unsigned integers.

Download and unzip the care package a3-care.zip to your floppy drive

A:.

Again, these contain the skeleton and a sample A3Q3.ASM subroutine

which you will complete.

The Specification:

The subroutine L2 takes two 8-bit parameters as input on the stack.

These represent the unsigned

integers x and y.

The stack frame is set up by the skeleton. One byte is reserved for

the return value, and then

both parameters are pushed.

L2 will compute the function L2(x,y) = jp(x)2 + (y)2k and store

the result on the stack.

[Note the addition of the floor function.]

In the cases for which L2(x,y) > 255, L2 shall return 255.

You will use a working version of the sqrt function from Assignment

2 to simplify your code.

The model solution for sqrt is included within the care package. Be

sure to properly observe the

function protocols!

Once done the computation, your code shall perform an rts operation.

Your code may not use any fixed memory to complete its task, but may

use the stack.

There are no scratch registers available, so make sure you save and

restore any registers you use.

You will not modify the skeleton code, except in the inputs. Thnx guys!

project that computes the distance between two points (given the

change in height and length) thus using pythagoras to compute the

hypoutenuse. I'm totally lost and stuck, since i'm not much of a

programmer...at all

So i'd appreciate any help at all!

here's the question:

The distance function, L2(x,y) computes the Euclidean distance

between two points, whose x

coordinates differ by x and whose y coordinates differ by y.

Mathematically, the distance function

is given by L2(x,y) = p(x)2 + (y)2.

Your job will be to write a subroutine that computes L2(x,y), but

only for unsigned integers.

Download and unzip the care package a3-care.zip to your floppy drive

A:.

Again, these contain the skeleton and a sample A3Q3.ASM subroutine

which you will complete.

The Specification:

The subroutine L2 takes two 8-bit parameters as input on the stack.

These represent the unsigned

integers x and y.

The stack frame is set up by the skeleton. One byte is reserved for

the return value, and then

both parameters are pushed.

L2 will compute the function L2(x,y) = jp(x)2 + (y)2k and store

the result on the stack.

[Note the addition of the floor function.]

In the cases for which L2(x,y) > 255, L2 shall return 255.

You will use a working version of the sqrt function from Assignment

2 to simplify your code.

The model solution for sqrt is included within the care package. Be

sure to properly observe the

function protocols!

Once done the computation, your code shall perform an rts operation.

Your code may not use any fixed memory to complete its task, but may

use the stack.

There are no scratch registers available, so make sure you save and

restore any registers you use.

You will not modify the skeleton code, except in the inputs. Thnx guys!