Question: I need help fixing my code for this 6 4 - bit by 6 4 - bit multiplier that develops an assembly program which receives
I need help fixing my code for this bit by bit multiplier that develops an assembly program which receives two bit numbers x xABADEand y
xAABBCCperforms multiplication, and produces a bit product.
Each register should be bit. I got some help earlier but couldnt fully understand what was wrong with the code I originally had.
Can I please get some insight and help on whats wrong with my code?
loop
; main program loop
; insert your code here
; x xA BA DE
; y xAA BB CC
LDR rxBADE ; LSBx
LDR rxA ; MSBx
LDR rxCC ; LSBy
LDR rxAABB ; MSBy
; Clear the upper bits register
MOV r #
; Perform the multiplications
UMULL r r r r
UMULL r r r r
UMULL r r r r
UMULL r r r r
; Combine the results
ADDS r r r ; Add the middle parts
ADCS r r # ; Add the carry to the most significant part
ADDS r r r ; Add the lower parts
ADCS r r # ; Add the carry to the middle parts
ADDS r r r ; Add to the second most significant part
ADCS r r r ; Finally, add the carry to the most significant part
; Store the results in registers
MOV r r ; Least significant part
MOV r r ; Second least significant part
MOV r r ; Most significant part
B loop ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
