diff options
author | zedarider <ymherklotz@gmail.com> | 2016-02-26 21:40:24 +0000 |
---|---|---|
committer | zedarider <ymherklotz@gmail.com> | 2016-02-26 21:40:24 +0000 |
commit | 6d8f08b4727e5630e547d0afbf39c819a43945f6 (patch) | |
tree | 1f3fcb0185e339aa7cd7a14ece31c4fa474de9a1 /ARM_assembly/MultProject/SudoCode.txt | |
parent | 110c42733ff3decdb62bc4347626489a2677d99b (diff) | |
download | imperial_2015-6d8f08b4727e5630e547d0afbf39c819a43945f6.tar.gz imperial_2015-6d8f08b4727e5630e547d0afbf39c819a43945f6.zip |
Adding ARM Assembly files
Diffstat (limited to 'ARM_assembly/MultProject/SudoCode.txt')
-rw-r--r-- | ARM_assembly/MultProject/SudoCode.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ARM_assembly/MultProject/SudoCode.txt b/ARM_assembly/MultProject/SudoCode.txt new file mode 100644 index 0000000..a4dc6ad --- /dev/null +++ b/ARM_assembly/MultProject/SudoCode.txt @@ -0,0 +1,22 @@ +Sudo code for SMULT64X64: + +let result be split into result0 and result1 where they correspond to the 64 LSBs and MSBs of result respectively. + +void SMULT64X64(num0, num1, result) { + + 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; + } + + result = result >> 1; + previousBit = currentBit; + } +} |