I am new to assembler, using the 68HC11 processor. I need to multiply two SIGNED 8 bit numbers using the partial product-shift algorithm. Some help in the right direction would be helpful.
Thanks.

Here is what I have so far for my code.
SUM EQU $0100 ;Creates a location variable name with llocation $0101
ORG $0101 ;Start where the variables are stored
NUM1 FCB #$0005 ;Stores the value 05 in variable NUM1 at location $0101
NUM2 FCB #$05 ;Stores the value 05 in variable NUM2 at location $0102
Count FCB #$08 ;Decrement counter to check the C-Bit if its set to 1
ORG $C000 ;Start of Program Counter
LDD NUM1 ;Gets NUM1 value from location $0101
LDX #$0000 ;Stores values to be added for the final sum
LDAB Count ;Creates a roll counter that sets and resets the C bit
LDS #$0008
8_Bit JSR Check_C ;Loops until every bit is checked on the value in ACCB

BNE 8_Bit
STAA $0001 ;Stores the result in $0001
SWI ;Stops Execution
Check_C:
LDAA NUM2 ;Checks to see if C bit is set on ACCA
ROLA
BCS Add_Value ;If C bit is set to 1 then
RTS
Add-Value:
Start LDD NUM1 ;Loads the orginal number stored at NUM1
ROL ;Takes the number in D and shifts the bits to the left
DECB
BNE Start
STD $00,X
INX
RTS

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.