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

a) Write an MC68000 subroutine MUL_SUB and a macro MUL_MAC that implement unsign

ID: 3685944 • Letter: A

Question

a) Write an MC68000 subroutineMUL_SUB and a macro MUL_MAC that implement unsigned multiplication of two 16 bit numbers without using the mulu ormuls instruction (for example, use multiple additions to implement multiplication). For the subroutine, pass parameters using data registers.

b) Write an MC68000 assembly program that reads two 16-bit numbers stored at memory locations X and Y, calls MUL_SUB and MUL_MAC and compares both results, then based on the outcome of the comparison displays a message: “CORRECT” or “INCORRECT” on the screen.

Explanation / Answer

wdn, an address - for storing result d0 flag, 0 or 2 - to choose between Julian or Gregorian, respectively date, year0mda - date stamp as binary word&byte&byte in basic ISO-format year, year (YEAR = DATE due to big-endianess) move.l DATE,d0 move.l d0,d1 APPLY STEP 1 - LACHMAN'S METHOD OF CONGRUENCE andi.l #$f00,d0 divu #100,d0 addi.w #193,d0 andi.l #$ff,d0 divu #100,d0 ; d0 contains the Month Index in the upper word APPLY STEP 2 - USING SPQR AS A JULIAN YLLD swap d0 andi.l #$ffff,d0 add.b d1,d0 add.w YEAR,d0 subi.l #$300,d1 lsr #2,d1 swap d1 add.w d1,d0 ; SPQR/4 + year + MI + da (APPLY STEP "0" - GREGORIAN ADJUSTMENT) mulu FLAG,d1 divu #50,d1 mulu #25,d1 lsr #2,d1 add.w d1,d0 add.w FLAG,d0 ; (SP32div16) + SPQR/4 + year + MI + da divu #7,d0 swap d0 ; d0.w becomes the day-number move.w d0,WDN ; returns the day-number to location WDN rts Days of the week correspond to day-numbers of the week as: Sun=0 Mon=1 Tue=2 Wed=3 Thu=4 Fri=5 Sat=6

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote