From df0d6a4503a26508553510b4050eaa79f52e4e4e Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Sun, 18 Oct 2020 18:22:31 +0300 Subject: Another step to release. --- sts/ia32/macro.sts | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sts/ia32/macro.sts (limited to 'sts/ia32/macro.sts') diff --git a/sts/ia32/macro.sts b/sts/ia32/macro.sts new file mode 100644 index 0000000..fa9510b --- /dev/null +++ b/sts/ia32/macro.sts @@ -0,0 +1,86 @@ +[ next 0 + # ad ?' # ff ?' # 20 ?' +] + +[ defasm 1 + [ %1% 0 + _%0% ?. + \] + ?$ ?? _%1% + ?$ # 4 ?+ ?. +] + +[ defword 1 + [ %1% 0 + _%0% ?. + \] + ?$ ?? _%1% + _docol # 4 ?+ ?. +] + +[ defconst 2 + defasm %1% + # 68 ?' # %2% ?. ; push %2% + next +] + +[ defarr 2 + _data_segment ?choose + ?$ ?? _%1%_arr + # %2% # 4 ?* ?res + _code_segment ?choose + defasm %1% + # 68 ?' _%1%_arr ?. ; push _%1%_arr + next +] + +[ defvar 1 + defarr %1% 1 +] + +[ as 1 + _data_segment ?choose + defword %1% + lit ?$ # 0 ?. + exit + _code_segment ?choose + lit ?. ! +] + +[ literal 0 + lit # %1% ?. +] + +[ set_entry 0 + ?$ _threaded_code_entry ?! +] + +[ if 0 + 0branch ?$ # 0 ?. +] + +[ fi 0 + ?$ ?swap ?! +] + +[ else 0 + branch ?$ # 0 ?. + ?swap ?$ ?swap ?! +] + +[ do 0 + ?$ +] + +[ untilod 0 + 0branch ?. +] + +[ until 0 + 0 = 0branch ?$ # 0 ?. +] + +[ od 0 + branch ?swap ?. + ?$ ?swap ?! +] -- cgit v1.2.3