0

我正在尝试在 ASM 中为 GBDK 的 LCC 编写字符串文字。我可以编写每个单独的字符并且编译器工作正常。

.D_LINE = 0x0A
;; Works
.db "G", "I", "A", "N", "L", "U", "C", "A", #.D_LINE

但是,当我尝试将字符组合成一个字符串以使其更具可读性时:

.D_LINE = 0x0A
;; Doesn't work
.db "GIANLUCA", #.D_LINE

我得到一个编译错误:

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

有没有办法解决这个问题?

版本信息

$ lcc -v
lcc $Id: lcc.c,v 1.6 2001/10/28 18:38:13 michaelh Exp $

$ sdcc -v
SDCC : gbz80/z80 2.3.1/gbdk-2.96a (Nov  4 2001) (UNIX) 
4

1 回答 1

0

这是指令列表:

NULL,   ".byte",    S_BYTE,     0,  0,
NULL,   ".db",      S_BYTE,     0,  0,
NULL,   ".word",    S_WORD,     0,  0,
NULL,   ".dw",      S_WORD,     0,  0,
NULL,   ".df",      S_FLOAT,    0,  0,
NULL,   ".ascii",   S_ASCII,    0,  0,
NULL,   ".asciz",   S_ASCIZ,    0,  0,
NULL,   ".blkb",    S_BLK,      0,  1,
NULL,   ".ds",      S_BLK,      0,  1,
NULL,   ".blkw",    S_BLK,      0,  2,
NULL,   ".page",    S_PAGE,     0,  0,
NULL,   ".title",   S_TITLE,    0,  0,
NULL,   ".sbttl",   S_SBTL,     0,  0,
NULL,   ".globl",   S_GLOBL,    0,  0,
NULL,   ".area",    S_DAREA,    0,  0,
NULL,   ".even",    S_EVEN,     0,  0,
NULL,   ".odd",     S_ODD,      0,  0,
NULL,   ".if",      S_IF,       0,  0,
NULL,   ".else",    S_ELSE,     0,  0,
NULL,   ".endif",   S_ENDIF,    0,  0,
NULL,   ".include", S_INCL,     0,  0,
NULL,   ".radix",   S_RADIX,    0,  0,
NULL,   ".org",     S_ORG,      0,  0,
NULL,   ".module",  S_MODUL,    0,  0,
NULL,   ".ascis",   S_ASCIS,    0,  0,

https://github.com/hschmitt/gbdk/blob/d7707bf2b3c5433edcd37d53a1475fd51a9b9502/as/z80pst.c

于 2019-03-06T17:49:58.867 回答