forked from TCShenanigans/symphony_stdlib
add integer multiply
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
pub mul_low:
|
||||||
|
mov r3, 0 ; result
|
||||||
|
mov r4, 31 ; loop counter
|
||||||
|
|
||||||
|
mull_loop:
|
||||||
|
asr r5, r2, 31
|
||||||
|
and r5, r5, r1
|
||||||
|
lsl r5, r5, r4
|
||||||
|
add r3, r3, r5
|
||||||
|
lsl r2, r2, 1
|
||||||
|
sub r4, r4, 1
|
||||||
|
cmp r4, 0
|
||||||
|
jge mull_loop
|
||||||
|
mov r1, r3
|
||||||
|
|
||||||
|
jmp r13
|
||||||
+2
-1
@@ -27,4 +27,5 @@
|
|||||||
|
|
||||||
; ===== TYPES =====
|
; ===== TYPES =====
|
||||||
|
|
||||||
pub include bit
|
pub include bit
|
||||||
|
pub include imath
|
||||||
Reference in New Issue
Block a user