Question: MUST BE IN 68000 ASSEMBLY LANGUAGE OR ELSE IT WILL BE WRONG!!! Last answer I got someone replied in a high level language(java). MUST BE
MUST BE IN 68000 ASSEMBLY LANGUAGE OR ELSE IT WILL BE WRONG!!! Last answer I got someone replied in a high level language(java). MUST BE DONE IN ASSEBLY LANGUAGE!
Implement the following arithmetic function which involves summation and square computations. The only input to the function is variable (a) that is initialized in register D0 at the beginning of the program to 10 and maintained thereafter. The X calculation result (X) is stored in D1 and the Y calculation result (Y) is stored in D2. The final answer (F) is stored in D3. For testing purposes, keep the above registers D0-D3 for their designated assignment (i.e. do not use them for temporary calculations).

Write a 68000 assembly language program starting at address $0900 which implements the above function using the following program layout:
ORG $0900 ;START PROGRAM AT THIS ADDRESS
LAB2 MOVE.L #10,D0 ;INITIALIZE INPUT VARIABLE (A) TO 10
CLEAR CLR.L D1 ;CLEAR D1 FOR X RESULT (X)
CLEAR CLR.L D2 ;CLEAR D2 FOR Y RESULT (Y)
CLEAR CLR.L D3 ;CLEAR D3 FOR F RESULT (F)
XCALC ... ... ;THE X CALCULATION PART OF YOUR PROGRAM
... ... ;TAKING VALUE OF D0 AS AN INPUT
... ... ;AND RETURNING RESULT (X) IN D1
YCALC ... ... ;THE Y CALCULATION PART OF YOUR PROGRAM
... ... ;TAKING VALUE OF D0 AS AN INPUT
... ... ;AND RETURNING RESULT (Y) IN D2
FCALC ... ... ;THE FINAL PART OF YOUR PROGRAM
... ... ;TAKING INPUTS FROM D1 AND D2
... ... ;AND RETURNING RESULT (F) IN D3
MOVE.B #228,D7
TRAP #14
END
- where I = and y = (a + 2)2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
