Technical discussions about Freescale Microcontrollers: M68HC11. (Freescale Semiconductor is a Subsidiary of Motorola).
|
Cant seem to figure it out.. tryin to write a program that does a 8 by 8 bit SIGNED multiplication. s0 basicallym implementing the 2's compliment |
|
|
|
This sounds like homework, so I won't code it for you but I'll tell you the basic steps. 1. XOR the two signs together and you've got the sign of the result. 2. Convert either negative number to positive (there's an instruction for the two's complement at the assembly language level). 3. Multiply the two, now positive, numbers. 4. If the sign of the result in step [1] was negative, get the two's complement of the result in step [3]. ----- Original Message ----- From: "aznxstryder" <> To: <> Sent: Tuesday, October 12, 2004 8:14 AM Subject: [m68HC11] Need Some help with this!!!!! > > Cant seem to figure it out.. > tryin to write a program that does a 8 by 8 bit SIGNED multiplication. > s0 basicallym implementing the 2's compliment |