From 5e3bf761cdcb8e0b089e0b62b77e7891a923590d Mon Sep 17 00:00:00 2001 From: dm1sh Date: Sat, 17 Apr 2021 18:40:13 +0500 Subject: [PATCH] Added asm code example --- README.md | 25 +++++++++++++++++++++++++ input.s | 8 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 input.s diff --git a/README.md b/README.md index 3d8bd17..64f6c74 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,31 @@ Stack based virtual machine and assembly code compiler ## Assembly documentation +### Example programm: + +Put it into input.s + +```asm +PUSH 65 +OUTC +PUSH 1 +ADD +OUTC +PUSH 1 +ADD +OUTC +``` + +Run + +```bash +make +./build/stack_vm build input.s +./build/stack_vm run out.bin +``` + +It must print first three English characters + ### Commands: - **NONE** diff --git a/input.s b/input.s new file mode 100644 index 0000000..627cb5e --- /dev/null +++ b/input.s @@ -0,0 +1,8 @@ +PUSH 65 +OUTC +PUSH 1 +ADD +OUTC +PUSH 1 +ADD +OUTC \ No newline at end of file