Question: Hello, I have a question I would appreciate it if someone could help me. I have 15 min for this question. The task consists of

Hello, I have a question I would appreciate it if someone could help me. I have 15 min for this question.

The task consists of two parts: A and B. You should first solve part A of the assignment and then, depending on the result obtained, solve one of the four variants of part B of the task.

PART A:

In Motorola 68000 assembly (use Easy68K or any other) please execute the following program, by entering your (five digits) student's ID number:

 MOVE.L #student_ID_number,D0 // i.e. #76708 MOVEQ #3,D1 AND.L D1,D0 SIMHALT

As a solution to part A of the problem, a pair of numbers should be returned:

your student's index number, and

the result (number) obtained in the D0 register after the execution of the above program.

The obtained pair of numbers should be written in the content of part A of the problem!

PART B:

Depending on the result obtained in the D0 register (possible options are 0, 1, 2 or 3) after executing program in Part A of the tasks, one of the following 4 tasks must be undertaken and solved accordingly:

0) If obtained by you result in the register D0 is equal to #0

Please write a Motorola 68000 assembly program that will replace pairs of values of adjacent even and odd bits in the 16-bit data register D5 (in such a way that bit # 15 changes the value with bit # 14, bit #13 with bit #12 , etc.).

In addition, the even bits (such a 2, 4, ..) and zero bit of the result should be cleared and the odd bits (1,3,5,..) inverted!

1) If obtained by you result in the register D0 is equal to #1

Please write a Motorola 68000 assembly program that will replace pairs of values of adjacent even and odd bits in the 16-bit data register D5 (in such a way that bit #15 changes the value with bit #14, bit #13 with bit #12 , etc.).

In addition, the odd bits of the result should be cleared and the even bits and zero bit inverted!

2) If obtained by you result in the register D0 is equal to #2

Please write a Motorola 68000 assembly program that will replace pairs of values of adjacent even and odd bits in the 16-bit data register D5 (in such a way that bit # 15 changes the value with bit #14, bit #13 with bit #12 , etc.).

In addition, the bits numbers from #8 to #15 of the result should be cleared and the bits from #0 to #7 inverted!

3) If obtained by you result in the register D0 is equal to #3

Please write a Motorola 68000 assembly program that will replace pairs of values of adjacent even and odd bits in the 16-bit data register D5 (in such a way that bit #15 changes the value with bit #14, bit #13 with bit #12 , etc.).

In addition, the bits numbers from #0 to #3 and #7 to #11 of the result should be cleared and the bits from #4 to #7 and #12 to #15 inverted!

The program should be able to be encoded in no more than 10 instructions. I suggest to use Easy68K assembler or other Motorola 68000 processor simulator to write and verify the program.

The program output code should be pasted as a solution to the task!

ATTENTION (Very Important)! Part B of the task will be assessed only if part A of the task is correctly solved (based on your own student's index number) and an appropriate program variant is developed on its basis!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!