Skip to content

Commit

Permalink
Update with compiler infos
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Aigner committed Apr 7, 2012
1 parent 0e87e97 commit c71c8a1
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions README
@@ -1,4 +1,39 @@

LET THERE BE COMPILER ^.^ (with missing features :-[... but i need it for unit tests)

Input:
:loop
ADD A, 0x1
IFN A, 0x3
SET PC, loop

Output:
7802 0001 780D 0003 79C1 0000

Execution output:
|_PC_|_SP_|_OV_|_A__|_B__|_C__|_X__|_Y__|_Z__|_I__|_J__|||_OP_|_A__|_B__|
| 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 02 | 00 | 1E |
| 02 | 00 | 00 | 01 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 0D | 00 | 1E |
| 04 | 00 | 00 | 01 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 01 | 1C | 1E |
| 00 | 00 | 00 | 01 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 02 | 00 | 1E |
| 02 | 00 | 00 | 02 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 0D | 00 | 1E |
| 04 | 00 | 00 | 02 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 01 | 1C | 1E |
| 00 | 00 | 00 | 02 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 02 | 00 | 1E |
| 02 | 00 | 00 | 03 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 0D | 00 | 1E |
| 05 | 00 | 00 | 03 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 00 | 00 | 00 |

===========================

Compiler infos
- Simulate lables (This requires 1 extra word in memory per jump :/)
- Missing variable evaluations for
- 0x10-0x17: [next word + register]
- 0x1f: next word (literal)
- 0x20-0x3f: literal value 0x00-0x1f (literal)
- ugly code :)

===========================

Just another DCPU implementation.
Language: Java
Inspiration: https://github.com/swetland/dcpu16
Expand All @@ -11,20 +46,3 @@ Inspiration: https://github.com/swetland/dcpu16

gz Miah

============================================

Output of the test program

run:
|_PC_|_SP_|_OV_|_A__|_B__|_C__|_X__|_Y__|_Z__|_I__|_J__|||_OP_|_A__|_B__|
| 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 01 | 00 | 1E |
| 02 | 00 | 00 | 01 | 00 | 00 | 00 | 00 | 00 | 00 | 00 ||| 01 | 01 | 1E |
| 04 | 00 | 00 | 01 | 06 | 00 | 00 | 00 | 00 | 00 | 00 ||| 01 | 02 | 1E |
| 06 | 00 | 00 | 01 | 06 | 02 | 00 | 00 | 00 | 00 | 00 ||| 02 | 07 | 00 |
| 07 | 00 | 00 | 01 | 06 | 02 | 00 | 00 | 00 | 00 | 01 ||| 0D | 07 | 02 |
| 08 | 00 | 00 | 01 | 06 | 02 | 00 | 00 | 00 | 00 | 01 ||| 01 | 1C | 01 |
| 06 | 00 | 00 | 01 | 06 | 02 | 00 | 00 | 00 | 00 | 01 ||| 02 | 07 | 00 |
| 07 | 00 | 00 | 01 | 06 | 02 | 00 | 00 | 00 | 00 | 02 ||| 0D | 07 | 02 |
| 09 | 00 | 00 | 01 | 06 | 02 | 00 | 00 | 00 | 00 | 02 ||| 00 | 00 | 00 |
BUILD SUCCESSFUL (total time: 0 seconds)

0 comments on commit c71c8a1

Please sign in to comment.