aboutsummaryrefslogtreecommitdiff
path: root/sts/common/print.sts
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-10-18 18:22:31 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-10-18 18:22:31 +0300
commitdf0d6a4503a26508553510b4050eaa79f52e4e4e (patch)
tree2517b6070319270a4cb0df9dcf3814b16ecaece9 /sts/common/print.sts
parent9eadc7bac8863b7fd3a39edc9ba31cf4d3b5ab95 (diff)
downloadcryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.tar
cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.tar.xz
cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.zip
Another step to release.
Diffstat (limited to 'sts/common/print.sts')
-rw-r--r--sts/common/print.sts30
1 files changed, 30 insertions, 0 deletions
diff --git a/sts/common/print.sts b/sts/common/print.sts
new file mode 100644
index 0000000..a3bea56
--- /dev/null
+++ b/sts/common/print.sts
@@ -0,0 +1,30 @@
+defword get_hex
+ f and
+ dup 9 > if
+ a - 'a' +
+ else
+ '0' +
+ fi
+exit
+
+defword print_hex
+ dup 1c shr get_hex sys_write
+ dup 18 shr get_hex sys_write
+ dup 14 shr get_hex sys_write
+ dup 10 shr get_hex sys_write
+ dup c shr get_hex sys_write
+ dup 8 shr get_hex sys_write
+ dup 4 shr get_hex sys_write
+ get_hex sys_write
+exit
+
+defword print_stack
+ dup
+ do
+ over over - 2 + get print_hex
+ 1 - dup 0 = until
+ space sys_write
+ od newline sys_write
+ drop
+ drop
+exit