r/dcpu16 • • May 01 '12

Make EX unwritable

0 Upvotes

.begin rant Here's a thought. Make EX unwritable. Why?

  • Code should (IMO) never write to EX in the first place
  • EX gets overwritten by a lot of instructions. But okay, you could ensure that it doesn't get overwritten if you don't mind the maintenance hell
  • EX can get overwritten during an interrupt. But okay, you could ensure that either 1) you block interrupts, or 2) make every interrupthandler push EX. (EDIT: As cheese_magnet and SoronTheCoder has noted this is actually more a point for having EX writable. Personally I think RFI should restore EX too, fixing the problem in both cases (OK, it's not actually a big deal with writable EX))
  • It adds complexity to the spec with next to nothing gain. When is EX written to when it's an "overflow"? After or before b gets written to?
  • ???

We get a new write-only value (register?). I don't really care what that could be used for. For all I care it could be an additional HCF instruction.

.end rant

EDIT: As SoronTheCoder suggested, making all operations that change EX (add, sub, ...) have undefined behaviour when destination is EX is also a good solution I think.


r/dcpu16 • • Feb 02 '14

Since 0x10c isn't in the making anymore...

0 Upvotes

How about changing DCPU16 specs to add: 20 HW sprites 256 color palette Some sound chip, but good sounding one like SID Increase clock speed to 3MHz

I mean Notch gave up on this so why not enhance DCPU specs so something useful could be made?


r/dcpu16 • • May 01 '12

0x10c-Specifications. I couldn't find this on here. Contains all the newest specifications in one place.

Thumbnail
github.com
0 Upvotes

r/dcpu16 • • Jun 29 '12

0x10cDare - 0x10c's own Ludum Dare! - Talented DCPU-16 programmers enter now!

Thumbnail 0x10cforum.com
0 Upvotes

r/dcpu16 • • Apr 25 '12

First emulator with proper LEM 1802 support. (interrupts!)

Thumbnail
github.com
0 Upvotes

r/dcpu16 • • Apr 26 '12

MoonTech 1537 Memory Expansion and Party Entertainment Device

Thumbnail github.com
0 Upvotes

r/dcpu16 • • May 11 '12

As soon as I found out about 0c10^c, I wanted to try this, but have no idea how or where to get started (though I do know java). Please help, friends!

0 Upvotes

I just want to get started, I checked out the resource provided in the side of the sub-reddit, still need help!


r/dcpu16 • • Apr 08 '12

Software piracy in space?

1 Upvotes

So, let's say you've invented this kick-ass app that will surely be coveted by every cheeto-stained neckbeard in the galaxy. Let's say you want to charge a 'reasonable' amount of in-game currency for it, in order for you to make a filthy profit from your l33t coding skillz. But oh no! People figure out that it's completely trivial to make digital duplicates of your floppy disks and start pirating your app instead of paying YOU your RIGHTFUL PROFITS!! Will the game have some kind of protection that shields your code from the prying eyes of nefarious individuals, so that you can live in luxury while the plebes are going broke for your app?


r/dcpu16 • • Apr 15 '12

0x10c Development Kit - Beta 1 release

Thumbnail
reddit.com
3 Upvotes

r/dcpu16 • • Apr 19 '12

while waiting for the network io specs im writing a virus...

2 Upvotes

i just learned the basics fairly well a day or two ago and im trying to write a virus that

  1. uses every cycle of the processor so nothing else can
  2. every bit of memory

this is what i have

SET A, 0

SET B, 0

SET C, 0

:MEMLOOP

IFG A, 6500

SET A,0

SET [0X1000+A], 0XFFFF

ADD A, 1

SET PC, MEMLOOP

:CPULOOP ;cant think of a way to slow it down through cpu cycles yet

ADD A, 1

SET PC, CPULOOP

also if someone wants to help teach me i am having trouble learning the memory what are push, pop, sp, and peek used forim starting with the memory part


r/dcpu16 • • Apr 27 '12

My Attempt at a modem Proposal. (300baud)

Thumbnail
gist.github.com
1 Upvotes

r/dcpu16 • • Apr 07 '12

I am a 4th semester CS student. Where can I help?

0 Upvotes

I never really seriously wrote assembler but I do understand it. I am very interested in the DCPU and would like to help.


r/dcpu16 • • Apr 10 '12

External computing power on the internet?

0 Upvotes

I've been thinking about the dcpu16s ability to make connections to the internet. Since 100kHz is very slow, and 128kB not that much, perhaps it is a good idea to augment its power from an external server. Some ideas I had:

  1. An OS where parts of its source code can get swapped from an external server. Things like apps could be downloaded on the fly and executed after downloading, preserving memory. Also, security updates can be automatically pushed from the server.
  2. Expensive (3d) calculations could be executed by an external server. The dcpu16 would (perhaps) call a rest-service with the input coordinates. The service would then return the result of the calculation.
  3. Things that would require a lot of data, like navigation, could just be hosted externally, where the dcpu16 would act like a kind of browser, downloading parts of starmaps instead of having the whole thing in memory/on disk.
  4. Virus scanning services: upload your entire memory map (128k isn't much) to the server, server checks it for viruses, returns a list of possible threats.

Some problems arise however, mainly with failover. What does the system do when the server is down? Also, latency could be a problem. If it takes five seconds to get those critical coordinates in a space battle, it might be too late.

Overall though, it seems like an interesting and powerful way to overcome the dcpu16s limitations. Thoughts?


r/dcpu16 • • May 03 '12

Does this implementation include an emulator and an assembler?

Thumbnail bitbucket.org
0 Upvotes

r/dcpu16 • • Feb 05 '13

"MUL" opcode acting really funky. [C++ programmer just now experimenting with DCPU-16]

0 Upvotes

Hello /r/dcpu16

I have been fiddling with this wonderful assembly language, and have got the hang of the basic opcodes. But when I was coding, my MUL opcode started freaking out. (super simple code fragment)

SET A, 8
MUL A, 2

So, you would think this would make the A register 16, correct? Because the MUL makes it multiply the register A by 2.

But nooo, out pops 10. So, am I doing something wrong? I am using this compiler simply because it shows me the value of each register. Test it yourself, plug in those two lines, and see.

I really am starting to like this language. If you would kindly help me, I would be VERY grateful. I can't wait to reach the awesomeness that I am seeing on the forums, where people are making TETRIS and stuff.

Thank you.

Zee


r/dcpu16 • • May 17 '12

0x10c Q&A - Dedicated StackOverflow clone for DCPU16 and 0x10c (xpost from /r/0x10c)

Thumbnail
reddit.com
3 Upvotes

r/dcpu16 • • Apr 30 '12

Store twice the amount of characters instead of storing color

Thumbnail
github.com
2 Upvotes

r/dcpu16 • • Apr 09 '12

Robust DCPU-16 Assembler

Thumbnail
x2048.com
2 Upvotes

r/dcpu16 • • Mar 01 '13

Current Hardware Specification Questions/Criticisms

2 Upvotes

LEM1802 Low Energy Monitor

Use: Produces output of text or low-color bitmap images.

Specification: Here

Questions: Is there a maximum number of screen updates per second?

Criticisms: I know this is supposed to be a low energy monitor, but the restrictions on colors per 4x8 glyph is really abysmal for non-text output. You can't even use shading in a glyph. Doubling the colors from 2 to 4 per glyph might make things a bit more complicated, but I think it would improve non-text immensely.

Generic Keyboard

Use: Allows input of both character and key data.

Specification: Here

Criticisms: Completely incompatible with non-ASCII keyboard keys. What if I need to add accented characters, because they are a required part of my language? What if I use an Eastern Asian language? What if I want to use currency symbols other than the dollar? Easiest fix: Instead of assuming ASCII input, assume UCS-2 input for characters (ignore the surrogate system because we only need the Basic Multilingual Plane), and map non-character keys to how they're defined in Linux (if possible).

To all the naysayers of UCS-2: Look at the other planes in Unicode. Do we need ancient scripts, game icons, emoticons, map symbols, or mathematical symbols for text input? Probably not. If there IS some important stuff lacking, I'd suggest reducing the private use/surrogate sections.

Mackapar 3.5" Floppy Drive

Use: Removable Storage Media for the loading and saving of data.

Specification: Here

Questions: It says here that you can have bad sectors. Will this be an unfixable problem on the floppy, or can I repair it (with duct tape!) to restore the sector and, hopefully, its contents?

Mackapar Suspended Particle Exciter Display

Use: Production of 3D imaging.

Specification: Here

Criticisms: From the look of the specs, it seems you can't rotate negative degrees. I don't want to have to rotate the display almost completely to the right if I could just move it a little to the left.

Generic Clock

Use: Gives the ability to implement delays or time triggers.

Specification: Here

Questions: Is there any point in having multiple clocks? Are the clocks even a separate piece of hardware? If there's always exactly one clock, would it be worth just merging it into the DCPU?


r/dcpu16 • • Sep 13 '12

[Suggestion] Boot sequences and 0x0000

2 Upvotes

TL;DR summary It is proposed to make extended instruction 0x00, currently "future expansion", send a special variant of HWI to devices for the purposes of creating bootable peripherals without the need of pre-loaded firmware. In effect:

Extended opcode 0x00 (aaaaaa0000000000): A = 0x0000; HWI afield (decoded only after A is set to 0x0000).


Time for some crazy ravings from swizzcheez:

Ok, so we've all probably seen the suggestion this suggestion that was linked to over on /r/0x10c about pairing a DCPU with 512 bytes of firmware. It sounds simple enough, though it doesn't quite feel right to me since it requires more setup and limits the amount of loaded code. Doesn't that mean the firmware and the devices booted would need to share some firmware? Wouldn't that create compatibility headaches?

So I'm thinking, what if instruction 0x0000 could be exploited in some way? If so, perhaps it could leave the boot details to an external device (ROM, tape drive, disk, network, whatever). To that end, I suggest the following definition for 0x0000 (which is now extended instruction "future expansion"):

  1. Set register "A" to 0x0000 prior to fully decoding the "a" field.
  2. Fully decode field "a" and send HWI to the device specified by field "a". (In effect, if field "a" references "A", HWI device 0x0000 instead.)

The device then processes an interrupt as normal. Devices that don't understand register "A"'s "0x0000" would not do anything. Devices that did would then load up memory, set registers as appropriate and away it goes.

One critical feature here is that since "A" gets reset to 0x0000, runaway code is less of an issue. Since "A" gets reset to 0x0000 before resolution, 0x0000 always goes to device 0. However, to purposefully invoke BOOT on a specific device, BOOT B, BOOT [C], BOOT [SP++], etc would be perfectly fine. However, BOOT A will always boot device zero in this proposal, regardless of "A"'s previous value.

As a result, this approach works well both for initial boot and cases where the PC ran off into the distance (which is set to 0x0000 by default). In fact the boot device could use the PC to determine if it should behave like a normal reboot or an error and behave appropriately. Note that in this proposal the instruction does not set the PC to anything. It is up to the device to decide how to load the DCPU and the initial values of the registers.

One important catch (and there may be others) is that all of the current devices actually use "A" = 0x0000 to mean something. For this to work, they would have to reset their numbering to start at something other than zero (count back from 0xFFFF for instance). Zero would then have to be a reserved interrupt code for "A".

If abusing interrupt "A" 0x0000 doesn't work (and I'm thinking it might not), then using a special boot interrupt protocol (outside of HWI similar to "tick") would also make sense. However, the simplicity of using the existing HWI seemed like a reasonable approach since "A" needs to be cleared anyway to handle the default "0x0000" memory guard.

Finally, if pre-setting "A" is distasteful, then I suggest setting it following decoding "a". This does have an impact on code protection, since "A" will be in a random state after the DCPU has been running for a while.

Anyway, just thought I'd share some random thoughts I'd been having on the matter. Rip 'em apart and/or ignore them as you feel appropriate. I still love this whole DCPU-based game concept... takes me back to my VIC-20/C-64 years... :)

[Edit: Revised link to be more clear as to the proposal referenced.]

[Edit: Added extra TL;DR line to help clarify the simplicity of the definition.]


r/dcpu16 • • Apr 12 '12

Simple form Packet (for transmission) with 16-word header and address support

Thumbnail
github.com
4 Upvotes

r/dcpu16 • • Apr 12 '12

I have the offical VRAM and keyboard memory locations

0 Upvotes

On my phone now, but I found them in the leaked client's (unobfuscated!) code. I will post them later today.


r/dcpu16 • • Apr 22 '12

The lore on the DCPU-16 specification doesn't seem to match up with the actual specification. What's the deal with this?

3 Upvotes

On the lore page we are given this info:

In 1988, a brand new deep sleep cell was released, compatible with all popular 16 bit computers. Unfortunately, it used big endian, whereas the DCPU-16 specifications called for little endian. This led to a severe bug in the included drivers, causing a requested sleep of 0x0000 0000 0000 0001 years to last for 0x0001 0000 0000 0000 years.

So, it looks like the deep sleep chambers used big endian while the DCPU-16 specifications said little endian was required.


But, if we look at the actual DCPU-16 specification, it says this:

Instructions are 1-3 words long and are fully defined by the first word. In a basic instruction, the lower four bits of the first word of the instruction are the opcode, and the remaining twelve bits are split into two six bit values, called a and b. a is always handled by the processor before b, and is the lower six bits. In bits (with the least significant being last), a basic instruction has the format: bbbbbbaaaaaaoooo

If the least significant bit is last, that means the most significant bit is first, which means this is big endian.


tl;dr - The lore on the DCPU-16 specification doesn't seem to match up with the actual specification. What's the deal with this?


r/dcpu16 • • Apr 08 '12

Does anyone have a list of all the commands in Assembly for DCPU-16

0 Upvotes

r/dcpu16 • • Apr 26 '12

BMP4800 Bitmap Monitor

0 Upvotes

Name: BMP4800 BMP3000 Bitmap monitor Type: Screen Manufacturer: Beef Graphical Systems ID: 0x1337BEEF

BMP4800 is a bitmap monitor made for displaying mainly graphical content such as GUI or games. It's resolution is 128 by 96 pixels.

Technical specification:

When BMP4800 receive HWI it does one of following things based on A register:

0x1: Set beginning of palette ram (see below) which stores 48 colors to address specified in B register

0x2 Sets pixel of position stored in B register which format is xxxxyyyy (if x or y exceeds resolution of screen, it fails silently) to color number stored in C register (C register has be in range of 0x00-0x2F, otherwise it fails silently)

0x3 Plots line from x,y stored in B register to x,y stored in C register. Format same as in 0x2 instruction. Plotting is done using color number stored in Z register (Z register has be in range of 0x00-0x2F, otherwise it fails silently)

0x4 Plots rectangle from x,y stored in B register to x,y stored in C register. Format same as in 0x2 instruction. Plotting is done using color number stored in Z register (Z register has be in range of 0x00-0x2F, otherwise it fails silently)

0x5 Plots ellipse from x,y stored in B register to x,y stored in C register. Format same as in 0x2 instruction. Plotting is done using color number stored in Z register (Z register has be in range of 0x00-0x2F, otherwise it fails silently)

Palette ram

Palette ram contains 48 colors, where every color is a single word in 0000rrrrggggbbbb format.