From b1713744c966c379ea85c80e4d5f53d52b2e29d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Tue, 18 Jun 2024 18:49:57 +0500 Subject: [PATCH] Add std/string/array/swap.lb --- std/string/array/swap.lb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 std/string/array/swap.lb diff --git a/std/string/array/swap.lb b/std/string/array/swap.lb new file mode 100644 index 0000000..583625f --- /dev/null +++ b/std/string/array/swap.lb @@ -0,0 +1,21 @@ +@ 0 ; Get both arguments + args 0 + size + #exec std/string/array/rev.lb + + args 1 + dup + ; |str_size str_size...> + +@ 1 + + kjz 2 + #expr - + args 1 + #exec std/rot.lb + #exec std/rot.lb + jmp 1 + +@ 2 + pop + #exec std/string/array/rev.lb