z80 EQU ORG or $

  • slenk

    Does the Z80 compiler recognize the ORG command or EQU or $?

    Is there a webpage that lists all the commands and syntax?
    e.g. most z80 compilers dont need hash signs before numbers,

    Last edit: slenk 2013-07-22
  • Maarten Brock
    Maarten Brock

    SDCC comes with documentation for the asxxxx assembler and linker. It's in a simple text file.

  • slenk

    I looked in the sdcc/doc/sdas folder
    it just mentioned some other processors

  • Maarten Brock
    Maarten Brock

    Have you looked in asmlnk.txt? I'm sorry I wasn't more concrete before, but I was away from my computer.

  • David Cary
    David Cary

    Go to https://sourceforge.net/projects/sdcc/files/sdcc-doc/3.3.0/ (or a later version), download sdcc-doc-3.3.0.zip , unzip it, and then look at Downloads/sdcc-doc-3.3.0/doc/sdas/asmlnk.txt and Downloads/sdcc-doc-3.3.0/doc/sdccman.pdf .

    The asmlnk.txt document "lists all the commands and syntax" for the assembler/linker that comes with SDCC, including "the .org directive", "The .z80 directive", the ".equ, .gblequ, and .lclequ Directives", and many different ways of using the '$' character.

    The sdccman.pdf document "lists all the commands and syntax" for the SDCC C language compiler, including the "-mz80" command-line option, "Options common to all z80-related ports".
    To get the effect of "ORG" in a ".c" file, you could use in-line assembly or perhaps "__at" (for variable data), "#pragma codeseg" (for code), "#pragma constseg" (for constants).
    To get the effect of "EQU", I usually use "const" or "#define".

    I wish I could give you a URL link directly to that file in the SDCC assembler documentation, and another URL directly to that section of the SDCC compiler documentation.
    Something like http://shop-pdp.kent.edu/ashtml/asxs02.htm#org .
    Is there a good reason reason not to allow such deep linking?

  • and just checked, the link given within the pdf version of the SDCC manual in section
    6.3 Documentation included in the distribution
    is functional