* asranlib/asranlib.c, link/lkar.h, link/lkar.c:
[fw/sdcc] / as / z80 / z80pst.c
index 55a68dc3acdf2022db22396c9977e42cdffd0e11..1c4b431487c8e26401d7f025e969d6b90ef02713 100644 (file)
@@ -1,13 +1,20 @@
-/* z80pst.c */
+/* z80pst.c
 
-/*
- * (C) Copyright 1989-1995
- * All Rights Reserved
- *
- * Alan R. Baldwin
- * 721 Berkeley St.
- * Kent, Ohio  44240
- */
+   Copyright (C) 1989-1995 Alan R. Baldwin
+   721 Berkeley St., Kent, Ohio 44240
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 /*
  * Extensions: P. Felber
@@ -24,156 +31,157 @@ struct    mne     mne[] = {
 
        /* system */
 
-       NULL,   "CON",          S_ATYP,         0,      A_CON,
-       NULL,   "OVR",          S_ATYP,         0,      A_OVR,
-       NULL,   "REL",          S_ATYP,         0,      A_REL,
-       NULL,   "ABS",          S_ATYP,         0,      A_ABS|A_OVR,
-       NULL,   "NOPAG",        S_ATYP,         0,      A_NOPAG,
-       NULL,   "PAG",          S_ATYP,         0,      A_PAG,
-
-       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,
+    { NULL,    "CON",          S_ATYP,         0,      A_CON },
+    { NULL,    "OVR",          S_ATYP,         0,      A_OVR },
+    { NULL,    "REL",          S_ATYP,         0,      A_REL },
+    { NULL,    "ABS",          S_ATYP,         0,      A_ABS },
+    { NULL,    "NOPAG",        S_ATYP,         0,      A_NOPAG },
+    { NULL,    "PAG",          S_ATYP,         0,      A_PAG },
+
+    { 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 },
+    { NULL,    ".optsdcc",     S_OPTSDCC,      0,      0 },
 
        /* z80 / hd64180 */
 
-       NULL,   "ld",           S_LD,           0,      0x40,
+    { NULL,    "ld",           S_LD,           0,      0x40 },
 
-       NULL,   "call",         S_CALL,         0,      0xC4,
-       NULL,   "jp",           S_JP,           0,      0xC2,
-       NULL,   "jr",           S_JR,           0,      0x18,
+    { NULL,    "call",         S_CALL,         0,      0xC4 },
+    { NULL,    "jp",           S_JP,           0,      0xC2 },
+    { NULL,    "jr",           S_JR,           0,      0x18 },
 #ifndef GAMEBOY
-       NULL,   "djnz",         S_DJNZ,         0,      0x10,
+    { NULL,    "djnz",         S_DJNZ,         0,      0x10 },
 #endif /* GAMEBOY */
-       NULL,   "ret",          S_RET,          0,      0xC0,
+    { NULL,    "ret",          S_RET,          0,      0xC0 },
 
-       NULL,   "bit",          S_BIT,          0,      0x40,
-       NULL,   "res",          S_BIT,          0,      0x80,
-       NULL,   "set",          S_BIT,          0,      0xC0,
+    { NULL,    "bit",          S_BIT,          0,      0x40 },
+    { NULL,    "res",          S_BIT,          0,      0x80 },
+    { NULL,    "set",          S_BIT,          0,      0xC0 },
 
-       NULL,   "inc",          S_INC,          0,      0x04,
-       NULL,   "dec",          S_DEC,          0,      0x05,
+    { NULL,    "inc",          S_INC,          0,      0x04 },
+    { NULL,    "dec",          S_DEC,          0,      0x05 },
 
-       NULL,   "add",          S_ADD,          0,      0x80,
-       NULL,   "adc",          S_ADC,          0,      0x88,
-       NULL,   "sub",          S_SUB,          0,      0x90,
-       NULL,   "sbc",          S_SBC,          0,      0x98,
+    { NULL,    "add",          S_ADD,          0,      0x80 },
+    { NULL,    "adc",          S_ADC,          0,      0x88 },
+    { NULL,    "sub",          S_SUB,          0,      0x90 },
+    { NULL,    "sbc",          S_SBC,          0,      0x98 },
 
-       NULL,   "and",          S_AND,          0,      0xA0,
-       NULL,   "cp",           S_AND,          0,      0xB8,
-       NULL,   "or",           S_AND,          0,      0xB0,
-       NULL,   "xor",          S_AND,          0,      0xA8,
+    { NULL,    "and",          S_AND,          0,      0xA0 },
+    { NULL,    "cp",           S_AND,          0,      0xB8 },
+    { NULL,    "or",           S_AND,          0,      0xB0 },
+    { NULL,    "xor",          S_AND,          0,      0xA8 },
 
 #ifndef GAMEBOY
-       NULL,   "ex",           S_EX,           0,      0xE3,
+    { NULL,    "ex",           S_EX,           0,      0xE3 },
 #endif /* GAMEBOY */
 
-       NULL,   "push",         S_PUSH,         0,      0xC5,
-       NULL,   "pop",          S_PUSH,         0,      0xC1,
+    { NULL,    "push",         S_PUSH,         0,      0xC5 },
+    { NULL,    "pop",          S_PUSH,         0,      0xC1 },
 
 #ifndef GAMEBOY
-       NULL,   "in",           S_IN,           0,      0xDB,
-       NULL,   "out",          S_OUT,          0,      0xD3,
+    { NULL,    "in",           S_IN,           0,      0xDB },
+    { NULL,    "out",          S_OUT,          0,      0xD3 },
 #endif /* GAMEBOY */
 
-       NULL,   "rl",           S_RL,           0,      0x10,
-       NULL,   "rlc",          S_RL,           0,      0x00,
-       NULL,   "rr",           S_RL,           0,      0x18,
-       NULL,   "rrc",          S_RL,           0,      0x08,
-       NULL,   "sla",          S_RL,           0,      0x20,
-       NULL,   "sra",          S_RL,           0,      0x28,
-       NULL,   "srl",          S_RL,           0,      0x38,
+    { NULL,    "rl",           S_RL,           0,      0x10 },
+    { NULL,    "rlc",          S_RL,           0,      0x00 },
+    { NULL,    "rr",           S_RL,           0,      0x18 },
+    { NULL,    "rrc",          S_RL,           0,      0x08 },
+    { NULL,    "sla",          S_RL,           0,      0x20 },
+    { NULL,    "sra",          S_RL,           0,      0x28 },
+    { NULL,    "srl",          S_RL,           0,      0x38 },
 
-       NULL,   "rst",          S_RST,          0,      0xC7,
+    { NULL,    "rst",          S_RST,          0,      0xC7 },
 
 #ifndef GAMEBOY
-       NULL,   "im",           S_IM,           0,      0xED,
+    { NULL,    "im",           S_IM,           0,      0xED },
 #endif /* GAMEBOY */
 
-       NULL,   "ccf",          S_INH1,         0,      0x3F,
-       NULL,   "cpl",          S_INH1,         0,      0x2F,
-       NULL,   "daa",          S_INH1,         0,      0x27,
-       NULL,   "di",           S_INH1,         0,      0xF3,
-       NULL,   "ei",           S_INH1,         0,      0xFB,
+    { NULL,    "ccf",          S_INH1,         0,      0x3F },
+    { NULL,    "cpl",          S_INH1,         0,      0x2F },
+    { NULL,    "daa",          S_INH1,         0,      0x27 },
+    { NULL,    "di",           S_INH1,         0,      0xF3 },
+    { NULL,    "ei",           S_INH1,         0,      0xFB },
 #ifndef GAMEBOY
-       NULL,   "exx",          S_INH1,         0,      0xD9,
+    { NULL,    "exx",          S_INH1,         0,      0xD9 },
 #endif /* GAMEBOY */
-       NULL,   "nop",          S_INH1,         0,      0x00,
-       NULL,   "halt",         S_INH1,         0,      0x76,
-       NULL,   "rla",          S_INH1,         0,      0x17,
-       NULL,   "rlca",         S_INH1,         0,      0x07,
-       NULL,   "rra",          S_INH1,         0,      0x1F,
-       NULL,   "rrca",         S_INH1,         0,      0x0F,
-       NULL,   "scf",          S_INH1,         0,      0x37,
+    { NULL,    "nop",          S_INH1,         0,      0x00 },
+    { NULL,    "halt",         S_INH1,         0,      0x76 },
+    { NULL,    "rla",          S_INH1,         0,      0x17 },
+    { NULL,    "rlca",         S_INH1,         0,      0x07 },
+    { NULL,    "rra",          S_INH1,         0,      0x1F },
+    { NULL,    "rrca",         S_INH1,         0,      0x0F },
+    { NULL,    "scf",          S_INH1,         0,      0x37 },
 
 #ifndef GAMEBOY
-       NULL,   "cpd",          S_INH2,         0,      0xA9,
-       NULL,   "cpdr",         S_INH2,         0,      0xB9,
-       NULL,   "cpi",          S_INH2,         0,      0xA1,
-       NULL,   "cpir",         S_INH2,         0,      0xB1,
-       NULL,   "ind",          S_INH2,         0,      0xAA,
-       NULL,   "indr",         S_INH2,         0,      0xBA,
-       NULL,   "ini",          S_INH2,         0,      0xA2,
-       NULL,   "inir",         S_INH2,         0,      0xB2,
-       NULL,   "ldd",          S_INH2,         0,      0xA8,
-       NULL,   "lddr",         S_INH2,         0,      0xB8,
-       NULL,   "ldi",          S_INH2,         0,      0xA0,
-       NULL,   "ldir",         S_INH2,         0,      0xB0,
-       NULL,   "neg",          S_INH2,         0,      0x44,
-       NULL,   "otdr",         S_INH2,         0,      0xBB,
-       NULL,   "otir",         S_INH2,         0,      0xB3,
-       NULL,   "outd",         S_INH2,         0,      0xAB,
-       NULL,   "outi",         S_INH2,         0,      0xA3,
-       NULL,   "reti",         S_INH2,         0,      0x4D,
-       NULL,   "retn",         S_INH2,         0,      0x45,
-       NULL,   "rld",          S_INH2,         0,      0x6F,
-       NULL,   "rrd",          S_INH2,         0,      0x67,
+    { NULL,    "cpd",          S_INH2,         0,      0xA9 },
+    { NULL,    "cpdr",         S_INH2,         0,      0xB9 },
+    { NULL,    "cpi",          S_INH2,         0,      0xA1 },
+    { NULL,    "cpir",         S_INH2,         0,      0xB1 },
+    { NULL,    "ind",          S_INH2,         0,      0xAA },
+    { NULL,    "indr",         S_INH2,         0,      0xBA },
+    { NULL,    "ini",          S_INH2,         0,      0xA2 },
+    { NULL,    "inir",         S_INH2,         0,      0xB2 },
+    { NULL,    "ldd",          S_INH2,         0,      0xA8 },
+    { NULL,    "lddr",         S_INH2,         0,      0xB8 },
+    { NULL,    "ldi",          S_INH2,         0,      0xA0 },
+    { NULL,    "ldir",         S_INH2,         0,      0xB0 },
+    { NULL,    "neg",          S_INH2,         0,      0x44 },
+    { NULL,    "otdr",         S_INH2,         0,      0xBB },
+    { NULL,    "otir",         S_INH2,         0,      0xB3 },
+    { NULL,    "outd",         S_INH2,         0,      0xAB },
+    { NULL,    "outi",         S_INH2,         0,      0xA3 },
+    { NULL,    "reti",         S_INH2,         0,      0x4D },
+    { NULL,    "retn",         S_INH2,         0,      0x45 },
+    { NULL,    "rld",          S_INH2,         0,      0x6F },
+    { NULL,    "rrd",          S_INH2,         0,      0x67 },
 
        /* 64180 */
 
-       NULL,   ".hd64",        X_HD64,         0,      0,
+    { NULL,    ".hd64",        X_HD64,         0,      0 },
 
-       NULL,   "otdm",         X_INH2,         0,      0x8B,
-       NULL,   "otdmr",        X_INH2,         0,      0x9B,
-       NULL,   "otim",         X_INH2,         0,      0x83,
-       NULL,   "otimr",        X_INH2,         0,      0x93,
-       NULL,   "slp",          X_INH2,         0,      0x76,
+    { NULL,    "otdm",         X_INH2,         0,      0x8B },
+    { NULL,    "otdmr",        X_INH2,         0,      0x9B },
+    { NULL,    "otim",         X_INH2,         0,      0x83 },
+    { NULL,    "otimr",        X_INH2,         0,      0x93 },
+    { NULL,    "slp",          X_INH2,         0,      0x76 },
 
-       NULL,   "in0",          X_IN,           0,      0x00,
-       NULL,   "out0",         X_OUT,          0,      0x01,
+    { NULL,    "in0",          X_IN,           0,      0x00 },
+    { NULL,    "out0",         X_OUT,          0,      0x01 },
 
-       NULL,   "mlt",          X_MLT,          0,      0x4C,
+    { NULL,    "mlt",          X_MLT,          0,      0x4C },
 
-       NULL,   "tst",          X_TST,          0,      0x04,
-       NULL,   "tstio",        X_TSTIO,        S_END,  0x74
+    { NULL,    "tst",          X_TST,          0,      0x04 },
+    { NULL,    "tstio",        X_TSTIO,        S_END,  0x7 }
 #else /* GAMEBOY */
-       NULL,   "stop",         S_STOP,         0,      0x10,
-       NULL,   "swap",         S_RL,           0,      0x30,
-       NULL,   "reti",         S_INH1,         0,      0xD9,
-       NULL,   "ldh",          S_LDH,          0,      0xE0,
-       NULL,   "lda",          S_LDA,          0,      0xE8,
-       NULL,   "ldhl",         S_LDHL,         S_END,  0xF8
+    { NULL,    "stop",         S_STOP,         0,      0x10 },
+    { NULL,    "swap",         S_RL,           0,      0x30 },
+    { NULL,    "reti",         S_INH1,         0,      0xD9 },
+    { NULL,    "ldh",          S_LDH,          0,      0xE0 },
+    { NULL,    "lda",          S_LDA,          0,      0xE8 },
+    { NULL,    "ldhl",         S_LDHL,         S_END,  0xF }
 #endif /* GAMEBOY */
 };