5 ms·
Show HN: dcpubin - a pastebin for DCPU-16 programs
- jazzychad 15y agoa few of examples: fibonacci recursive: http://dcpubin.com/ppJrob0g2 http://dcpubin.com/ppJrob0g2 fibonacci tail-call: http://dcpubin.com/epaCb-NI2 http://dcpubin.com/epaCb-NI2 itoa: http://dcpubin.com/puu5gf0C6 http://dcpubin.com/puu5gf0C6
- coderdude 15y agoThis is a really cool idea! I could see people using this as a testing ground to learn the instruction set as well. Especially if you can make the "paste your code, share your link" part of it as easy as pasting into a single obvious text box (like with pastebin). If you can make it easy to browse the snippets that would be great. It's probably important to get that working right away so that people can play with different programs and get a feel for the instruction set. (Plus people like to have their stuff seen by others.) Can't wait to see where this is heading, as well as your JS implementation of DCPU.
- jazzychad 15y agoThanks! yes, this is just the minimal feature set (save code, share link). I'm trying to think of a good way to show an index of snippets (and/or if that means people would want private pastes as well). i'm hoping to implement features based on community/user feedback.
- pagekalisedown 15y agoI'm starting to think we need a dcpu.ycombinator.com.
- coderdude 15y agoOnly if you think we also need(ed) the following: bitcoin.ycombinator.com sopa.ycombinator.com apple|facebook|google.ycombinator.com privacy-issues.ycombinator.com techcrunch.ycombinator.com mpaa.ycombinator.com ... I think we'll survive.
- Natsu 15y agoThis is HN. I'm sure that someone will build some kind of hub site for DCPU-related stuff in short order. Heck, I was toying with the idea myself before most of the weekend escaped from me. There's already a wiki, GitHub organization, and IRC channel that I know of. If there's no mailing list, there will be.
- kylemaxwell 15y agoThere's also a subreddit. http://reddit.com/r/dcpu16 http://reddit.com/r/dcpu16
- johnernaut 15y agoAnyone else read this as dc-pubin'? >.>
- swalsh 15y agoThe javascript version of the CPU seems to be turning into something really cool. Here a person made a real-time IDE: http://dwilliamson.github.com/ http://dwilliamson.github.com/
- someone13 15y agoWorth noting that since there's no "halt" instruction, people often use an endless loop to designate the end of the program. This causes Chrome, at least, to suck up a lot of CPU.
- tkahn6 15y agoAs far as I've seen, the de facto convention is to have a BRK mnemonic with a total instruction value of 0x0000. It has the nice property of causing a halt when uninitialized memory is executed.
- lloeki 15y agoIn my implementation I simply set my run loop to break out if last_pc == cpu.pc. Thus an HLT instruction is virtually equivalent to an instruction setting the PC back to PC itself, which, unless an outside force sets PC or [PC] to something else (think shared memory between multiple CPUs), is an unbreakable infinite loop.
- dy9 15y agoSET PC, [SP++] SET PC, [--SP] SET PC, [location with I/O]
- lloeki 15y ago> SET PC, [SP++] > SET PC, [--SP] Good call, detecting (PC, SP) fixed point then, although using the stack to jump onto itself is wicked. I don't want to go and solve the halting problem either. > SET PC, [location with I/O] Qualifies as outside force. I'm not sure I want to write/run a program that JMP to an @ provided by I/O, this reads like an SQL injection.
- Tyr42 15y agoI'm only getting errors when trying this. Error: Subroutine crash was not defined (address 40)
- olalonde 15y agoI'm starting to wonder how long before someone manufactures a DCPU chip...
- atamyrat 15y agoJust wrote my first assembler program ever! Thanks, OP. Prints factorial table (2 columns - index and result) in console display. http://dcpubin.com/eshsuZqgq http://dcpubin.com/eshsuZqgq
- jazzychad 15y agothat is seriously cool! congrats on your first asm program :)
- DanBC 15y agoVery nice idea. Is there any easy way to differentiate between programs that definitely work in 0x10C and programs using hypothetical features? Will there be any way to report programs that are malware? Or to correct the descriptions of supposedly innocent softs that are not innocent?
- jazzychad 15y agoi'm planning to keep the emulator adhering to only published specs by notch. the only exception is the extra BRK instruction which will stop execution in the emulator. if malware becomes a problem, i'll address it then, but that's also part of the game...
- DanBC 15y agoMalware is part of the game, so it's interesting to see how external sites deal with it. Do they go along with the meta game of people trying to spread malware ("it's at your own risk") or do they try to protect people from malware? Either approach is acceptable, in my opinion. Good luck!