

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Student Name:______________________________ Student ID: _______________
Problem 1 Provide the assembly code that can perform the following code.
Full credit for 5 instructions or less and 10 points off for every additional instruction. Assume that do_something โ a function in C โ is a subroutine in assembly.
Make sure no registers are altered by this code after completion.
Student Name:______________________________ Student ID: _______________
Problem 2
Write the equivalent C code for the assembly below. Assume J and K are global variables declared with ds.b directive that are signed integers in C.
J ds.b 1 K ds.b 1 โฆ
ldaa J cmpa #$F bne done cmpa #$ bne done movb #$00, K done: movb #$FF, K