Questions tagged [dcpu-16]

The DCPU-16 is a simple 16-bit CPU used for the 0x10^c game by Notch.

The DCPU-16 is a simple 16-bit CPU used for the 0x10c game by Notch. See 0x10c.com for more information about the game; you can also find the DCPU-16 spec there.

Useful tools

  • DCPU-16 toolchain - yes, someone's written a development toolchain including compiler, standard library, linker, assembler, emulator and kernel.
  • dcpu.ru - the jsfiddle equivalent for DCPU-16.
25 questions
2
votes
2 answers

Why is there a leading 1 in the binary representation of DCPU-16 instructions

I'm currently fiddling around with DCPU-16 assembler (see http://0x10c.com/doc/dcpu-16.txt and http://jazzychad.net/dcpu.html). There is one thing I don't understand in the way the assembler instructions are transformed to hex/binary. As an example,…
Manuel Kießling
  • 656
  • 6
  • 10
1
vote
0 answers

Trying to do a simple "hello world" program in DCPU-16

I'm studying the DCPU-16's asm, and I started with a simple hello world program. Here it is: hwn i set j, 0 jsr get_display :init_display set a, 0 set b, 0x8000 hwi [display_adress] set i, 0 :write_string set a, [message + j] ife a, 0 set…
1
vote
1 answer

DCPU-16 Bitwise Shifting

I am trying to learn DCPU. ;Set b to 1 SET B,1 ;00001 (1) SHL B,1 ;00010 (2) SHL B,1 ;00100 (4) SHL B,1 ;01000 (8) SHL B,1 ;10000 (16) All I am doing is shifting to the left one so shouldn't it simply double itself each shift. In my code you can…
Bevilacqua
  • 465
  • 3
  • 8
  • 19
1
vote
1 answer

How to best get a character from the keyboard on the DCPU16

So, my goal is the write a subroutine that when called hangs until the user has entered a string terminated by , which it then returns(probably by writing it to an address specified by the user). My problem lies in how i best get individual…
Andreas Vinter-Hviid
  • 1,482
  • 1
  • 11
  • 27
1
vote
2 answers

SET A, 0x1E vs SET A, 0x1F

This is my first attempt at dpcu, I'm checking machine code generated by dpcu-16 assembly I am using this emulator : http://dcpu.ru/ I am trying to compare code generated by SET A, 0x1E SET A, 0x1F code generated is as follow : fc01 7c01 001f I…
Eric
  • 19,525
  • 19
  • 84
  • 147
1
vote
2 answers

How should I add a preprocessor to a flex+bison assembler?

I have written a simple assembler using flex+bison. I'd like to add a preprocessor (macros) to the assembly language. This is my first time trying to use flex+bison, I'm not sure how to go about this. Is it appropriate to add a separate instance of…
blueshift
  • 6,742
  • 2
  • 39
  • 63
1
vote
1 answer

Writing a stream cipher for DCPU-16, which should I focus on given it's limitations?

For fun I am writing a stream cipher in assembly for the DCPU-16 (the fictional CPU for the game 0x10c). The processor only has 16 bit registers and it runs at 100 Khz. However, for now, memory access and things like multiplication and division are…
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
0
votes
1 answer

does the dcpu-16 have a stack or does the stack pointer just point to ram adresses ?(writing a dcpu-16 emulator)

I'm making a dcpu-16 emulator and I'm having trouble implementing opcodes that use the stack pointer. What does the stack pointer point to? ram addresses?
0
votes
1 answer

XNU Kernel clone in DCPU-16

https://github.com/galaxas0/MachX-Kernel Before I embark on a project designed to fail, I'd like to set things straight so they don't fail, by asking a simple question: how on earth would a DCPU-16 load a kernel... being virtual and all. I…
Aditya Vaidyam
  • 6,259
  • 3
  • 24
  • 26
0
votes
1 answer

How does IFN A, 0x10 translate to 0xc00d in the original spec for DCPU 16

I'm attempting to write an assembler for Notch's DCPU-16 spec. The original spec for this CPU can be found here. The relevant lines: SET A, 0x30 ;7c01 0030 ... IFN A, 0x10 ;c00d I understand the instructions up to this point, but this one to me…
Matt Fellows
  • 6,512
  • 4
  • 35
  • 57
1
2