Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (15 pts) The following 68000 assembly language instructions are all incorrect

ID: 3881828 • Letter: 1

Question

1. (15 pts) The following 68000 assembly language instructions are all incorrect. In each case, what specifically is the error? (Hint: Consult the 68000 Instruction Set) a. EXT.B DO b. CMP.B #10, #20 C. ASR.W #9, D3 d, RTS.B e. EOR.W (A1)+, D5 f. ANDI D1, D2 g. CLR.L A4 h. SWAP A3 1. ADDQ.L #14, D1 j. MOVEA.B #9, A1 2. (5 pts) Describe the following 68000 condition code register (CCR) flags a. Z b. N C. C d. V 3. (10 pts) Translate this high level language into 68000 assembly language. Assume the labels 'T', 'X', and have already been defined as references to specific memory addresses. if T is greater than 10 then X=3 else Y=6 end if 4. (10 pts) Explain what the following 68000 assembly language does. Describe each line of code AND describe the overall effect of the program. MOVE.B #10, D1 MOVEAL #$500, A1 (A1) LOOP CLR.L ADD.L #4, A1 SUB.B #1, D1 BNE LOOP #$1000 STOP

Explanation / Answer

//use compare and branch to execute the high level into machine level. cmp will compare the if condition and accordingly your program will jump to else block or execute the current if block. In either way it will reach the end_if block after executing the commands.

CMP T,10

BLT else; jump to else part if T is less than 10

MOVE X,3

BRA end_if

else:

MOVE Y,6

end_if: