diff options
Diffstat (limited to 'ARM_assembly/MultProject/CCode.c')
-rw-r--r-- | ARM_assembly/MultProject/CCode.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ARM_assembly/MultProject/CCode.c b/ARM_assembly/MultProject/CCode.c new file mode 100644 index 0000000..3657c68 --- /dev/null +++ b/ARM_assembly/MultProject/CCode.c @@ -0,0 +1,27 @@ +#include <stdio.h> + +void SMULT64X64(num0, num1, result0, result1) { + + previousBit = 0; + result0 = num0; + + for(int i = 0; i < 64; i++) { + currentBit = num0 & 1; + + if(currentBit == 0 && previousBit == 1) { + result1 += num1; + } else if(currentBit == 1 && previousBit == 0) { + result1 -= num1; + } + + result1 >> 1; + result0 >rrc> 1; + previousBit = currentBit; + } + printf("%d %d", result1, result0); +} + +int main() { + SMULT64X64(2, 3, 0, 0); + return 0; +} |