diff options
| author | Julian Blake Kongslie | 2021-03-29 14:39:48 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2021-03-29 14:39:48 -0700 |
| commit | f3092799de44cb357c96706961db38e3c62344c6 (patch) | |
| tree | bd66c4af530f8ebcc255f170dc81eef9effce0c0 /mem | |
| parent | Trivial assembler. (diff) | |
| download | noncpu-f3092799de44cb357c96706961db38e3c62344c6.tar.xz | |
Add a Fibonacci sequence to the end of output (no ASCII conversion yet)
Diffstat (limited to 'mem')
| -rw-r--r-- | mem/mem.hex | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/mem/mem.hex b/mem/mem.hex index 5c6ebe7..3979364 100644 --- a/mem/mem.hex +++ b/mem/mem.hex | |||
| @@ -2,11 +2,27 @@ | |||
| 2 | 2 | ||
| 3 | 040 // acc= 0x40 | 3 | 040 // acc= 0x40 |
| 4 | f20 // idx | 4 | f20 // idx |
| 5 | 100 // loop: load | 5 | 000 // loop: acc= 0 |
| 6 | 100 // load | ||
| 6 | 300 // ifeq 0 | 7 | 300 // ifeq 0 |
| 7 | f80 // halt | 8 | 402 // jmp fib |
| 8 | f44 // ++idx tx | 9 | f44 // ++idx tx |
| 9 | 4fb // jmp loop | 10 | 4fa // jmp loop |
| 11 | 040 // fib: acc= 0x40 | ||
| 12 | f20 // idx | ||
| 13 | 000 // acc= 0 | ||
| 14 | 200 // store | ||
| 15 | f04 // ++idx | ||
| 16 | 001 // acc= 1 | ||
| 17 | 200 // store | ||
| 18 | f08 // fibloop: --idx | ||
| 19 | 000 // acc= 0 | ||
| 20 | 100 // load | ||
| 21 | f44 // ++idx tx | ||
| 22 | 100 // load | ||
| 23 | f04 // ++idx | ||
| 24 | 200 // store | ||
| 25 | 4f8 // jmp fibloop | ||
| 10 | 26 | ||
| 11 | @40 | 27 | @40 |
| 12 | 28 | ||
| @@ -26,12 +42,3 @@ f44 // ++idx tx | |||
| 26 | 00a // \n | 42 | 00a // \n |
| 27 | 43 | ||
| 28 | 000 | 44 | 000 |
| 29 | |||
| 30 | 04f // O | ||
| 31 | 06f // o | ||
| 32 | 070 // p | ||
| 33 | 073 // s | ||
| 34 | 021 // ! | ||
| 35 | 00a // \n | ||
| 36 | |||
| 37 | 000 | ||
