4 ms·
DCPU16 Assembler in less than 200 lines of Ruby
- sarbogast 14y agoWho will be the first one to build a DCPU16 computer inside Minecraft?
- jgrahamc 14y agoI'd love to see one made using discrete logic. It's a pretty simple CPU so it looks to me like you could pretty easily build it out of 74 series.
- msarnoff 14y ago> It's a pretty simple CPU 16-bit address and data buses? Hardware multiplier, divider, and barrel shifter? I wouldn't exactly call it simple. The cost to build one out of discrete logic probably approaches the quadruple digits. Magic-1 (http://www.homebrewcpu.com/ http://www.homebrewcpu.com/) is a 16-bit, microcoded homebrew CPU that took about 4 years to build, and it doesn't have any of the above features.
- ORioN63 14y agoMore important: Who will be the first one to code Minecraft on a DCPU16 computer?
- pavel_lishin 14y agoAnd who will implement Conway's game of life on top of that? (I'm psychic: the next comment will ask who will implement a DCPU16 in Conway's game of life.)
- jenius 14y agoHate to be that guy, but this isn't actually less than 200 lines... perhaps "about 200 lines" would have been a better title?
- ianterrell 14y agoWhitespace doesn't count.
- _quasimodo 14y agoDCPU16 Assembler in 0 lines of Whitespace :)
- ORioN63 14y agoIf you remove empty lines, the code will be under 200 lines, so I think it's kind of fair to say it has less than 200 lines.
- ashleyf 14y agoIf we're playing line-count-golf, how 'bout in "about 50 lines" of F#? :) http://blogs.msdn.com/b/ashleyf/archive/2012/04/04/notch-is-gonna-outdo-himself.aspx http://blogs.msdn.com/b/ashleyf/archive/2012/04/04/notch-is-...
- alpatters 14y agois the 200 lines a brag? It is in fact longer than the C++ version posted earlier.
- tophercyll 14y agoNot a brag--just wanted emphasize how straightforward and fun something like this can be.
- ATPase 14y agoWhat's the hype about this DCPU16 thing? The game hasn't been released yet and people starting to write assemblers. Are you totally bored out of your life?
- quaunaut 14y agoThere are dozens of reasons people do things like this. It's good programming practice for those of us who aren't as confident in our abilities. It gets you some notoriety in the community, maybe even a community you're a big part of. It's something that can go on a resume really easily, if used. Or maybe, you just wanted to have fun so you spent a night doing this. It isn't a big deal. If you don't waste one night of your life every once in awhile, you're pretty unlike the rest of humanity.
- chernevik 14y agoI want to motivate my 12-year old son to learn programming. He loves Minecraft. I'm dangling this game in front of him like a ball of twine in front of a kitten.
- sp332 14y agoThe DCPU was designed to be easy to emulate. It's a lot of fun to hack on, and simple enough that you can write assemblers for it and still have a life. :)
- chj 14y agowhile (> 100 lines) { zzzzZZZZZzzzz.. }
- judofyr 14y agoFor Rubyists who wants to play with DCPU-16: https://github.com/judofyr/rcpu https://github.com/judofyr/rcpu It's a DCPU assembler (written in a Ruby DSL) and an emulator/debugger (which allows you to step/run through the execution). Next up I'm going to implement library support and write some I/O functions. Much of the code is already in place though (e.g. https://github.com/judofyr/rcpu/blob/master/examples/screen.rcpu https://github.com/judofyr/rcpu/blob/master/examples/screen.... which maps 0x8000-0x8400 to the terminal).
- deleted 14y ago[deleted]