diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 23:28:35 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 23:28:35 +0000 |
commit | 34b1d1d024f54d70e374f779ed86c919c115d5d6 (patch) | |
tree | dd8314f36092b40d30053cd2b301078de1fc8d92 | |
parent | 753514e9a8ca0c9411d494d90286d1f36809eb2b (diff) | |
download | ovm-34b1d1d024f54d70e374f779ed86c919c115d5d6.tar.gz ovm-34b1d1d024f54d70e374f779ed86c919c115d5d6.tar.bz2 ovm-34b1d1d024f54d70e374f779ed86c919c115d5d6.zip |
A small program I am currently working on: reverses an allocated buffer of bytes, returning a new set
-rw-r--r-- | test.asm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test.asm b/test.asm new file mode 100644 index 0000000..0962956 --- /dev/null +++ b/test.asm @@ -0,0 +1,42 @@ + malloc.byte 3 + mov.word 0 + push.reg.word 0 + push.byte 'a' + mset.byte 0 + push.reg.word 0 + push.byte 'b' + mset.byte 1 + push.reg.word 0 + push.byte 'c' + mset.byte 2 + + push.reg.word 0 + msize + malloc.stack.byte + mov.word 1 + push.word 0 + mov.word 2 + push.reg.word 0 + push.reg.word 2 + push.word 1 + push.reg.word 0 + msize + sub.word + sub.word + mget.stack.byte + mov.byte 24 + push.reg.word 1 + push.reg.byte 24 + push.reg.word 2 + mset.stack.byte + push.reg.word 2 + push.word 1 + plus.word + mov.word 2 + push.reg.word 2 + push.reg.word 0 + msize + eq.word + not.byte + jump.if.byte 17 + halt |