This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KillaVanilla's profile picture

DCPU-16 Assembler

Started by KillaVanilla, 30 March 2013 - 03:09 AM
KillaVanilla #1
Posted 30 March 2013 - 04:09 AM
Hello everyone.

I've been working on this assembler for the past few days, after doing quite a bit of coding for the DCPU-16 (low-level coding is fun). This is my first time writing any kind of assembler or compiler, so this may be kind of buggy. For more details on the DCPU-16 instruction set, visit: http://dcpu.com/dcpu-16/.

Usage:

DCPUCompiler <input> <output> <symbols> <arguments>

Required parameters:
  • <input> – The input assembly file.
  • <output> – The output binary (or text) file.
  • <symbols> – All symbols (i.e labels and macros) will be dumped here. If you want to disable this, pass "-" instead of a file name.
Arguments:
  • -a / –ascii-out / –text / –text-out : Write output as a text file containing "DAT" instructions instead of as a binary file.
  • -p / –print : Save all output to "assemblyLog".
  • -d / –debug : Enable debugging output (i.e symbol mappings, parser output, symbol substitutions, etc.) It's recommended that you use this with -p or –print.
Get it here. (Pastebin code: jfHR1Yde)
svdragster #2
Posted 30 March 2013 - 04:58 AM
Hey good job!
Mads #3
Posted 30 March 2013 - 05:57 AM
Wow, very nice! This is really damn impressive!
Dlcruz129 #4
Posted 31 March 2013 - 07:49 PM
Awesome! This will be good practice while I wait for 0x10c! Nice job.
oeed #5
Posted 01 April 2013 - 12:14 AM
Based on the fact that it says
DCPU-16 Specification
Copyright 1985 Mojang
Version 1.7

I presume this is for 0x10x?

Nice job, anyway. How does it work?
Dlcruz129 #6
Posted 01 April 2013 - 04:22 AM
Based on the fact that it says
DCPU-16 Specification
Copyright 1985 Mojang
Version 1.7

I presume this is for 0x10x?

Nice job, anyway. How does it work?

Yep. The DCPU-16 is the onboard computer in 0x10c. More instructions are in the link in the OP.