2

SDCC のアセンブラは ASxxxx から派生したもので、マニュアルでは .define コマンドについて説明しています: http://shop-pdp.net/ashtml/asxs02.htm#define

これは派生物であるため、すべてが同じように機能するわけではありませんが、コマンド ライン引数のヘルプで .define ("-b Display .define substitions in list") について説明されているので、そこにあると思います。

しかし、私がするとき:

.define ay /-1/

エラーが発生します:

g.s:1: Error: <o> .org in REL area or directive / mnemonic error

私が試した他のフォームは次のとおりです。

.define ay ^/-1/
.define ay "-1"
.define kword /foo/

これらはすべて同じエラーになります。私が試したら

.define

エラーは次のようになります。

g.s:1: Error: <q> missing or improper operators, terminators, or delimiters

ただし、同じエラーが発生する.blargため、キーワードが削除された可能性があります(なぜですか?)

何か間違ったことをしているのですか、それとも sdasz80 が壊れているだけですか?

4

3 に答える 3

2

うーん、なんらかの理由で削除された機能のようです。SDCC のソース (sdas ソースはこちら: https://github.com/svn2github/sdcc/tree/master/sdcc/sdas ) の github ミラーを検索すると、SDCC の asxxxx.h (最後に編集されたのは 6 年前) には次のブロックがあります。

/*
 *      The def structure is used by the .define assembler
 *      directive to define a substitution string for a
 *      single word.  The def structure contains the
 *      string being defined, the string to substitute
 *      for the defined string, and a link to the next
 *      def structure.  The defined string is a sequence
 *      of characters not containing any white space
 *      (i.e. NO SPACEs or TABs).  The substitution string
 *      may contain SPACES and/or TABs.
 */
struct def
{
        struct def      *d_dp;          /* link to next define */
        char            *d_id;          /* defined string */
        char            *d_define;      /* string to substitute for defined string     */
        int             d_dflag;        /* (1) .defined / (0) .undefined */
};

しかし、私が知る限り、その構造はどこにも使用されていません。

于 2018-12-04T09:19:51.710 に答える