home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / nasm_src / asm65.c next >
C/C++ Source or Header  |  1993-01-19  |  51KB  |  1,438 lines

  1. #ifdef __cplusplus
  2.    #include <stdio.h>
  3.    extern "C" {
  4.      extern void yyerror(char *);
  5.      extern int yylex();
  6.    }
  7. #endif  /* __cplusplus */ 
  8.  
  9. # line 2 "asm65.y"
  10. /* ---------------------------------------------------------------------- */
  11. /*                   Copyright (C) 1992 by Natürlich!                     */
  12. /*                      This file is copyrighted!                         */
  13. /*                Refer to the documentation for details.                 */
  14. /* ---------------------------------------------------------------------- */
  15. /*#define YYDEBUG*/
  16. #include <stdio.h>
  17. #include "defines.h"
  18. #undef DEBUG
  19. #include "structs.h"
  20. #include "nasm.h"
  21. #include "labels.h"
  22. #include "code.h"
  23. #include "buffer.h"
  24. #include "exprfast.h"
  25. #include "op.h"
  26.  
  27. #if DEBUG
  28. #define bputchar( c)   putchar( c)
  29. #define dbprintf( s)    puts( s)
  30. #else
  31. #define dbputchar( c)
  32. #define dbprintf( s)
  33. #endif
  34.  
  35. #ifdef NIL
  36. #undef NIL
  37. #endif
  38. #define NIL   ((char *) 0)
  39. #define ENIL  ((expr *) 0)
  40.  
  41. extern int     _in_instr,
  42.                _in_doteq,
  43.                _call_macro,
  44.                wasstrlen,
  45.                state,
  46.                fully_mac65;
  47.  
  48.  
  49. extern buffer huge   *bp;
  50. extern word    __pc;
  51.  
  52. static char    undefined[] = { 9, 0, 'u','n','d','e','f','i','n','e','d' },
  53.                *lastident;
  54. static int     footok;
  55. static lword   fooval;
  56. #define adrmod footok      /* screws the debugger of course (har har) */
  57.  
  58. typedef union
  59. {
  60.    lword     u;
  61.    byte     *b;
  62.    char     *c;
  63.    expr     *e;
  64.    lexpr    *l;
  65. } YYSTYPE;
  66.  
  67. #define _ul    lword
  68. # define T_DOTEQ 257
  69. # define T_IF 258
  70. # define T_ELSE 259
  71. # define T_LOCAL 260
  72. # define T_EOL 261
  73. # define T_NUMBER 262
  74. # define T_ZEXT 263
  75. # define T_ENDIF 264
  76. # define T_ORG 265
  77. # define T_DS 266
  78. # define T_WORD 267
  79. # define T_BYTE 268
  80. # define T_SBYTE 269
  81. # define T_OPT 270
  82. # define T_MACRO 271
  83. # define T_ENDM 272
  84. # define T_END 273
  85. # define T_NUM 274
  86. # define T_OBJ 275
  87. # define T_MLIST 276
  88. # define T_INCLUDE 277
  89. # define T_ERROR 278
  90. # define T_TITLE 279
  91. # define T_DBYTE 280
  92. # define T_TAB 281
  93. # define T_FLOAT 282
  94. # define T_CBYTE 283
  95. # define T_XREF 284
  96. # define T_SET 285
  97. # define T_LIST 286
  98. # define T_ERR 287
  99. # define T_ACCU 288
  100. # define T_CHAR 289
  101. # define T_NOT 290
  102. # define T_DEF 291
  103. # define T_REF 292
  104. # define T_CLIST 293
  105. # define T_EJECT 294
  106. # define T_PAGE 295
  107. # define T_XFLOAT 296
  108. # define T_UNDEF 297
  109. # define T_WARN 298
  110. # define T_REPT 299
  111. # define T_CALL 300
  112. # define T_IDENT 301
  113. # define T_STRING 302
  114. # define T_LABEL 303
  115. # define T_FILE 304
  116. # define T_EXPR 305
  117. # define T_INSTR 306
  118. # define T_NO 307
  119. # define T_OR 308
  120. # define T_AND 309
  121. # define T_LEQ 310
  122. # define T_GEQ 311
  123. # define T_NEQ 312
  124. # define MIDDLE 313
  125. # define HIGHEST 314
  126. # define T_MPARA 315
  127. # define T_MSPARA 316
  128. # define T_MLPARA 317
  129. # define T_MLSPARA 318
  130. # define T_PARA 319
  131. # define REALHIGH 320
  132. #define yyclearin yychar = -1
  133. #define yyerrok yyerrflag = 0
  134. extern int yychar;
  135. #ifndef YYMAXDEPTH
  136. #define YYMAXDEPTH 150
  137. #endif
  138.  
  139. /* __YYSCLASS defines the scoping/storage class for global objects
  140.  * that are NOT renamed by the -p option.  By default these names
  141.  * are going to be 'static' so that multi-definition errors
  142.  * will not occur with multiple parsers.
  143.  * If you want (unsupported) access to internal names you need
  144.  * to define this to be null so it implies 'extern' scope.
  145.  * This should not be used in conjunction with -p.
  146.  */
  147. #ifndef __YYSCLASS
  148. # define __YYSCLASS static
  149. #endif
  150. YYSTYPE yylval;
  151. __YYSCLASS YYSTYPE yyval;
  152. typedef int yytabelem;
  153. # define YYERRCODE 256
  154. __YYSCLASS yytabelem yyexca[] ={
  155. -1, 0,
  156.         0, 4,
  157.         258, 4,
  158.         259, 4,
  159.         260, 4,
  160.         261, 4,
  161.         263, 4,
  162.         264, 4,
  163.         265, 4,
  164.         266, 4,
  165.         267, 4,
  166.         268, 4,
  167.         269, 4,
  168.         270, 4,
  169.         271, 4,
  170.         273, 4,
  171.         277, 4,
  172.         278, 4,
  173.         279, 4,
  174.         280, 4,
  175.         281, 4,
  176.         282, 4,
  177.         283, 4,
  178.         285, 4,
  179.         295, 4,
  180.         297, 4,
  181.         298, 4,
  182.         299, 4,
  183.         300, 4,
  184.         301, 4,
  185.         303, 4,
  186.         306, 4,
  187.         -2, 0,
  188. -1, 1,
  189.         0, -1,
  190.         -2, 0,
  191. -1, 6,
  192.         0, 14,
  193.         261, 14,
  194.         -2, 8,
  195. -1, 153,
  196.         310, 0,
  197.         311, 0,
  198.         61, 0,
  199.         312, 0,
  200.         62, 0,
  201.         60, 0,
  202.         -2, 68,
  203. -1, 154,
  204.         310, 0,
  205.         311, 0,
  206.         61, 0,
  207.         312, 0,
  208.         62, 0,
  209.         60, 0,
  210.         -2, 69,
  211. -1, 155,
  212.         310, 0,
  213.         311, 0,
  214.         61, 0,
  215.         312, 0,
  216.         62, 0,
  217.         60, 0,
  218.         -2, 70,
  219. -1, 156,
  220.         310, 0,
  221.         311, 0,
  222.         61, 0,
  223.         312, 0,
  224.         62, 0,
  225.         60, 0,
  226.         -2, 71,
  227. -1, 157,
  228.         310, 0,
  229.         311, 0,
  230.         61, 0,
  231.         312, 0,
  232.         62, 0,
  233.         60, 0,
  234.         -2, 72,
  235. -1, 166,
  236.         310, 0,
  237.         311, 0,
  238.         61, 0,
  239.         312, 0,
  240.         62, 0,
  241.         60, 0,
  242.         -2, 81,
  243.         };
  244. # define YYNPROD 117
  245. # define YYLAST 598
  246. __YYSCLASS yytabelem yyact[]={
  247.  
  248.     10,    11,    32,     8,   145,    20,    12,    13,    14,    15,
  249.     17,    19,    26,    29,    94,    31,    93,    92,    91,    30,
  250.     35,    33,    16,    25,    21,    18,   102,    27,   141,   126,
  251.    125,   101,    89,    53,    88,    71,    46,    34,    68,    28,
  252.     36,    24,    22,    23,   171,     6,    70,    37,     9,     3,
  253.     39,    48,   187,    47,    10,    11,    32,   137,   136,    20,
  254.     12,    13,    14,    15,    17,    19,    26,    29,    53,    31,
  255.    183,    46,    76,    30,    35,    33,    16,    25,    21,    18,
  256.     77,    27,    44,   184,    60,   128,    48,    53,    47,   179,
  257.     46,    34,   178,    28,    36,    24,    22,    23,   114,   176,
  258.    177,    63,     9,   113,   172,    48,    53,    47,    65,    46,
  259.     74,   170,    53,   169,   186,    46,   148,    44,   114,   111,
  260.     90,   112,   144,   113,    48,    96,    47,   142,   135,   117,
  261.     48,   127,    47,     7,   116,   117,    44,   181,   114,   111,
  262.    116,   112,    75,   113,   114,   111,    64,   112,   115,   113,
  263.    173,    72,   133,   134,    69,    44,   109,   119,   110,   143,
  264.     41,    44,   109,   119,   110,    66,    67,    98,   115,    38,
  265.    117,     5,    95,     4,     2,   116,    61,   138,   129,   114,
  266.    111,    49,   112,    99,   113,     1,     0,     0,   115,   167,
  267.    118,     0,     0,     0,   115,   117,   118,   109,   119,   110,
  268.    116,    86,    79,    81,   114,   111,     0,   112,     0,   113,
  269.      0,    83,   168,    80,    84,   174,     0,     0,     0,     0,
  270.     82,    85,   109,   119,   110,    86,    79,    81,     0,   115,
  271.      0,   118,   182,     0,    78,    83,     0,    80,    84,   185,
  272.      0,     0,     0,     0,    82,    85,    40,     0,     0,     0,
  273.      0,     0,   117,    50,   115,   180,   118,   116,     0,     0,
  274.      0,   114,   111,     0,   112,     0,   113,     0,     0,     0,
  275.      0,     0,     0,     0,     0,     0,     0,     0,     0,   103,
  276.     54,    45,    55,    56,     0,     0,     0,     0,    50,     0,
  277.      0,     0,    51,     0,     0,     0,    52,     0,     0,     0,
  278.      0,     0,     0,     0,     0,     0,     0,    50,     0,     0,
  279.     57,   115,     0,   118,     0,    54,    45,    55,    56,     0,
  280.      0,     0,     0,     0,     0,     0,    50,    51,   139,     0,
  281.      0,    52,    50,     0,    54,    45,    55,    56,     0,     0,
  282.      0,     0,     0,     0,     0,    57,    51,   130,     0,     0,
  283.     52,     0,     0,    54,    45,    55,    56,     0,     0,    54,
  284.     45,    55,    56,     0,    57,    51,     0,     0,     0,    52,
  285.      0,    51,     0,     0,     0,    52,     0,     0,     0,     0,
  286.      0,     0,     0,    57,     0,     0,    43,     0,     0,    57,
  287.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  288.      0,     0,     0,     0,   105,   104,   108,   107,   106,     0,
  289.    105,   104,   108,   107,   106,    62,     0,     0,     0,     0,
  290.      0,     0,     0,     0,     0,     0,    42,     0,     0,    58,
  291.     59,   120,   121,   122,   123,   124,     0,     0,     0,     0,
  292.     73,     0,     0,    87,     0,     0,   104,   108,   107,   106,
  293.      0,     0,     0,     0,     0,    97,     0,   100,     0,     0,
  294.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  295.      0,     0,   108,   107,   106,     0,     0,     0,     0,     0,
  296.    131,   132,   131,   131,     0,     0,     0,     0,   140,     0,
  297.      0,   151,   152,   153,   154,   155,   156,   157,   158,   159,
  298.    160,   161,   162,   163,   164,   165,   166,     0,     0,     0,
  299.      0,     0,   146,     0,   147,     0,     0,   149,   150,     0,
  300.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  301.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  302.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  303.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  304.    175,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  305.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  306.      0,     0,     0,     0,     0,   131,     0,     0,     0,   140,
  307.      0,     0,     0,     0,     0,     0,     0,   140 };
  308. __YYSCLASS yytabelem yypact[]={
  309.  
  310.   -207, -3000,  -258, -3000,  -214, -3000,   -11, -3000, -3000, -3000,
  311.     70, -3000, -3000,    70,    70,    70,    70,    65,    65,    65,
  312.   -263,  -250,  -266, -3000,    70,    70,   -73,    70,  -267,  -269,
  313.     85, -3000, -3000,  -284,  -285,  -286,  -288, -3000,  -204,    64,
  314.  -3000,    -9, -3000,   102,    70,    70,    70,    70,    70, -3000,
  315.  -3000, -3000, -3000, -3000, -3000,  -271,  -272, -3000, -3000, -3000,
  316.  -3000,    87, -3000, -3000,    45,    70,    45,    45, -3000,    84,
  317.  -3000, -3000,    26,  -273, -3000,    83, -3000, -3000,   -49, -3000,
  318.  -3000, -3000, -3000, -3000, -3000, -3000, -3000,    78, -3000, -3000,
  319.   -300, -3000, -3000, -3000, -3000, -3000,    70, -3000,    70, -3000,
  320.     72,    70,    70, -3000,    70,    70,    70,    70,    70,    70,
  321.     70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
  322.     96, -3000, -3000,   219,   219, -3000, -3000,    70, -3000,    69,
  323.  -3000, -3000,    67, -3000, -3000,  -252, -3000, -3000,    60, -3000,
  324.  -3000, -3000,   -73, -3000,    70, -3000, -3000, -3000,    11,    48,
  325.  -3000,   162,   137,   219,   219,   219,   219,   219,    56,    56,
  326.  -3000, -3000, -3000,    76,    76,    76,   219, -3000, -3000,    45,
  327.  -3000, -3000, -3000,    26, -3000, -3000, -3000, -3000,   -18,    39,
  328.  -3000,    26, -3000,    73,   -37, -3000, -3000, -3000 };
  329. __YYSCLASS yytabelem yypgo[]={
  330.  
  331.      0,   185,   183,   386,   181,   146,   415,   178,   177,    85,
  332.     57,    84,   176,    58,   174,   173,   171,   169,   133,   167,
  333.    160,   154,   151,   150,   142,   137,    72,    80 };
  334. __YYSCLASS yytabelem yyr1[]={
  335.  
  336.      0,     1,     1,    14,    14,    14,    16,    16,    17,    15,
  337.     15,    15,    19,    15,    15,    15,    20,    18,    18,    18,
  338.     18,    18,    18,    18,    18,    18,    18,    18,    18,    18,
  339.     18,    22,    18,    23,    18,    18,    18,    18,    18,    18,
  340.     18,    18,    18,    18,    18,    18,    18,     2,     2,     2,
  341.      2,     2,     2,     2,     2,     2,     4,     4,     4,     4,
  342.      4,     4,     4,     4,     6,     3,     3,     3,     3,     3,
  343.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  344.      3,     3,     3,     3,     3,     3,     3,    12,    11,    11,
  345.      5,     5,     7,     7,     9,     9,     8,     8,    10,    25,
  346.     10,    13,    13,    21,    21,    24,    24,    26,    26,    27,
  347.     27,    27,    27,    27,    27,    27,    27 };
  348. __YYSCLASS yytabelem yyr2[]={
  349.  
  350.      0,     4,     2,     5,     0,     3,     4,     2,     1,     7,
  351.      9,     7,     1,     9,     3,     3,     1,     7,     5,     3,
  352.      3,     5,     5,     5,     5,     7,     7,     7,     5,     4,
  353.      5,     1,     7,     1,    11,     5,     5,     9,     5,     5,
  354.      7,     3,     3,     5,     5,     5,     5,     7,     7,    11,
  355.     11,     5,     7,     3,     3,     1,     3,     3,     2,     3,
  356.      3,     5,     5,     3,     3,     7,     7,     7,     7,     7,
  357.      7,     7,     7,     7,     7,     7,     7,     7,     7,     7,
  358.      7,     7,     5,     5,     5,     5,     2,     3,     2,     7,
  359.      7,     1,     3,     3,     2,     7,     3,     3,     2,     1,
  360.      9,     1,     3,     2,     6,     2,     6,     2,     4,     2,
  361.      2,     2,     2,     2,     2,     2,     2 };
  362. __YYSCLASS yytabelem yychk[]={
  363.  
  364.  -3000,    -1,   -14,   256,   -15,   -16,   303,   -18,   261,   306,
  365.    258,   259,   264,   265,   266,   267,   280,   268,   283,   269,
  366.    263,   282,   300,   301,   299,   281,   270,   285,   297,   271,
  367.    277,   273,   260,   279,   295,   278,   298,   261,   -17,    61,
  368.    257,   -20,    -6,    -3,    91,   290,    45,    62,    60,    -4,
  369.    262,   301,   305,    42,   289,   291,   292,   319,    -6,    -6,
  370.    -11,   -12,    -6,   -11,    -5,    43,    -5,    -5,   301,   -21,
  371.    296,   301,   -22,    -6,   -11,   -24,   -26,   -27,   307,   275,
  372.    286,   276,   293,   284,   287,   294,   274,    -6,   301,   301,
  373.     35,   302,   302,   302,   302,   -18,    61,    -6,   -19,    -2,
  374.     -6,    40,    35,   288,   309,   308,   312,   311,   310,    60,
  375.     62,    43,    45,    47,    42,    92,    38,    33,    94,    61,
  376.     -3,    -3,    -3,    -3,    -3,   301,   301,    44,    -9,    -7,
  377.    302,    -6,    -6,    -9,    -9,    44,   -13,   -10,    -8,   302,
  378.     -6,   301,    44,   -27,    44,   304,    -6,    -6,    44,    -6,
  379.     -6,    -3,    -3,    -3,    -3,    -3,    -3,    -3,    -3,    -3,
  380.     -3,    -3,    -3,    -3,    -3,    -3,    -3,    93,   -11,    44,
  381.     44,   296,    44,   -23,   -26,    -6,    88,    89,    44,    41,
  382.     -9,   -25,   -13,    88,    44,   -10,    41,    89 };
  383. __YYSCLASS yytabelem yydef[]={
  384.  
  385.     -2,    -2,     2,     5,     1,     3,    -2,    15,     7,    16,
  386.      0,    19,    20,     0,     0,     0,     0,    91,    91,    91,
  387.      0,     0,     0,    31,     0,     0,     0,     0,     0,     0,
  388.      0,    41,    42,     0,     0,     0,     0,     6,     0,     0,
  389.     12,    55,    18,    64,     0,     0,     0,     0,     0,    86,
  390.     56,    57,    58,    59,    60,     0,     0,    63,    21,    22,
  391.     23,    88,    87,    24,     0,     0,     0,     0,    28,    29,
  392.    103,    30,   101,     0,    35,    36,   105,   107,     0,   109,
  393.    110,   111,   112,   113,   114,   115,   116,     0,    38,    39,
  394.      0,    43,    44,    45,    46,     9,     0,    11,     0,    17,
  395.     53,     0,     0,    54,     0,     0,     0,     0,     0,     0,
  396.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  397.      0,    82,    83,    84,    85,    61,    62,     0,    25,    94,
  398.     92,    93,     0,    26,    27,     0,    32,   102,    98,    96,
  399.     97,    33,     0,   108,     0,    40,    10,    13,     0,     0,
  400.     51,    66,    67,    -2,    -2,    -2,    -2,    -2,    73,    74,
  401.     75,    76,    77,    78,    79,    80,    -2,    65,    89,     0,
  402.     90,   104,    99,   101,   106,    37,    47,    48,     0,    52,
  403.     95,     0,    34,     0,     0,   100,    49,    50 };
  404. typedef struct { char *t_name; int t_val; } yytoktype;
  405. #ifndef YYDEBUG
  406. #       define YYDEBUG  0       /* don't allow debugging */
  407. #endif
  408.  
  409. #if YYDEBUG
  410.  
  411. __YYSCLASS yytoktype yytoks[] =
  412. {
  413.         "T_DOTEQ",      257,
  414.         "T_IF", 258,
  415.         "T_ELSE",       259,
  416.         "T_LOCAL",      260,
  417.         "T_EOL",        261,
  418.         "T_NUMBER",     262,
  419.         "T_ZEXT",       263,
  420.         "T_ENDIF",      264,
  421.         "T_ORG",        265,
  422.         "T_DS", 266,
  423.         "T_WORD",       267,
  424.         "T_BYTE",       268,
  425.         "T_SBYTE",      269,
  426.         "T_OPT",        270,
  427.         "T_MACRO",      271,
  428.         "T_ENDM",       272,
  429.         "T_END",        273,
  430.         "T_NUM",        274,
  431.         "T_OBJ",        275,
  432.         "T_MLIST",      276,
  433.         "T_INCLUDE",    277,
  434.         "T_ERROR",      278,
  435.         "T_TITLE",      279,
  436.         "T_DBYTE",      280,
  437.         "T_TAB",        281,
  438.         "T_FLOAT",      282,
  439.         "T_CBYTE",      283,
  440.         "T_XREF",       284,
  441.         "T_SET",        285,
  442.         "T_LIST",       286,
  443.         "T_ERR",        287,
  444.         "T_ACCU",       288,
  445.         "T_CHAR",       289,
  446.         "T_NOT",        290,
  447.         "T_DEF",        291,
  448.         "T_REF",        292,
  449.         "T_CLIST",      293,
  450.         "T_EJECT",      294,
  451.         "T_PAGE",       295,
  452.         "T_XFLOAT",     296,
  453.         "T_UNDEF",      297,
  454.         "T_WARN",       298,
  455.         "T_REPT",       299,
  456.         "T_CALL",       300,
  457.         "T_IDENT",      301,
  458.         "T_STRING",     302,
  459.         "T_LABEL",      303,
  460.         "T_FILE",       304,
  461.         "T_EXPR",       305,
  462.         "T_INSTR",      306,
  463.         ",",    44,
  464.         "T_NO", 307,
  465.         "T_OR", 308,
  466.         "T_AND",        309,
  467.         "T_LEQ",        310,
  468.         "T_GEQ",        311,
  469.         "=",    61,
  470.         "T_NEQ",        312,
  471.         ">",    62,
  472.         "<",    60,
  473.         "MIDDLE",       313,
  474.         "!",    33,
  475.         "^",    94,
  476.         "&",    38,
  477.         "+",    43,
  478.         "-",    45,
  479.         "*",    42,
  480.         "/",    47,
  481.         "\\",   92,
  482.         "HIGHEST",      314,
  483.         "T_MPARA",      315,
  484.         "T_MSPARA",     316,
  485.         "T_MLPARA",     317,
  486.         "T_MLSPARA",    318,
  487.         "T_PARA",       319,
  488.         "REALHIGH",     320,
  489.         "-unknown-",    -1      /* ends search */
  490. };
  491.  
  492. __YYSCLASS char * yyreds[] =
  493. {
  494.         "-no such reduction-",
  495.         "file : source line",
  496.         "file : source",
  497.         "source : source sline",
  498.         "source : /* empty */",
  499.         "source : error",
  500.         "sline : line T_EOL",
  501.         "sline : T_EOL",
  502.         "line : T_LABEL",
  503.         "line : T_LABEL nline",
  504.         "line : T_LABEL '=' '=' __expr",
  505.         "line : T_LABEL '=' __expr",
  506.         "line : T_LABEL T_DOTEQ",
  507.         "line : T_LABEL T_DOTEQ __expr",
  508.         "line : T_LABEL",
  509.         "line : nline",
  510.         "nline : T_INSTR",
  511.         "nline : T_INSTR irest",
  512.         "nline : T_IF __expr",
  513.         "nline : T_ELSE",
  514.         "nline : T_ENDIF",
  515.         "nline : T_ORG __expr",
  516.         "nline : T_DS __expr",
  517.         "nline : T_WORD i_expr",
  518.         "nline : T_DBYTE i_expr",
  519.         "nline : T_BYTE modif si_expr",
  520.         "nline : T_CBYTE modif si_expr",
  521.         "nline : T_SBYTE modif si_expr",
  522.         "nline : T_ZEXT T_IDENT",
  523.         "nline : T_FLOAT f_expr",
  524.         "nline : T_CALL T_IDENT",
  525.         "nline : T_IDENT",
  526.         "nline : T_IDENT ei_expr",
  527.         "nline : T_REPT __expr T_IDENT",
  528.         "nline : T_REPT __expr T_IDENT ei_expr",
  529.         "nline : T_TAB i_expr",
  530.         "nline : T_OPT o_expr",
  531.         "nline : T_SET __expr ',' __expr",
  532.         "nline : T_UNDEF T_IDENT",
  533.         "nline : T_MACRO T_IDENT",
  534.         "nline : T_INCLUDE '#' T_FILE",
  535.         "nline : T_END",
  536.         "nline : T_LOCAL",
  537.         "nline : T_TITLE T_STRING",
  538.         "nline : T_PAGE T_STRING",
  539.         "nline : T_ERROR T_STRING",
  540.         "nline : T_WARN T_STRING",
  541.         "irest : __expr ',' 'X'",
  542.         "irest : __expr ',' 'Y'",
  543.         "irest : '(' __expr ',' 'X' ')'",
  544.         "irest : '(' __expr ')' ',' 'Y'",
  545.         "irest : '#' __expr",
  546.         "irest : '(' __expr ')'",
  547.         "irest : __expr",
  548.         "irest : T_ACCU",
  549.         "irest : /* empty */",
  550.         "a_expr : T_NUMBER",
  551.         "a_expr : T_IDENT",
  552.         "a_expr : T_EXPR",
  553.         "a_expr : '*'",
  554.         "a_expr : T_CHAR",
  555.         "a_expr : T_DEF T_IDENT",
  556.         "a_expr : T_REF T_IDENT",
  557.         "a_expr : T_PARA",
  558.         "__expr : s_expr",
  559.         "s_expr : '[' s_expr ']'",
  560.         "s_expr : s_expr T_AND s_expr",
  561.         "s_expr : s_expr T_OR s_expr",
  562.         "s_expr : s_expr T_NEQ s_expr",
  563.         "s_expr : s_expr T_GEQ s_expr",
  564.         "s_expr : s_expr T_LEQ s_expr",
  565.         "s_expr : s_expr '<' s_expr",
  566.         "s_expr : s_expr '>' s_expr",
  567.         "s_expr : s_expr '+' s_expr",
  568.         "s_expr : s_expr '-' s_expr",
  569.         "s_expr : s_expr '/' s_expr",
  570.         "s_expr : s_expr '*' s_expr",
  571.         "s_expr : s_expr '\\' s_expr",
  572.         "s_expr : s_expr '&' s_expr",
  573.         "s_expr : s_expr '!' s_expr",
  574.         "s_expr : s_expr '^' s_expr",
  575.         "s_expr : s_expr '=' s_expr",
  576.         "s_expr : T_NOT s_expr",
  577.         "s_expr : '-' s_expr",
  578.         "s_expr : '>' s_expr",
  579.         "s_expr : '<' s_expr",
  580.         "s_expr : a_expr",
  581.         "fubar : __expr",
  582.         "i_expr : fubar",
  583.         "i_expr : fubar ',' i_expr",
  584.         "modif : '+' __expr ','",
  585.         "modif : /* empty */",
  586.         "t_expr : T_STRING",
  587.         "t_expr : __expr",
  588.         "si_expr : t_expr",
  589.         "si_expr : t_expr ',' si_expr",
  590.         "u_expr : T_STRING",
  591.         "u_expr : __expr",
  592.         "mi_expr : u_expr",
  593.         "mi_expr : u_expr ','",
  594.         "mi_expr : u_expr ',' mi_expr",
  595.         "ei_expr : /* empty */",
  596.         "ei_expr : mi_expr",
  597.         "f_expr : T_XFLOAT",
  598.         "f_expr : f_expr ',' T_XFLOAT",
  599.         "o_expr : op2",
  600.         "o_expr : o_expr ',' op2",
  601.         "op2 : option",
  602.         "op2 : T_NO option",
  603.         "option : T_OBJ",
  604.         "option : T_LIST",
  605.         "option : T_MLIST",
  606.         "option : T_CLIST",
  607.         "option : T_XREF",
  608.         "option : T_ERR",
  609.         "option : T_EJECT",
  610.         "option : T_NUM",
  611. };
  612. #endif /* YYDEBUG */
  613. #define YYFLAG  (-3000)
  614. /* @(#) $Revision: 66.3 $ */    
  615.  
  616. /*
  617. ** Skeleton parser driver for yacc output
  618. */
  619.  
  620. #if defined(NLS) && !defined(NL_SETN)
  621. #include <msgbuf.h>
  622. #endif
  623.  
  624. #ifndef nl_msg
  625. #define nl_msg(i,s) (s)
  626. #endif
  627.  
  628. /*
  629. ** yacc user known macros and defines
  630. */
  631. #define YYERROR         goto yyerrlab
  632.  
  633. #ifndef __RUNTIME_YYMAXDEPTH
  634. #define YYACCEPT        return(0)
  635. #define YYABORT         return(1)
  636. #else
  637. #define YYACCEPT        {free_stacks(); return(0);}
  638. #define YYABORT         {free_stacks(); return(1);}
  639. #endif
  640.  
  641. #define YYBACKUP( newtoken, newvalue )\
  642. {\
  643.         if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  644.         {\
  645.                 yyerror( (nl_msg(30001,"syntax error - cannot backup")) );\
  646.                 goto yyerrlab;\
  647.         }\
  648.         yychar = newtoken;\
  649.         yystate = *yyps;\
  650.         yylval = newvalue;\
  651.         goto yynewstate;\
  652. }
  653. #define YYRECOVERING()  (!!yyerrflag)
  654. #ifndef YYDEBUG
  655. #       define YYDEBUG  1       /* make debugging available */
  656. #endif
  657.  
  658. /*
  659. ** user known globals
  660. */
  661. int yydebug;                    /* set to 1 to get debugging */
  662.  
  663. /*
  664. ** driver internal defines
  665. */
  666. /* define for YYFLAG now generated by yacc program. */
  667. /*#define YYFLAG                (FLAGVAL)*/
  668.  
  669. /*
  670. ** global variables used by the parser
  671. */
  672. # ifndef __RUNTIME_YYMAXDEPTH
  673. __YYSCLASS YYSTYPE yyv[ YYMAXDEPTH ];   /* value stack */
  674. __YYSCLASS int yys[ YYMAXDEPTH ];               /* state stack */
  675. # else
  676. __YYSCLASS YYSTYPE *yyv;                        /* pointer to malloc'ed value stack */
  677. __YYSCLASS int *yys;                    /* pointer to malloc'ed stack stack */
  678. #ifdef __cplusplus
  679.         extern char *malloc(int);
  680.         extern char *realloc(char *, int);
  681.         extern void free();
  682. # else
  683.         extern char *malloc();
  684.         extern char *realloc();
  685.         extern void free();
  686. # endif /* __cplusplus */
  687. static int allocate_stacks(); 
  688. static void free_stacks();
  689. # ifndef YYINCREMENT
  690. # define YYINCREMENT (YYMAXDEPTH/2) + 10
  691. # endif
  692. # endif /* __RUNTIME_YYMAXDEPTH */
  693. long  yymaxdepth = YYMAXDEPTH;
  694.  
  695. __YYSCLASS YYSTYPE *yypv;                       /* top of value stack */
  696. __YYSCLASS int *yyps;                   /* top of state stack */
  697.  
  698. __YYSCLASS int yystate;                 /* current state */
  699. __YYSCLASS int yytmp;                   /* extra var (lasts between blocks) */
  700.  
  701. int yynerrs;                    /* number of errors */
  702. __YYSCLASS int yyerrflag;                       /* error recovery flag */
  703. int yychar;                     /* current input token number */
  704.  
  705.  
  706.  
  707. /*
  708. ** yyparse - return 0 if worked, 1 if syntax error not recovered from
  709. */
  710. int
  711. yyparse()
  712. {
  713.         register YYSTYPE *yypvt;        /* top of value stack for $vars */
  714.  
  715.         /*
  716.         ** Initialize externals - yyparse may be called more than once
  717.         */
  718. # ifdef __RUNTIME_YYMAXDEPTH
  719.         if (allocate_stacks()) YYABORT;
  720. # endif
  721.         yypv = &yyv[-1];
  722.         yyps = &yys[-1];
  723.         yystate = 0;
  724.         yytmp = 0;
  725.         yynerrs = 0;
  726.         yyerrflag = 0;
  727.         yychar = -1;
  728.  
  729.         goto yystack;
  730.         {
  731.                 register YYSTYPE *yy_pv;        /* top of value stack */
  732.                 register int *yy_ps;            /* top of state stack */
  733.                 register int yy_state;          /* current state */
  734.                 register int  yy_n;             /* internal state number info */
  735.  
  736.                 /*
  737.                 ** get globals into registers.
  738.                 ** branch to here only if YYBACKUP was called.
  739.                 */
  740.         yynewstate:
  741.                 yy_pv = yypv;
  742.                 yy_ps = yyps;
  743.                 yy_state = yystate;
  744.                 goto yy_newstate;
  745.  
  746.                 /*
  747.                 ** get globals into registers.
  748.                 ** either we just started, or we just finished a reduction
  749.                 */
  750.         yystack:
  751.                 yy_pv = yypv;
  752.                 yy_ps = yyps;
  753.                 yy_state = yystate;
  754.  
  755.                 /*
  756.                 ** top of for (;;) loop while no reductions done
  757.                 */
  758.         yy_stack:
  759.                 /*
  760.                 ** put a state and value onto the stacks
  761.                 */
  762. #if YYDEBUG
  763.                 /*
  764.                 ** if debugging, look up token value in list of value vs.
  765.                 ** name pairs.  0 and negative (-1) are special values.
  766.                 ** Note: linear search is used since time is not a real
  767.                 ** consideration while debugging.
  768.                 */
  769.                 if ( yydebug )
  770.                 {
  771.                         register int yy_i;
  772.  
  773.                         printf( "State %d, token ", yy_state );
  774.                         if ( yychar == 0 )
  775.                                 printf( "end-of-file\n" );
  776.                         else if ( yychar < 0 )
  777.                                 printf( "-none-\n" );
  778.                         else
  779.                         {
  780.                                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  781.                                         yy_i++ )
  782.                                 {
  783.                                         if ( yytoks[yy_i].t_val == yychar )
  784.                                                 break;
  785.                                 }
  786.                                 printf( "%s\n", yytoks[yy_i].t_name );
  787.                         }
  788.                 }
  789. #endif /* YYDEBUG */
  790.                 if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
  791.                 {
  792. # ifndef __RUNTIME_YYMAXDEPTH
  793.                         yyerror( (nl_msg(30002,"yacc stack overflow")) );
  794.                         YYABORT;
  795. # else
  796.                         /* save old stack bases to recalculate pointers */
  797.                         YYSTYPE * yyv_old = yyv;
  798.                         int * yys_old = yys;
  799.                         yymaxdepth += YYINCREMENT;
  800.                         yys = (int *) realloc(yys, yymaxdepth * sizeof(int));
  801.                         yyv = (YYSTYPE *) realloc(yyv, yymaxdepth * sizeof(YYSTYPE));
  802.                         if (yys==0 || yyv==0) {
  803.                             yyerror( (nl_msg(30002,"yacc stack overflow")) );
  804.                             YYABORT;
  805.                             }
  806.                         /* Reset pointers into stack */
  807.                         yy_ps = (yy_ps - yys_old) + yys;
  808.                         yyps = (yyps - yys_old) + yys;
  809.                         yy_pv = (yy_pv - yyv_old) + yyv;
  810.                         yypv = (yypv - yyv_old) + yyv;
  811. # endif
  812.  
  813.                 }
  814.                 *yy_ps = yy_state;
  815.                 *++yy_pv = yyval;
  816.  
  817.                 /*
  818.                 ** we have a new state - find out what to do
  819.                 */
  820.         yy_newstate:
  821.                 if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
  822.                         goto yydefault;         /* simple state */
  823. #if YYDEBUG
  824.                 /*
  825.                 ** if debugging, need to mark whether new token grabbed
  826.                 */
  827.                 yytmp = yychar < 0;
  828. #endif
  829.                 if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  830.                         yychar = 0;             /* reached EOF */
  831. #if YYDEBUG
  832.                 if ( yydebug && yytmp )
  833.                 {
  834.                         register int yy_i;
  835.  
  836.                         printf( "Received token " );
  837.                         if ( yychar == 0 )
  838.                                 printf( "end-of-file\n" );
  839.                         else if ( yychar < 0 )
  840.                                 printf( "-none-\n" );
  841.                         else
  842.                         {
  843.                                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  844.                                         yy_i++ )
  845.                                 {
  846.                                         if ( yytoks[yy_i].t_val == yychar )
  847.                                                 break;
  848.                                 }
  849.                                 printf( "%s\n", yytoks[yy_i].t_name );
  850.                         }
  851.                 }
  852. #endif /* YYDEBUG */
  853.                 if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
  854.                         goto yydefault;
  855.                 if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )  /*valid shift*/
  856.                 {
  857.                         yychar = -1;
  858.                         yyval = yylval;
  859.                         yy_state = yy_n;
  860.                         if ( yyerrflag > 0 )
  861.                                 yyerrflag--;
  862.                         goto yy_stack;
  863.                 }
  864.  
  865.         yydefault:
  866.                 if ( ( yy_n = yydef[ yy_state ] ) == -2 )
  867.                 {
  868. #if YYDEBUG
  869.                         yytmp = yychar < 0;
  870. #endif
  871.                         if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  872.                                 yychar = 0;             /* reached EOF */
  873. #if YYDEBUG
  874.                         if ( yydebug && yytmp )
  875.                         {
  876.                                 register int yy_i;
  877.  
  878.                                 printf( "Received token " );
  879.                                 if ( yychar == 0 )
  880.                                         printf( "end-of-file\n" );
  881.                                 else if ( yychar < 0 )
  882.                                         printf( "-none-\n" );
  883.                                 else
  884.                                 {
  885.                                         for ( yy_i = 0;
  886.                                                 yytoks[yy_i].t_val >= 0;
  887.                                                 yy_i++ )
  888.                                         {
  889.                                                 if ( yytoks[yy_i].t_val
  890.                                                         == yychar )
  891.                                                 {
  892.                                                         break;
  893.                                                 }
  894.                                         }
  895.                                         printf( "%s\n", yytoks[yy_i].t_name );
  896.                                 }
  897.                         }
  898. #endif /* YYDEBUG */
  899.                         /*
  900.                         ** look through exception table
  901.                         */
  902.                         {
  903.                                 register int *yyxi = yyexca;
  904.  
  905.                                 while ( ( *yyxi != -1 ) ||
  906.                                         ( yyxi[1] != yy_state ) )
  907.                                 {
  908.                                         yyxi += 2;
  909.                                 }
  910.                                 while ( ( *(yyxi += 2) >= 0 ) &&
  911.                                         ( *yyxi != yychar ) )
  912.                                         ;
  913.                                 if ( ( yy_n = yyxi[1] ) < 0 )
  914.                                         YYACCEPT;
  915.                         }
  916.                 }
  917.  
  918.                 /*
  919.                 ** check for syntax error
  920.                 */
  921.                 if ( yy_n == 0 )        /* have an error */
  922.                 {
  923.                         /* no worry about speed here! */
  924.                         switch ( yyerrflag )
  925.                         {
  926.                         case 0:         /* new error */
  927.                                 yyerror( (nl_msg(30003,"syntax error")) );
  928.                                 yynerrs++;
  929.                                 goto skip_init;
  930.                         yyerrlab:
  931.                                 /*
  932.                                 ** get globals into registers.
  933.                                 ** we have a user generated syntax type error
  934.                                 */
  935.                                 yy_pv = yypv;
  936.                                 yy_ps = yyps;
  937.                                 yy_state = yystate;
  938.                                 yynerrs++;
  939.                         skip_init:
  940.                         case 1:
  941.                         case 2:         /* incompletely recovered error */
  942.                                         /* try again... */
  943.                                 yyerrflag = 3;
  944.                                 /*
  945.                                 ** find state where "error" is a legal
  946.                                 ** shift action
  947.                                 */
  948.                                 while ( yy_ps >= yys )
  949.                                 {
  950.                                         yy_n = yypact[ *yy_ps ] + YYERRCODE;
  951.                                         if ( yy_n >= 0 && yy_n < YYLAST &&
  952.                                                 yychk[yyact[yy_n]] == YYERRCODE)                                        {
  953.                                                 /*
  954.                                                 ** simulate shift of "error"
  955.                                                 */
  956.                                                 yy_state = yyact[ yy_n ];
  957.                                                 goto yy_stack;
  958.                                         }
  959.                                         /*
  960.                                         ** current state has no shift on
  961.                                         ** "error", pop stack
  962.                                         */
  963. #if YYDEBUG
  964. #       define _POP_ "Error recovery pops state %d, uncovers state %d\n"
  965.                                         if ( yydebug )
  966.                                                 printf( _POP_, *yy_ps,
  967.                                                         yy_ps[-1] );
  968. #       undef _POP_
  969. #endif
  970.                                         yy_ps--;
  971.                                         yy_pv--;
  972.                                 }
  973.                                 /*
  974.                                 ** there is no state on stack with "error" as
  975.                                 ** a valid shift.  give up.
  976.                                 */
  977.                                 YYABORT;
  978.                         case 3:         /* no shift yet; eat a token */
  979. #if YYDEBUG
  980.                                 /*
  981.                                 ** if debugging, look up token in list of
  982.                                 ** pairs.  0 and negative shouldn't occur,
  983.                                 ** but since timing doesn't matter when
  984.                                 ** debugging, it doesn't hurt to leave the
  985.                                 ** tests here.
  986.                                 */
  987.                                 if ( yydebug )
  988.                                 {
  989.                                         register int yy_i;
  990.  
  991.                                         printf( "Error recovery discards " );
  992.                                         if ( yychar == 0 )
  993.                                                 printf( "token end-of-file\n" );
  994.                                         else if ( yychar < 0 )
  995.                                                 printf( "token -none-\n" );
  996.                                         else
  997.                                         {
  998.                                                 for ( yy_i = 0;
  999.                                                         yytoks[yy_i].t_val >= 0;
  1000.                                                         yy_i++ )
  1001.                                                 {
  1002.                                                         if ( yytoks[yy_i].t_val
  1003.                                                                 == yychar )
  1004.                                                         {
  1005.                                                                 break;
  1006.                                                         }
  1007.                                                 }
  1008.                                                 printf( "token %s\n",
  1009.                                                         yytoks[yy_i].t_name );
  1010.                                         }
  1011.                                 }
  1012. #endif /* YYDEBUG */
  1013.                                 if ( yychar == 0 )      /* reached EOF. quit */
  1014.                                         YYABORT;
  1015.                                 yychar = -1;
  1016.                                 goto yy_newstate;
  1017.                         }
  1018.                 }/* end if ( yy_n == 0 ) */
  1019.                 /*
  1020.                 ** reduction by production yy_n
  1021.                 ** put stack tops, etc. so things right after switch
  1022.                 */
  1023. #if YYDEBUG
  1024.                 /*
  1025.                 ** if debugging, print the string that is the user's
  1026.                 ** specification of the reduction which is just about
  1027.                 ** to be done.
  1028.                 */
  1029.                 if ( yydebug )
  1030.                         printf( "Reduce by (%d) \"%s\"\n",
  1031.                                 yy_n, yyreds[ yy_n ] );
  1032. #endif
  1033.                 yytmp = yy_n;                   /* value to switch over */
  1034.                 yypvt = yy_pv;                  /* $vars top of value stack */
  1035.                 /*
  1036.                 ** Look in goto table for next state
  1037.                 ** Sorry about using yy_state here as temporary
  1038.                 ** register variable, but why not, if it works...
  1039.                 ** If yyr2[ yy_n ] doesn't have the low order bit
  1040.                 ** set, then there is no action to be done for
  1041.                 ** this reduction.  So, no saving & unsaving of
  1042.                 ** registers done.  The only difference between the
  1043.                 ** code just after the if and the body of the if is
  1044.                 ** the goto yy_stack in the body.  This way the test
  1045.                 ** can be made before the choice of what to do is needed.
  1046.                 */
  1047.                 {
  1048.                         /* length of production doubled with extra bit */
  1049.                         register int yy_len = yyr2[ yy_n ];
  1050.  
  1051.                         if ( !( yy_len & 01 ) )
  1052.                         {
  1053.                                 yy_len >>= 1;
  1054.                                 yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
  1055.                                 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  1056.                                         *( yy_ps -= yy_len ) + 1;
  1057.                                 if ( yy_state >= YYLAST ||
  1058.                                         yychk[ yy_state =
  1059.                                         yyact[ yy_state ] ] != -yy_n )
  1060.                                 {
  1061.                                         yy_state = yyact[ yypgo[ yy_n ] ];
  1062.                                 }
  1063.                                 goto yy_stack;
  1064.                         }
  1065.                         yy_len >>= 1;
  1066.                         yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
  1067.                         yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  1068.                                 *( yy_ps -= yy_len ) + 1;
  1069.                         if ( yy_state >= YYLAST ||
  1070.                                 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
  1071.                         {
  1072.                                 yy_state = yyact[ yypgo[ yy_n ] ];
  1073.                         }
  1074.                 }
  1075.                                         /* save until reenter driver code */
  1076.                 yystate = yy_state;
  1077.                 yyps = yy_ps;
  1078.                 yypv = yy_pv;
  1079.         }
  1080.         /*
  1081.         ** code supplied by user is placed in this switch
  1082.         */
  1083.         switch( yytmp )
  1084.         {
  1085.                 
  1086. case 3:
  1087. # line 105 "asm65.y"
  1088. {
  1089.                inc_line();
  1090.                _in_instr = 0;
  1091.                dbputchar( '\n');
  1092.             } break;
  1093. case 5:
  1094. # line 112 "asm65.y"
  1095. {
  1096.                nterror("unwanted token appeared", yychar);
  1097.                while( (yychar = yylex()) && yychar != T_EOL);
  1098.                inc_line();
  1099.                if( ! yychar)
  1100.                   return;
  1101.                yyerrok;
  1102.                yyclearin;
  1103.             } break;
  1104. case 8:
  1105. # line 129 "asm65.y"
  1106. {
  1107.                            enter_pclabel( yypvt[-0].c);
  1108.                         } break;
  1109. case 9:
  1110. # line 133 "asm65.y"
  1111. {
  1112.                            dbprintf("T_LABEL nline [done with line]\n\n");
  1113.                         } break;
  1114. case 10:
  1115. # line 137 "asm65.y"
  1116. {
  1117.                            enter_elabel( yypvt[-3].c, yypvt[-0].e, L_ZERO | L_LINKZERO);
  1118.                            dbprintf("T_LABEL == s_expr [done with line]\n\n");
  1119.                         } break;
  1120. case 11:
  1121. # line 142 "asm65.y"
  1122. {
  1123.                            enter_elabel( yypvt[-2].c, yypvt[-0].e, L_NORMAL);
  1124.                            dbprintf("T_LABEL = s_expr [done with line]\n\n");
  1125.                         } break;
  1126. case 12:
  1127. # line 146 "asm65.y"
  1128. { _in_doteq = 1; } break;
  1129. case 13:
  1130. # line 148 "asm65.y"
  1131. {
  1132.                            _in_doteq = 0;
  1133.                            enter_elabel( yypvt[-3].c, yypvt[-0].e, L_EQU);
  1134.                            dbprintf("T_LABEL .= s_expr [done with line]\n\n");
  1135.                         } break;
  1136. case 14:
  1137. # line 153 "asm65.y"
  1138. {
  1139.                            enter_pclabel( yypvt[-0].c);
  1140.                            dbprintf("T_LABEL [done with line]\n\n");
  1141.                         } break;
  1142. case 15:
  1143. # line 157 "asm65.y"
  1144. {
  1145.                            dbprintf("regular line [done]\n\n");
  1146.                         } break;
  1147. case 16:
  1148. # line 163 "asm65.y"
  1149. {  _in_instr = 1;  } break;
  1150. case 17:
  1151. # line 164 "asm65.y"
  1152. { generate( yypvt[-2].b,adrmod,yypvt[-0].e);} break;
  1153. case 18:
  1154. # line 165 "asm65.y"
  1155. { if_treat( yypvt[-0].e);          } break;
  1156. case 19:
  1157. # line 166 "asm65.y"
  1158. { else_treat();           } break;
  1159. case 20:
  1160. # line 167 "asm65.y"
  1161. { endif_treat();          } break;
  1162. case 21:
  1163. # line 168 "asm65.y"
  1164. { setorg( yypvt[-0].e, 0);         } break;
  1165. case 22:
  1166. # line 169 "asm65.y"
  1167. { reserve( yypvt[-0].e);           } break;
  1168. case 23:
  1169. # line 170 "asm65.y"
  1170. { dropwords(  yypvt[-0].l);        } break;
  1171. case 24:
  1172. # line 171 "asm65.y"
  1173. { dropdbytes( yypvt[-0].l);        } break;
  1174. case 25:
  1175. # line 172 "asm65.y"
  1176. { dropbytes(  yypvt[-1].e, yypvt[-0].l, 0); } break;
  1177. case 26:
  1178. # line 173 "asm65.y"
  1179. { dropbytes(  yypvt[-1].e, yypvt[-0].l, 1); } break;
  1180. case 27:
  1181. # line 174 "asm65.y"
  1182. { dropsbytes( yypvt[-1].e, yypvt[-0].l);    } break;
  1183. case 28:
  1184. # line 175 "asm65.y"
  1185. { page0decl( yypvt[-0].c);         } break;
  1186. case 30:
  1187. # line 177 "asm65.y"
  1188. { call_macro( yypvt[-0].c);        } break;
  1189. case 31:
  1190. # line 178 "asm65.y"
  1191. { lastident = NIL; 
  1192.                                             _call_macro = 1;        } break;
  1193. case 32:
  1194. # line 180 "asm65.y"
  1195. { _call_macro = 0;
  1196.                                             do_macro( yypvt[-2].c, yypvt[-0].l);      } break;
  1197. case 33:
  1198. # line 182 "asm65.y"
  1199. { lastident = NIL;        
  1200.                                             _call_macro = 1;        } break;
  1201. case 34:
  1202. # line 184 "asm65.y"
  1203. { _call_macro = 0;
  1204.                                             rept_macro( yypvt[-3].e, yypvt[-2].c, yypvt[-0].l);} break;
  1205. case 35:
  1206. # line 186 "asm65.y"
  1207. { dbprintf("T_TAB");      } break;
  1208. case 36:
  1209. # line 187 "asm65.y"
  1210. { dbprintf("T_OPT");      } break;
  1211. case 37:
  1212. # line 188 "asm65.y"
  1213. { dbprintf("T_SET");      } break;
  1214. case 38:
  1215. # line 189 "asm65.y"
  1216. { undefine( yypvt[-0].c);          } break;
  1217. case 39:
  1218. # line 190 "asm65.y"
  1219. {
  1220.                                              load_macro( yypvt[-0].c);
  1221.                                              dbprintf("*** DONE WITH .MACRO ***");
  1222.                                           } break;
  1223. case 40:
  1224. # line 194 "asm65.y"
  1225. {
  1226.                                              footok = yylex();
  1227.                                              fooval = yylval.u;
  1228.                                              include( yypvt[-0].c, ".h65");
  1229.                                              fix_include( footok, fooval);
  1230.                                           } break;
  1231. case 41:
  1232. # line 200 "asm65.y"
  1233. { return( 0);          } break;
  1234. case 42:
  1235. # line 201 "asm65.y"
  1236. { do_local();          } break;
  1237. case 43:
  1238. # line 202 "asm65.y"
  1239. { dbprintf("TITLE\n"); } break;
  1240. case 44:
  1241. # line 203 "asm65.y"
  1242. { dbprintf("PAGE\n");  } break;
  1243. case 45:
  1244. # line 204 "asm65.y"
  1245. { nerror( yypvt[-0].c + 2);     } break;
  1246. case 46:
  1247. # line 205 "asm65.y"
  1248. { nwarning( yypvt[-0].c + 2);   } break;
  1249. case 47:
  1250. # line 209 "asm65.y"
  1251. { adrmod = C_RELX; } break;
  1252. case 48:
  1253. # line 210 "asm65.y"
  1254. { adrmod = C_RELY; } break;
  1255. case 49:
  1256. # line 211 "asm65.y"
  1257. { adrmod = C_INDX; yyval.e = yypvt[-3].e;   } break;
  1258. case 50:
  1259. # line 212 "asm65.y"
  1260. { adrmod = C_INDY; yyval.e = yypvt[-3].e;   } break;
  1261. case 51:
  1262. # line 213 "asm65.y"
  1263. { adrmod = C_IMM;  yyval.e = yypvt[-0].e;   } break;
  1264. case 52:
  1265. # line 214 "asm65.y"
  1266. { adrmod = C_IND;  yyval.e = yypvt[-1].e;   } break;
  1267. case 53:
  1268. # line 215 "asm65.y"
  1269. { adrmod = C_ABS;             } break;
  1270. case 54:
  1271. # line 216 "asm65.y"
  1272. { adrmod = C_ACCU; yyval.e = ENIL; } break;
  1273. case 55:
  1274. # line 217 "asm65.y"
  1275. { adrmod = C_IMPL; yyval.e = ENIL; } break;
  1276. case 56:
  1277. # line 220 "asm65.y"
  1278. { yyval.e = ival_pl( (word) yypvt[-0].u);         } break;
  1279. case 57:
  1280. # line 221 "asm65.y"
  1281. { yyval.e = lval_pl( lastident = yypvt[-0].c);    } break;
  1282. case 59:
  1283. # line 223 "asm65.y"
  1284. {(yyval.e = ival_pl( __pc))->op = O_PCREL;} break;
  1285. case 60:
  1286. # line 224 "asm65.y"
  1287. { yyval.e = ival_pl( (word) yypvt[-0].u);         } break;
  1288. case 61:
  1289. # line 225 "asm65.y"
  1290. { yyval.e = ival_pl( is_def( yypvt[-0].c));       } break;
  1291. case 62:
  1292. # line 226 "asm65.y"
  1293. { yyval.e = ival_pl( is_ref( yypvt[-0].c));       } break;
  1294. case 63:
  1295. # line 227 "asm65.y"
  1296.                                           expr  *he;
  1297.  
  1298.                                           lastident = yypvt[-0].l->string + 2;
  1299.                                           he = copyexpr( yypvt[-0].l->expr);
  1300.                                           he->fix = 0;
  1301.                                           yyval.e = he;
  1302.                                        } break;
  1303. case 64:
  1304. # line 237 "asm65.y"
  1305. { yypvt[-0].e->fix = FIX_NOTHING; } break;
  1306. case 65:
  1307. # line 239 "asm65.y"
  1308. { yyval.e = yypvt[-1].e;                      } break;
  1309. case 66:
  1310. # line 240 "asm65.y"
  1311. { yyval.e = op_pl( O_BAND, yypvt[-2].e, yypvt[-0].e);  } break;
  1312. case 67:
  1313. # line 241 "asm65.y"
  1314. { yyval.e = op_pl( O_BOR, yypvt[-2].e, yypvt[-0].e);   } break;
  1315. case 68:
  1316. # line 242 "asm65.y"
  1317. { yyval.e = op_pl( O_NEQ, yypvt[-2].e, yypvt[-0].e);   } break;
  1318. case 69:
  1319. # line 243 "asm65.y"
  1320. { yyval.e = op_pl( O_GEQ, yypvt[-2].e, yypvt[-0].e);   } break;
  1321. case 70:
  1322. # line 244 "asm65.y"
  1323. { yyval.e = op_pl( O_LEQ, yypvt[-2].e, yypvt[-0].e);   } break;
  1324. case 71:
  1325. # line 245 "asm65.y"
  1326. { yyval.e = op_pl( O_LT,  yypvt[-2].e, yypvt[-0].e);   } break;
  1327. case 72:
  1328. # line 246 "asm65.y"
  1329. { yyval.e = op_pl( O_GT,  yypvt[-2].e, yypvt[-0].e);   } break;
  1330. case 73:
  1331. # line 247 "asm65.y"
  1332. { yyval.e = op_pl( O_ADD, yypvt[-2].e, yypvt[-0].e);   } break;
  1333. case 74:
  1334. # line 248 "asm65.y"
  1335. { yyval.e = op_pl( O_SUB, yypvt[-2].e, yypvt[-0].e);   } break;
  1336. case 75:
  1337. # line 249 "asm65.y"
  1338. { yyval.e = op_pl( O_DIV, yypvt[-2].e, yypvt[-0].e);   } break;
  1339. case 76:
  1340. # line 250 "asm65.y"
  1341. { yyval.e = op_pl( O_MUL, yypvt[-2].e, yypvt[-0].e);   } break;
  1342. case 77:
  1343. # line 251 "asm65.y"
  1344. { yyval.e = op_pl( O_MOD, yypvt[-2].e, yypvt[-0].e);   } break;
  1345. case 78:
  1346. # line 252 "asm65.y"
  1347. { yyval.e = op_pl( O_AND, yypvt[-2].e, yypvt[-0].e);   } break;
  1348. case 79:
  1349. # line 253 "asm65.y"
  1350. { yyval.e = op_pl( O_OR,  yypvt[-2].e, yypvt[-0].e);   } break;
  1351. case 80:
  1352. # line 254 "asm65.y"
  1353. { yyval.e = op_pl( O_EOR, yypvt[-2].e, yypvt[-0].e);   } break;
  1354. case 81:
  1355. # line 255 "asm65.y"
  1356. { yyval.e = op_pl( O_EQ,  yypvt[-2].e, yypvt[-0].e);   } break;
  1357. case 82:
  1358. # line 256 "asm65.y"
  1359. { yyval.e = op_pl( O_BNOT,yypvt[-0].e, ENIL); } break;
  1360. case 83:
  1361. # line 257 "asm65.y"
  1362. { yyval.e = op_pl( O_MIN, yypvt[-0].e, ENIL); } break;
  1363. case 84:
  1364. # line 258 "asm65.y"
  1365. { yyval.e = op_pl( O_MSB, yypvt[-0].e, ENIL); } break;
  1366. case 85:
  1367. # line 259 "asm65.y"
  1368. { yyval.e = op_pl( O_LSB, yypvt[-0].e, ENIL); } break;
  1369. case 87:
  1370. # line 263 "asm65.y"
  1371. { yyval.l = lex_pl( NIL, yypvt[-0].e); } break;
  1372. case 89:
  1373. # line 267 "asm65.y"
  1374. { yyval.l = lex_ch( yypvt[-2].l, yypvt[-0].l); } break;
  1375. case 90:
  1376. # line 271 "asm65.y"
  1377. { yyval.e = yypvt[-1].e;   } break;
  1378. case 91:
  1379. # line 272 "asm65.y"
  1380. { yyval.e = ENIL; } break;
  1381. case 92:
  1382. # line 275 "asm65.y"
  1383. { yyval.l = lex_pl( yypvt[-0].c, ENIL);  } break;
  1384. case 93:
  1385. # line 276 "asm65.y"
  1386. { yyval.l = lex_pl( NIL, yypvt[-0].e);   } break;
  1387. case 95:
  1388. # line 281 "asm65.y"
  1389. { yyval.l = lex_ch( yypvt[-2].l, yypvt[-0].l);   } break;
  1390. case 96:
  1391. # line 284 "asm65.y"
  1392. { yyval.l = lex_pl( yypvt[-0].c, ival_pl( wasstrlen)); } break;
  1393. case 97:
  1394. # line 285 "asm65.y"
  1395. { yyval.l = lex_pl( lastident
  1396.                                              ? make_string( lastident)
  1397.                                              : undefined, yypvt[-0].e); } break;
  1398. case 99:
  1399. # line 291 "asm65.y"
  1400. { lastident = NIL;      } break;
  1401. case 100:
  1402. # line 292 "asm65.y"
  1403. { yyval.l = lex_ch( yypvt[-3].l, yypvt[-0].l); } break;
  1404. case 101:
  1405. # line 295 "asm65.y"
  1406. { yyval.l = lex_pl( NIL, ival_pl( 0)); } break;
  1407. case 102:
  1408. # line 297 "asm65.y"
  1409. { yyval.l = slex_ch( lex_pl( NIL, ival_pl( lex_cnt( yypvt[-0].l))), yypvt[-0].l);  } break;
  1410.         }
  1411.         goto yystack;           /* reset registers in driver code */
  1412. }
  1413.  
  1414. # ifdef __RUNTIME_YYMAXDEPTH
  1415.  
  1416. static int allocate_stacks() {
  1417.         /* allocate the yys and yyv stacks */
  1418.         yys = (int *) malloc(yymaxdepth * sizeof(int));
  1419.         yyv = (YYSTYPE *) malloc(yymaxdepth * sizeof(YYSTYPE));
  1420.  
  1421.         if (yys==0 || yyv==0) {
  1422.            yyerror( (nl_msg(30004,"unable to allocate space for yacc stacks")) );
  1423.            return(1);
  1424.            }
  1425.         else return(0);
  1426.  
  1427. }
  1428.  
  1429.  
  1430. static void free_stacks() {
  1431.         if (yys!=0) free((char *) yys);
  1432.         if (yyv!=0) free((char *) yyv);
  1433. }
  1434.  
  1435. # endif  /* defined(__RUNTIME_YYMAXDEPTH) */
  1436.  
  1437.