MIME-Version: 1.0 Server: CERN/3.0 Date: Monday, 16-Dec-96 23:18:52 GMT Content-Type: text/html Content-Length: 2373 Last-Modified: Monday, 13-Mar-95 14:33:34 GMT
In the problems below, you are asked to write several 68000 assembly language routines. While it is not required, we strongly suggest that you use BasePak to solve this problem set. In grading this problem set, we will forgive minor syntactic errors, but many occurrences of the same error will be penalized. All programs should be well commented, listing any assumptions you made about the problem and how the registers are used. Unless otherwise specified, assume callee-save conventions are being used. All problems count equally in the final grade.
D0 = 1101 0100 1000 0011
on entry to the code fragment,
then D1 should contain 7 on exit. The contents of D1 may be destroyed
by the fragment.
MOVE.L D0,-(A6)
5C5F
for i := 1 to n do begin x := x + 1; end;
while (i <> 0) do begin i := i-1; x := x+1; end;
repeat i := i-1; until (i = 0);
if (i < 0) then begin x := i; end else begin x := -i; end
case i of 1: x := -x; 2: x := 0; 3: x := x + 1; end;