DASM
|
DASM DCPU-16 source assembler class. More...
Go to the source code of this file.
Classes | |
class | DASMIO::Source |
DASM DCPU-16 source assembler class. More... |
DASM DCPU-16 source assembler class.
This class provides the implementation of the source code assembler for DASM.
The files we support end in '.dasm'.
Source file format:
[<label>] <opcode> <operand a>, <operand b> [<label>] <ext-opcode> <operand> ; <comment>
It also provides a disassembler which can produce source code which can be passed back to the assembler. If the source comes from one of the binary formats that doesn't offer relocations or symblols, the content will be more difficult to parse interpret, but should still work.
The structures we use are intended to be able to support libraries of relocatable, partially linked code. This has not yet been tested and the lack of any indication of which symbols are local and which are imported may be a problem in the future.
In addition to the 1.1 DCPU-16 specification, the assembler supports:
'X'
will evaluate to the number 88.1+4
will evaluate to the number 5. data + 4
will evaluate to the value of symbol 'data
' plus 4. $
' character: $
' will have the last label used prepended to the symbol name. This allows labels and references to be used within a routine without polluting the global namespace.DAT <value[,<value> ]*
CONST value
ADDRESS <value>
.<directive> <parameters>
allows additional meta operations to be performed. Directives supported:.ORIGIN address
.INCLUDE file
Definition in file Source.pm.