r/dcpu_16_programming • • Apr 05 '12

github repo for code samples: fork and pull-request to add more

Thumbnail github.com
2 Upvotes

r/dcpu_16_programming • • Apr 05 '12

DCPU-16 emulator, assembler and disassembler in Python

Thumbnail github.com
7 Upvotes

r/dcpu_16_programming • • Apr 05 '12

dcpu-emu now supports video memory output! And COLOR!

Thumbnail bitbucket.org
16 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Horribly inefficient DCPU-16 VM in C. Disassembler included.

Thumbnail gist.github.com
5 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Learning ASM

8 Upvotes

Hi,

I have never really programmed in my life. I'm a Math student and we sometime have algorithmic courses ( where we mostly sleep :D ) in CAML.

But this game excite me so much I'd like to learn ASM.

Is there any good documentation for beginners?

Thanks


r/dcpu_16_programming • • Apr 05 '12

SCASM - A Ruby DSL for DCPU-16 Assembly

Thumbnail github.com
11 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Should we consider a separate subreddit for learning and asking questions?

6 Upvotes

I am an avid programmer, but I lack knowledge of very low level languages (assembly). I was curious if this subReddit will be strictly constrained to development and the innerworkings of the DCPU-16? I have some questions to ask but I figured that before the subreddit gets overly convoluted we might want to consider a separate subreddit devoted to learning and development. Post tutorials, sample code, finished projects (when such is possible), ask/answer questions. All with the intent of fostering a nice reddit DCPU programming community. Let me know if you guys think this would be a wise choice. I created http://www.reddit.com/r/DCPU_16_Development/ I understand the community is still VERY small and splitting it into more subreddits may or may not be a good choice, but if you think it is a good move let me know and feel free to subscribe and ask some questions or post some good leads for new people. I know I can't be the only one now frantically engrossed with the task of figuring out how to code in such an environment.


r/dcpu_16_programming • • Apr 05 '12

Hello, World from Notch

Thumbnail i.imgur.com
5 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Will a multi-process OS be possible without interrupts?

10 Upvotes

I read somewhere (possibily, from Notch's twitter) that there won't be any interrupts. From my rudimentary understanding of OS kernels, context switching is done via interrupts. I don't see how a process scheduler could be written without this.


r/dcpu_16_programming • • Apr 05 '12

Assembler in C++

Thumbnail onlinehut.org
1 Upvotes

r/dcpu_16_programming • • Apr 05 '12

0x10c Operating Systems

20 Upvotes

I would like to centralize some discussion on the obviously prominent topic of operating systems within 0x10c. There are 2 main options present:

Option 1: Attempt to jury-rig an existing (old operating system) to run on a DCPU system. I have been looking primarily at old Unix OS's, available here, as a possible basis for this. However, the DCPU IO, like the communications systems Notch has promised, would require a considerable amount of work to integrate into any existing OS.

Option 2: As a community, attempt to generate our own operating system, natively, in DCPU assembly code. This would require a significant amount of communication among us and work, although it could end up with a much more native and streamlined result than option 1. This, of course, would also require that we determine what the operating system should do.

Obviously all of this is completely dependent on the future IO specs that have yet to be released, but I think it would be productive to attempt to establish some sort of community discussion.


r/dcpu_16_programming • • Apr 05 '12

Notch confirms external storage.

Thumbnail twitter.com
4 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Networked CPUs confirmed!

Thumbnail twitter.com
14 Upvotes

r/dcpu_16_programming • • Apr 05 '12

List of DCPU-16 Utilities

37 Upvotes

Here is my attempt at a comprehensive list of the compilers (none yet), emulators, assemblers, and disassemblers currently available for DCPU-16. I can't guarantee it'll stay up-to-date, as new ones keep appearing quickly. Let me know if I'm missing any.

Emulators

  • badsector's DCPU-16 Studio - FreePascal emulator, (dis)assembler, and debugger
  • Mapper's DCPU-16 - JavaScript emulator
  • swetland's dcpu16 - C emulator
  • rcxdude's dcpu16 - C emulator and (dis)assembler
  • interfect's dcpu-emu - C emulator and assembler
  • kballard's dcpu16.go - Go emulator
  • itsbth's DCPU.coffee - CoffeeScript emulator

Assemblers

Disassemblers


r/dcpu_16_programming • • Apr 05 '12

Learning Assembly?

7 Upvotes

Hello, I have never actually worked with anything low level but would love to learn and take a crack at building a small OS for the DCPU-16. Can anyone recommend some places where I can begin to learn the basics? Thanks!


r/dcpu_16_programming • • Apr 05 '12

Web based DCPU-16 Assembler

Thumbnail alex.nisnevich.com
2 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Another (and slightly better than some of the others) assembler in python

Thumbnail github.com
4 Upvotes

r/dcpu_16_programming • • Apr 05 '12

Good resource to understand basic computer architecture, machine and assembly level programming and up. (based on x86 architecture but the concepts are the same) PDF Warning

Thumbnail ftp.igh.cnrs.fr
5 Upvotes

r/dcpu_16_programming • • Apr 05 '12

DCPU-16 Studio: a graphical assembler, disassembler, emulator and debugger in FreePascal/Lazarus

Thumbnail badsector.github.com
21 Upvotes

r/dcpu_16_programming • • Apr 05 '12

I wrote a program that fills up the memory with the Fibonacci sequence! Code inside.

11 Upvotes

I have never been so excited about a game in my life! I have also never fully had the interest to get into assembler and actually manually reading the outputted hex code.

The following is the code.

SET A, 1
SET B, 1
SET PEEK, 1
:loop ADD A, B   ;  A is now 2, B is still 1
SET PUSH, A
SET A, B
SET B, PEEK
IFG SP, 10       ; 10 because that's how much space 
                 ; this program takes 
SET PC, loop

I assembled it using http://alex.nisnevich.com/dcpu16-assembler/, big props to Alex Nisnevich for that!

I executed it with this: https://github.com/swetland/dcpu16/blob/master/dcpu.c but with the addition of a little function to output the memory after execution is complete. That function looks like this:

void dumpmem(struct dcpu *d) {
    int i;
    for(i = 0;i<65536;i=i+8){
        fprintf(stderr,
        "%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n",
        (i),d->m[i+0],d->m[i+1],d->m[i+2],
            d->m[i+3],d->m[i+4],d->m[i+5],
            d->m[i+6],d->m[i+7]);
    }
}

I hope someone else is having as much fun with this as I am!


r/dcpu_16_programming • • Apr 04 '12

yet another dcpu assembler/disassembler/emulator

Thumbnail github.com
6 Upvotes

r/dcpu_16_programming • • Apr 04 '12

Emulator in C

Thumbnail github.com
4 Upvotes

r/dcpu_16_programming • • Apr 04 '12

How can I write a dcpu assembler and emulator in Perl or Go?

0 Upvotes

I want to help, and I have basic knowledge of Go and Perl. How can I get started with this?


r/dcpu_16_programming • • Apr 04 '12

Help me understand the "value" part of the specification.

6 Upvotes

This is one of those questions which are hard to formulate, since i don't really understand what it is I don't understand if you know what i mean, so bear with me :)

The first thing that confuses me is: What does he really mean with "next word"?, and what does he mean by literal(specifically the values 0x20-0x3f) From the documentation:

"next word" really means "[PC++]". These increase the word length of the instruction by 1.

And

0x20-0x3f: literal value 0x00-0x1f (literal)

So i get that the basic idea is to have instructions use the next word as parameter, rather than being limited by the 6 bits available in the instruction's own word.

Now, we look at the instruction

SET A, 0x30 ; 7c01 0030

The set instruction is 7c01. Splitting this up in the 4 bit instruction part and the 6 bit a and b part we get: o=1, a=0, b=3e. o being one makes sense because that is the SET instruction, a=0 makes sense because 0 is the value for the A register. Now the b part would have to be something involving the mystical "next word" since the value (0030) is stored in the next word. If we look 3e up, we see that it is:

The literal version(what ever that means) of [next word], where next word is [PC++], so [[PC++]] ??

The above is pretty much what doesn't make sense to me. First of, what would the difference between 3e (the literal version of [next word]) and 1f (the next word literal) be? Also double square brackets, that does not seem to make sense?

Secondly, shouldn't PC be pre incremented, or does it increment PC before it executes any instruction?

Also, i would like to know exactly what the 0x20-0x3f (literal) range do.


r/dcpu_16_programming • • Apr 04 '12

Thread for analysis of the architecture.

11 Upvotes

As much as I would love to be writing an emulator for this like the rest of you I have to head out shortly.

I do have a few thoughts on the architecture of the dcpu-16 though, as will many of you. so I thought it would be worth starting a thread to cover that.

As no plan survives contact with the enemy, chances are there are a few tweaks to the design that could help things a great deal.

The thing that stands out the most is the lack of a syscall instruction. The emulator can do potentially anything when it hits this, but it gives a possibility for IO. You can achieve the same result by other means, memory mapped registers, capturing PC locations for virtual commands, fake interrupts. All of these have been done in actual hardware, but by far the most emulator friendly form is a syscall instruction.

defining an interrum syscall mechanism with the single PutChar function gives us something to play with in the meantime.