add examples

This commit is contained in:
krolxon 2026-01-05 00:11:08 +05:30
parent 49e6897d79
commit 2fb5bbaa8d
4 changed files with 10 additions and 12 deletions

View File

@ -1,6 +1,6 @@
# 8-Bit CPU Emulator
## Added instructions
## Supported Instructions
1. MOV
2. ADD
3. SUB
@ -11,7 +11,7 @@
# Usage
```bash
cargo run -- --f <filename.asc>
cargo run -- --f <examples/filename.asc>
```
## Todo

4
examples/addition.asm Normal file
View File

@ -0,0 +1,4 @@
mov a, 10
mov b, 5
add a, b
hlt

4
examples/subtraction.asm Normal file
View File

@ -0,0 +1,4 @@
mov a, 15
mov b, 15
sub a, b
hlt

View File

@ -1,10 +0,0 @@
; add
mov a, 10
mov b, 5
add a, b
; sub
mov a, 15
mov b, 15
sub a, b
hlt