Justin Fletcher's DCPU-16 assembler kit ======================================= Introduction ------------ DASM is a DCPU-16 assembler, disassembler and emulator kit. The DCPU-16 instruction set v1.1 is implemented, with a few extensions. This is not a macro assembler, yet. The assembler supports the syntax given as examples as part of the specification, with a few extensions. Usage ----- To assemble a file, use: ./dasm.pl -o .dump .dasm The dump format produced is a linked textual dump, in the same format as that given in the DCPU-16 specification. To disassemble a file, use: ./dasm.pl -o .dasm .dump The output disassembly file should be able to be reassembled. The argument to -o may by an extension, prefixed by a '.' character, to display the output. For example, to display a disassembly of a file, use: ./dasm.pl -o .dasm .dump The internal structures used by the file can be displayed by omitting any output: ./dasm.pl .dasm To execute the input files, add the '-run' option to the command line, for example: ./dasm.pl -run .dasm Execution of the code begins at address 0. There may be multiple input files on the command line which will be assembled in order. Source assembly file format --------------------------- The source assembly format is given as an example in the DCPU-16 specification. Operands (called 'values' in the specification) take the form specified in the specification, with the exception that the [SP] type specification is not supported (PUSH, PEEK and POP are far clearer). The following format is expected: ; - comment lines, which will be ignored. Comments may also be appended to all lines . - directives to the assembler, outside of the specification of the CPU. See below. :