From 0cf44154047325a85eb1ab67c4d5b14c09dadfe9 Mon Sep 17 00:00:00 2001 From: exegete Date: Fri, 16 Oct 2020 18:21:27 +0300 Subject: else, do until macro --- ia32/macro.sts | 22 ++++++++++++++++++++++ main.sts | 10 ++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ia32/macro.sts b/ia32/macro.sts index efd062e..3842a5c 100644 --- a/ia32/macro.sts +++ b/ia32/macro.sts @@ -48,3 +48,25 @@ [ fi 0 ?$ ?swap ?! ] + +[ else 0 + branch ?$ # 0 ?. + ?swap ?$ ?swap ?! +] + +[ do 0 + ?$ +] + +[ untilod 0 + 0branch ?. +] + +[ until 0 + 0 = 0branch ?$ # 0 ?. +] + +[ od 0 + branch ?swap ?. + ?$ ?swap ?! +] diff --git a/main.sts b/main.sts index 9bd7a63..18964bb 100644 --- a/main.sts +++ b/main.sts @@ -1,8 +1,14 @@ module ia32/elf/begin.sts set_entry - 30 31 32 - 33 0 set 34 1 set 35 2 set + + do + 34 sys_write + sys_read + 0 = until + sys_write + od + drop sys_exit module ia32/elf/end.sts -- cgit v1.2.3