From 0b12ba0ca00f7cdfb50b614fb24b673fb7e4e322 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Fri, 14 Jul 2023 07:25:31 -0700 Subject: initial code --- example/test_files/cycle | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 example/test_files/cycle (limited to 'example/test_files/cycle') diff --git a/example/test_files/cycle b/example/test_files/cycle new file mode 100644 index 0000000..e5fc1d3 --- /dev/null +++ b/example/test_files/cycle @@ -0,0 +1,17 @@ +mov tortoise $0 +mov hare $0 +mov cycle_found $0 +label loop + ; tortise = tortoise->next + load tortoise tortoise + ; hare = hare->next->next + load hare hare + load hare hare + ; are_eq = (tortoise == hare) + mov are_eq tortoise + eq are_eq hare + ; cycle found? + ite are_eq cycle loop +label cycle + mov cycle_found $1 +end -- cgit v1.2.3