Skip to content

Instantly share code, notes, and snippets.

@migerh
migerh / write.dasm16
Created April 15, 2012 08:03
write something about gist on a dcpu16
.org 0x1000
:start
set i, 0
set j, 0
set b, 0xf100
:nextchar
set a, [data+i]
ife a, 0
:main
SET A, data
SET B, data-5
SET C, end-data
JSR memmove
SUB PC, 1
;; memmove
; A src
@migerh
migerh / jmp.dasm16
Created April 16, 2012 08:45
rel jump
ADD PC, dothis-omit
:omit
SET A, 0x10
:dothis
SET B, 0x10
SUB PC, 1
; 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) {
@migerh
migerh / test.c
Created April 19, 2012 11:27
dcputoolchain first test
int main () {
//print("Hello, World!");
int a = 3;
return 0;
}
@migerh
migerh / funcall.c
Created April 22, 2012 08:56
toolchain example
int div(int a, int b) {
return a / b;
}
int main() {
div(5, 3);
return 0;
}
@migerh
migerh / dcpu spec
Created April 26, 2012 07:22
1.3 to 1.4 diff
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
@migerh
migerh / dcpu
Created April 26, 2012 07:18
0x10c specs
DCPU-16 Specification
Copyright 1985 Mojang
Version 1.4
=== SUMMARY ====================================================================
* 16 bit words
* 0x10000 words of ram
@migerh
migerh / dcpu
Created April 26, 2012 11:58
specs diff 1.4 to 1.5
--- 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
@migerh
migerh / log
Created April 27, 2012 04:52
kernel asm error
[ 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