Search code examples
assembly6502

DASM directives/pseudops


I'm looking through the documentation and there are a few pseudo ops that I am stuck with, they are DV, LIST and XXX.

DV says is like DC but used with EQM, I've mess around with it, but I am not noticing any difference, I've try to find any examples but couldn't find any.

LIST and XXX, I'm not sure how these works either.


Solution

  • DV

    DV does macro expansion. This is best demonstrated with an example.

    mymacro  eqm    10 + ..
    
    mylist   dv     mymacro 1, 2, 3
    

    The first line defines a symbol mymacro that will be used as a macro. The dotdot (..) acts as a parameter.

    In the second line, the macro is applied to every expression in the list. From left to right:

    • 1 is replaced by 10 + 1
    • 2 is replaced by 10 + 2
    • 3 is replaced by 10 + 3

    Basically, the second line is equivalent to:

    mylist   dc     10 + 1, 10 + 2, 10 + 3
    

    which obviously is equivalent to:

    mylist   dc     11, 12, 13
    

    The example is rather trivial; DV may be more useful when the macro contains a symbol. For example:

    mylabel  dc     "ABCD"
    mymacro  eqm    mylabel + ..
    mylist   dv     mymacro 1, 2, 3
    

    is equivalent to:

    mylabel  dc     "ABCD"
    mylist   dc     mylabel + 1, mylabel + 2, mylabel + 3
    

    LIST

    LIST OFF and LIST ON affect output being written to the list file. Normally, every line from the source file is written to the list file; this is inhibited by LIST OFF. Error messages will still be written to the list file, though.

    Obviously, this only has effect if a list file was specified on the command line (option -l or -L).

    XXX

    As far as I can tell, DASM has no pseudop XXX. I guess you are refering to this part of the documentation:

    [label] XXX[.force] operand
    

    XXX is just a placeholder there; it can be any mnemonic you like, for example lda. See the section about the FORCE extension.