// R0 = dividend, R1 = divisor main: movi R0, #0x41 movi R1, #0x0d movi R2, #0 movi R3, #0 movi R4, #0 movi R5, #0 movi R6, #0 movis R6, #0xe0 bl R7, is_divisible_by_assembly /* * If your PART 1 code works, then when the CPU halts: * - register r0 holds 0x0000 * - registers r2, r3, r4, and r5 hold 0x0000 * - register r6 is 0xe000 * - at address 0xffff is the value 0xffff */ halt #0x7ff /*** --- DO NOT EDIT THIS LINE OR ANYTHING ABOVE THIS LINE --- ***/ /* YOUR FILE-HEADER COMMENT HERE */ is_divisible_by_assembly: /** * Calculate if the dividend is evenly divisible by the divisor. * * SPECIAL RESTRICTION: This assembly function may * not use multiplication, division, or modulo division operator. * * Note: a dividend of zero is always divisible by the divisor. * * Return 1 if the dividend is evenly divided, 0 otherwise. * * As a reminder, ULNAv2-B uses this calling convention: * R0 - holds first function parameter, and holds return value * R1 - holds second function parameter * R2, R3, R4, R5 - callee saved * R6 - stack pointer * R7 - link register (holds return address) * You are responsible for preserving registers R3-R5, and restoring * the stack when you are done. */ /* YOUR PART 1 CODE HERE */ br R7