This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.org 0x1000 | |
:start | |
set i, 0 | |
set j, 0 | |
set b, 0xf100 | |
:nextchar | |
set a, [data+i] | |
ife a, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:main | |
SET A, data | |
SET B, data-5 | |
SET C, end-data | |
JSR memmove | |
SUB PC, 1 | |
;; memmove | |
; A src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ADD PC, dothis-omit | |
:omit | |
SET A, 0x10 | |
:dothis | |
SET B, 0x10 | |
SUB PC, 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; If there is only a comment in the first line, make sure there are no whitespaces before. | |
; This is a known issue: https://github.com/migerh/dcpu16.js/issues/6 | |
; start at 0x1000 | |
.org 0x1000 | |
; Macros can be used. | |
; Labels inside macros are not resolved properly yet. | |
#macro push(value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main () { | |
//print("Hello, World!"); | |
int a = 3; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int div(int a, int b) { | |
return a / b; | |
} | |
int main() { | |
div(5, 3); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dcpu b/dcpu | |
index 56bcc78..dd8cbf7 100644 | |
--- a/dcpu | |
+++ b/dcpu | |
@@ -1,6 +1,6 @@ | |
DCPU-16 Specification | |
Copyright 1985 Mojang | |
-Version 1.3 | |
+Version 1.4 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DCPU-16 Specification | |
Copyright 1985 Mojang | |
Version 1.4 | |
=== SUMMARY ==================================================================== | |
* 16 bit words | |
* 0x10000 words of ram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- dcpu16.txt 2012-04-26 13:57:37.477152465 +0200 | |
+++ dcpu16_1_5.txt 2012-04-26 13:57:12.209965926 +0200 | |
@@ -1,6 +1,6 @@ | |
DCPU-16 Specification | |
Copyright 1985 Mojang | |
-Version 1.4 | |
+Version 1.5 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 95%] Assembling openf.dasm16 with DCPU-Toolchain... | |
make[2]: *** [kernel/src/openf.o] Error 1 | |
make[1]: *** [kernel/CMakeFiles/kernel.dir/all] Error 2 | |
make: *** [all] Error 2 |