mappum / DCPU-16

:floppy_disk: A javascript emulator for DCPU-16 (the computer system in Mojang's new game, 0x10c). Works in browsers and Node.
http://mappum.github.com/DCPU-16/
94 stars 18 forks source link

Support the 'dat' instruction #17

Closed Blecki closed 12 years ago

Blecki commented 12 years ago

As seen in http://www.0x10cforum.com/gallery/m/4932873/detail/56189#pid=466442

It does not appear to be in the spec yet. It looks like notch is freely mixing hex and strings. I'm guessing the instruction just copies bytes verbatim, probably expanding chars to 16 bits.

Twisol commented 12 years ago

I think dat is actually an assembler directive, similar to how #include in C is a preprocessor directive, not an actual C statement.

That notwithstanding, it's a rather useful tool, so +1 from me.

mappum commented 12 years ago

I saw that, and I'll probably make a beta version of this that has unreleased parts of the spec (other than console output).

Blecki commented 12 years ago

Great. This is the only way I'm going to be able to support string literals effeciently in https://github.com/Blecki/DCPUC

mappum commented 12 years ago

That looks more like javascript with the var and not having types, and it is all proper javascript syntax. :D

Blecki commented 12 years ago

Yeah I know. But, javascript has C-like syntax so..

mappum commented 12 years ago

Technically javascript has Java-like syntax :P The guy (an employee of Netscape at the time, now the CTO of Mozilla) that wrote it was trying to make it look like Java because Sun gave them the rights to put Java in their browser. There's your history lesson for the day.

Blecki commented 12 years ago

I'm going to call them all 'Pascals' now.

deps commented 12 years ago

:)

lchski commented 12 years ago

To have this implemented would make this emulator even more useful. :+1:

krasin commented 12 years ago

Digital Rain demo requires dat to be running. It's here: http://pastebin.com/QFgsz95F

The following online assembler and debugger supports it: http://denull.ru/dcpu/dcpu.htm

lchski commented 12 years ago

Awesome - thanks for showing me another great emulator.

krasin commented 12 years ago

Oh, actually the Notch example requires dat: http://pastebin.com/pfUNsFFP

See more on http://www.reddit.com/r/dcpu16/comments/rxua0/analysis_testing_of_0x10x_compilers/

mappum commented 12 years ago

Finally got around to implementing this. Also, string literals.