aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorexegete <nikitf-97@mail.ru>2020-10-17 17:52:20 +0300
committerexegete <nikitf-97@mail.ru>2020-10-17 17:52:20 +0300
commit53ccfab6c1f2ddad977ceedbdbbfa54a05b81070 (patch)
treee072ec761ec34569443d0234639a5185bcafa597 /common
parent65c54a8986b3519c1949d280e58f46af2eceff85 (diff)
downloadcryptrobber-53ccfab6c1f2ddad977ceedbdbbfa54a05b81070.tar
cryptrobber-53ccfab6c1f2ddad977ceedbdbbfa54a05b81070.tar.xz
cryptrobber-53ccfab6c1f2ddad977ceedbdbbfa54a05b81070.zip
stack print and etc
Diffstat (limited to 'common')
-rw-r--r--common/common.sts1
-rw-r--r--common/print.sts30
2 files changed, 31 insertions, 0 deletions
diff --git a/common/common.sts b/common/common.sts
index cc5f5ee..8a7f835 100644
--- a/common/common.sts
+++ b/common/common.sts
@@ -1,2 +1,3 @@
module common/macro.sts
module common/const.sts
+module common/print.sts
diff --git a/common/print.sts b/common/print.sts
new file mode 100644
index 0000000..9517307
--- /dev/null
+++ b/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
+ a sys_write
+exit
+
+defword print_stack
+ dup
+ do
+ dup 0 = until
+ over over - 2 + get print_hex
+ 1 -
+ od
+ drop
+exit