This commit is contained in:
Christian Lincoln 2026-02-19 16:32:58 +00:00
parent d4d0fba880
commit 28f25c5937
5 changed files with 258 additions and 38 deletions

36
main.silly Normal file
View file

@ -0,0 +1,36 @@
// how much to shift divisor by
$shiftrange={15}
/* the difference between dividend and
multiplied */
$difference={14}
// the thing we multiplied ^ by
$multiplied={13}
// what we're using to subtract right now
$attacker={12}
$one={11}
$zero={10}
$dividend={0}
$divisor={1}
$quotient={2}
$remainder={3}
// Load some stuff
li $shiftrange 16
li $multiplied 1
li $zero 0
mul $quotient $quotient $zero
mul $remainder $remainder $zero
add $one $multiplied $zero
// shift multiplied
shl $multiplied $shiftrange
// main loop
repeat16{
shr $multiplied $one
mul $attacker $multiplied $divisor
sub $difference $attacker $dividend
jp $difference 3
add $quotient $quotient $multiplied
sub $dividend $dividend $attacker
}
add $remainder $remainder $dividend :final