From de4ee10ee2649754c51f5c1096b2b77138b993a4 Mon Sep 17 00:00:00 2001 From: nihonium Date: Mon, 14 Mar 2022 22:52:46 +0300 Subject: [PATCH] solutions --- asm/solutions.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 asm/solutions.md diff --git a/asm/solutions.md b/asm/solutions.md new file mode 100644 index 0000000..f8ff1ae --- /dev/null +++ b/asm/solutions.md @@ -0,0 +1,46 @@ +# zero + +``` +xor eax, eax +``` + +# one +``` +xor eax, eax +inc eax +``` + +# next +``` +inc ax +``` + +# prev +``` +dec ax +``` + +# sum +``` +mov dx, ax +add dx, bx +``` + +# sub +``` +mov rdx, rax +sub rdx, rbx +``` + +# imul +``` +imul bl +mov dx, ax +``` + +# idiv +``` +cwd +idiv bx +mov dx, ax +```