diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2023-07-14 07:25:31 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2023-07-14 07:25:31 -0700 |
commit | 0b12ba0ca00f7cdfb50b614fb24b673fb7e4e322 (patch) | |
tree | c8dc0b54c6f9df2f10185fc93f4276f1a8535802 /example/test_files/cycle |
initial code
Diffstat (limited to 'example/test_files/cycle')
-rw-r--r-- | example/test_files/cycle | 17 |
1 files changed, 17 insertions, 0 deletions
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 |