README: Use HTTPS for the mailing list
[linux-libre-firmware.git] / as31 / as31 / parser.c
1 /* A Bison parser, made by GNU Bison 2.5.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4    
5       Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6    
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 /* As a special exception, you may create a larger work that contains
21    part or all of the Bison parser skeleton and distribute that work
22    under terms of your choice, so long as that work isn't itself a
23    parser generator using the skeleton or a modified version thereof
24    as a parser skeleton.  Alternatively, if you modify or redistribute
25    the parser skeleton itself, you may (at your option) remove this
26    special exception, which will cause the skeleton and the resulting
27    Bison output files to be licensed under the GNU General Public
28    License without this special exception.
29    
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37    infringing on user name space.  This should be done even for local
38    variables, as they might otherwise be expanded by user macros.
39    There are some unavoidable exceptions within include files to
40    define necessary library symbols; they are noted "INFRINGES ON
41    USER NAME SPACE" below.  */
42
43 /* Identify Bison output.  */
44 #define YYBISON 1
45
46 /* Bison version.  */
47 #define YYBISON_VERSION "2.5"
48
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers.  */
53 #define YYPURE 0
54
55 /* Push parsers.  */
56 #define YYPUSH 0
57
58 /* Pull parsers.  */
59 #define YYPULL 1
60
61 /* Using locations.  */
62 #define YYLSP_NEEDED 0
63
64
65
66 /* Copy the first part of user declarations.  */
67
68 /* Line 268 of yacc.c  */
69 #line 21 "parser.y"
70
71
72 #include <stdio.h>
73 #include <stdlib.h>
74
75 #define NOPE
76 #include "as31.h"
77 #undef NOPE
78
79 #define YYSTYPE union ystack
80
81 static unsigned char bytebuf[1024];             /* used by dumplist() */
82 static int bytecount;
83
84
85 void yyerror(const char *s);
86 int makeop(struct opcode * op, struct mode *m, int add);
87 void inclc(int i);
88 char *padline(char *line);
89 void dumplist(char *txt, int show);
90 void genbyte(int b);
91 void genstr(const char *s);
92 void genword(unsigned long w);
93
94 /* ------------------------ G R A M M E R ----------------------------- */
95
96
97
98 /* Line 268 of yacc.c  */
99 #line 100 "y.tab.c"
100
101 /* Enabling traces.  */
102 #ifndef YYDEBUG
103 # define YYDEBUG 0
104 #endif
105
106 /* Enabling verbose error messages.  */
107 #ifdef YYERROR_VERBOSE
108 # undef YYERROR_VERBOSE
109 # define YYERROR_VERBOSE 1
110 #else
111 # define YYERROR_VERBOSE 0
112 #endif
113
114 /* Enabling the token table.  */
115 #ifndef YYTOKEN_TABLE
116 # define YYTOKEN_TABLE 0
117 #endif
118
119
120 /* Tokens.  */
121 #ifndef YYTOKENTYPE
122 # define YYTOKENTYPE
123    /* Put the tokens into the symbol table, so that GDB and other debuggers
124       know about them.  */
125    enum yytokentype {
126      STRING = 258,
127      D_ORG = 259,
128      D_BYTE = 260,
129      D_WORD = 261,
130      D_SKIP = 262,
131      D_EQU = 263,
132      D_FLAG = 264,
133      D_END = 265,
134      ACALL = 266,
135      ADD = 267,
136      ADDC = 268,
137      AJMP = 269,
138      ANL = 270,
139      CJNE = 271,
140      CLR = 272,
141      CPL = 273,
142      DA = 274,
143      DEC = 275,
144      DIV = 276,
145      DJNZ = 277,
146      INC = 278,
147      JB = 279,
148      JBC = 280,
149      JC = 281,
150      JMP = 282,
151      JNB = 283,
152      JNC = 284,
153      JNZ = 285,
154      JZ = 286,
155      LCALL = 287,
156      LJMP = 288,
157      MOV = 289,
158      MOVC = 290,
159      MOVX = 291,
160      NOP = 292,
161      MUL = 293,
162      ORL = 294,
163      POP = 295,
164      PUSH = 296,
165      RET = 297,
166      RETI = 298,
167      RL = 299,
168      RLC = 300,
169      RR = 301,
170      RRC = 302,
171      SETB = 303,
172      SJMP = 304,
173      SUBB = 305,
174      SWAP = 306,
175      XCH = 307,
176      XCHD = 308,
177      XRL = 309,
178      AB = 310,
179      A = 311,
180      C = 312,
181      PC = 313,
182      DPTR = 314,
183      BITPOS = 315,
184      R0 = 316,
185      R1 = 317,
186      R2 = 318,
187      R3 = 319,
188      R4 = 320,
189      R5 = 321,
190      R6 = 322,
191      R7 = 323,
192      VALUE = 324,
193      SYMBOL = 325
194    };
195 #endif
196 /* Tokens.  */
197 #define STRING 258
198 #define D_ORG 259
199 #define D_BYTE 260
200 #define D_WORD 261
201 #define D_SKIP 262
202 #define D_EQU 263
203 #define D_FLAG 264
204 #define D_END 265
205 #define ACALL 266
206 #define ADD 267
207 #define ADDC 268
208 #define AJMP 269
209 #define ANL 270
210 #define CJNE 271
211 #define CLR 272
212 #define CPL 273
213 #define DA 274
214 #define DEC 275
215 #define DIV 276
216 #define DJNZ 277
217 #define INC 278
218 #define JB 279
219 #define JBC 280
220 #define JC 281
221 #define JMP 282
222 #define JNB 283
223 #define JNC 284
224 #define JNZ 285
225 #define JZ 286
226 #define LCALL 287
227 #define LJMP 288
228 #define MOV 289
229 #define MOVC 290
230 #define MOVX 291
231 #define NOP 292
232 #define MUL 293
233 #define ORL 294
234 #define POP 295
235 #define PUSH 296
236 #define RET 297
237 #define RETI 298
238 #define RL 299
239 #define RLC 300
240 #define RR 301
241 #define RRC 302
242 #define SETB 303
243 #define SJMP 304
244 #define SUBB 305
245 #define SWAP 306
246 #define XCH 307
247 #define XCHD 308
248 #define XRL 309
249 #define AB 310
250 #define A 311
251 #define C 312
252 #define PC 313
253 #define DPTR 314
254 #define BITPOS 315
255 #define R0 316
256 #define R1 317
257 #define R2 318
258 #define R3 319
259 #define R4 320
260 #define R5 321
261 #define R6 322
262 #define R7 323
263 #define VALUE 324
264 #define SYMBOL 325
265
266
267
268
269 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
270 typedef int YYSTYPE;
271 # define YYSTYPE_IS_TRIVIAL 1
272 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
273 # define YYSTYPE_IS_DECLARED 1
274 #endif
275
276
277 /* Copy the second part of user declarations.  */
278
279
280 /* Line 343 of yacc.c  */
281 #line 282 "y.tab.c"
282
283 #ifdef short
284 # undef short
285 #endif
286
287 #ifdef YYTYPE_UINT8
288 typedef YYTYPE_UINT8 yytype_uint8;
289 #else
290 typedef unsigned char yytype_uint8;
291 #endif
292
293 #ifdef YYTYPE_INT8
294 typedef YYTYPE_INT8 yytype_int8;
295 #elif (defined __STDC__ || defined __C99__FUNC__ \
296      || defined __cplusplus || defined _MSC_VER)
297 typedef signed char yytype_int8;
298 #else
299 typedef short int yytype_int8;
300 #endif
301
302 #ifdef YYTYPE_UINT16
303 typedef YYTYPE_UINT16 yytype_uint16;
304 #else
305 typedef unsigned short int yytype_uint16;
306 #endif
307
308 #ifdef YYTYPE_INT16
309 typedef YYTYPE_INT16 yytype_int16;
310 #else
311 typedef short int yytype_int16;
312 #endif
313
314 #ifndef YYSIZE_T
315 # ifdef __SIZE_TYPE__
316 #  define YYSIZE_T __SIZE_TYPE__
317 # elif defined size_t
318 #  define YYSIZE_T size_t
319 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
320      || defined __cplusplus || defined _MSC_VER)
321 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
322 #  define YYSIZE_T size_t
323 # else
324 #  define YYSIZE_T unsigned int
325 # endif
326 #endif
327
328 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
329
330 #ifndef YY_
331 # if defined YYENABLE_NLS && YYENABLE_NLS
332 #  if ENABLE_NLS
333 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
334 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
335 #  endif
336 # endif
337 # ifndef YY_
338 #  define YY_(msgid) msgid
339 # endif
340 #endif
341
342 /* Suppress unused-variable warnings by "using" E.  */
343 #if ! defined lint || defined __GNUC__
344 # define YYUSE(e) ((void) (e))
345 #else
346 # define YYUSE(e) /* empty */
347 #endif
348
349 /* Identity function, used to suppress warnings about constant conditions.  */
350 #ifndef lint
351 # define YYID(n) (n)
352 #else
353 #if (defined __STDC__ || defined __C99__FUNC__ \
354      || defined __cplusplus || defined _MSC_VER)
355 static int
356 YYID (int yyi)
357 #else
358 static int
359 YYID (yyi)
360     int yyi;
361 #endif
362 {
363   return yyi;
364 }
365 #endif
366
367 #if ! defined yyoverflow || YYERROR_VERBOSE
368
369 /* The parser invokes alloca or malloc; define the necessary symbols.  */
370
371 # ifdef YYSTACK_USE_ALLOCA
372 #  if YYSTACK_USE_ALLOCA
373 #   ifdef __GNUC__
374 #    define YYSTACK_ALLOC __builtin_alloca
375 #   elif defined __BUILTIN_VA_ARG_INCR
376 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
377 #   elif defined _AIX
378 #    define YYSTACK_ALLOC __alloca
379 #   elif defined _MSC_VER
380 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
381 #    define alloca _alloca
382 #   else
383 #    define YYSTACK_ALLOC alloca
384 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
385      || defined __cplusplus || defined _MSC_VER)
386 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
387 #     ifndef EXIT_SUCCESS
388 #      define EXIT_SUCCESS 0
389 #     endif
390 #    endif
391 #   endif
392 #  endif
393 # endif
394
395 # ifdef YYSTACK_ALLOC
396    /* Pacify GCC's `empty if-body' warning.  */
397 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
398 #  ifndef YYSTACK_ALLOC_MAXIMUM
399     /* The OS might guarantee only one guard page at the bottom of the stack,
400        and a page size can be as small as 4096 bytes.  So we cannot safely
401        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
402        to allow for a few compiler-allocated temporary stack slots.  */
403 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
404 #  endif
405 # else
406 #  define YYSTACK_ALLOC YYMALLOC
407 #  define YYSTACK_FREE YYFREE
408 #  ifndef YYSTACK_ALLOC_MAXIMUM
409 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
410 #  endif
411 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
412        && ! ((defined YYMALLOC || defined malloc) \
413              && (defined YYFREE || defined free)))
414 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
415 #   ifndef EXIT_SUCCESS
416 #    define EXIT_SUCCESS 0
417 #   endif
418 #  endif
419 #  ifndef YYMALLOC
420 #   define YYMALLOC malloc
421 #   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
422      || defined __cplusplus || defined _MSC_VER)
423 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
424 #   endif
425 #  endif
426 #  ifndef YYFREE
427 #   define YYFREE free
428 #   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
429      || defined __cplusplus || defined _MSC_VER)
430 void free (void *); /* INFRINGES ON USER NAME SPACE */
431 #   endif
432 #  endif
433 # endif
434 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
435
436
437 #if (! defined yyoverflow \
438      && (! defined __cplusplus \
439          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
440
441 /* A type that is properly aligned for any stack member.  */
442 union yyalloc
443 {
444   yytype_int16 yyss_alloc;
445   YYSTYPE yyvs_alloc;
446 };
447
448 /* The size of the maximum gap between one aligned stack and the next.  */
449 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
450
451 /* The size of an array large to enough to hold all stacks, each with
452    N elements.  */
453 # define YYSTACK_BYTES(N) \
454      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
455       + YYSTACK_GAP_MAXIMUM)
456
457 # define YYCOPY_NEEDED 1
458
459 /* Relocate STACK from its old location to the new one.  The
460    local variables YYSIZE and YYSTACKSIZE give the old and new number of
461    elements in the stack, and YYPTR gives the new location of the
462    stack.  Advance YYPTR to a properly aligned location for the next
463    stack.  */
464 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
465     do                                                                  \
466       {                                                                 \
467         YYSIZE_T yynewbytes;                                            \
468         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
469         Stack = &yyptr->Stack_alloc;                                    \
470         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
471         yyptr += yynewbytes / sizeof (*yyptr);                          \
472       }                                                                 \
473     while (YYID (0))
474
475 #endif
476
477 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
478 /* Copy COUNT objects from FROM to TO.  The source and destination do
479    not overlap.  */
480 # ifndef YYCOPY
481 #  if defined __GNUC__ && 1 < __GNUC__
482 #   define YYCOPY(To, From, Count) \
483       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
484 #  else
485 #   define YYCOPY(To, From, Count)              \
486       do                                        \
487         {                                       \
488           YYSIZE_T yyi;                         \
489           for (yyi = 0; yyi < (Count); yyi++)   \
490             (To)[yyi] = (From)[yyi];            \
491         }                                       \
492       while (YYID (0))
493 #  endif
494 # endif
495 #endif /* !YYCOPY_NEEDED */
496
497 /* YYFINAL -- State number of the termination state.  */
498 #define YYFINAL  155
499 /* YYLAST -- Last index in YYTABLE.  */
500 #define YYLAST   599
501
502 /* YYNTOKENS -- Number of terminals.  */
503 #define YYNTOKENS  89
504 /* YYNNTS -- Number of nonterminals.  */
505 #define YYNNTS  35
506 /* YYNRULES -- Number of rules.  */
507 #define YYNRULES  165
508 /* YYNRULES -- Number of states.  */
509 #define YYNSTATES  316
510
511 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
512 #define YYUNDEFTOK  2
513 #define YYMAXUTOK   325
514
515 #define YYTRANSLATE(YYX)                                                \
516   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
517
518 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
519 static const yytype_uint8 yytranslate[] =
520 {
521        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
522       81,     2,     2,     2,     2,     2,     2,     2,     2,     2,
523        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
524        2,     2,     2,    88,     2,    87,     2,    75,    77,     2,
525       84,    85,    73,    71,    83,    72,    82,    74,     2,     2,
526        2,     2,     2,     2,     2,     2,     2,     2,    80,     2,
527       79,     2,    78,     2,    86,     2,     2,     2,     2,     2,
528        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
529        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
530        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
531        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
532        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
533        2,     2,     2,     2,    76,     2,     2,     2,     2,     2,
534        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
535        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
536        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
537        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
538        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
539        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
540        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
541        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
542        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
543        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
544        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
545        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
546        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
547        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
548       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
549       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
550       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
551       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
552       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
553       65,    66,    67,    68,    69,    70
554 };
555
556 #if YYDEBUG
557 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
558    YYRHS.  */
559 static const yytype_uint16 yyprhs[] =
560 {
561        0,     0,     3,     5,     8,    10,    14,    16,    19,    22,
562       24,    25,    29,    33,    37,    41,    45,    51,    57,    60,
563       62,    65,    67,    69,    71,    75,    79,    81,    83,    87,
564       89,    91,    95,    98,   102,   106,   110,   114,   118,   122,
565      126,   131,   136,   138,   140,   142,   145,   148,   151,   154,
566      157,   160,   163,   166,   169,   172,   175,   178,   181,   184,
567      187,   190,   193,   196,   199,   205,   211,   214,   216,   218,
568      221,   224,   227,   230,   233,   236,   239,   242,   245,   248,
569      251,   254,   257,   260,   263,   266,   269,   272,   275,   278,
570      281,   284,   287,   290,   293,   296,   304,   312,   320,   328,
571      334,   340,   346,   352,   356,   360,   365,   370,   374,   379,
572      383,   388,   393,   397,   401,   405,   409,   413,   418,   422,
573      426,   431,   436,   441,   447,   452,   456,   460,   465,   467,
574      469,   471,   474,   476,   478,   480,   486,   493,   500,   508,
575      510,   512,   515,   517,   519,   521,   523,   525,   527,   529,
576      531,   533,   535,   537,   539,   541,   543,   545,   547,   549,
577      551,   553,   555,   557,   559,   561
578 };
579
580 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
581 static const yytype_int8 yyrhs[] =
582 {
583       90,     0,    -1,    91,    -1,    91,    92,    -1,    92,    -1,
584       99,    80,    93,    -1,    93,    -1,    95,    81,    -1,   103,
585       81,    -1,    81,    -1,    -1,     1,    94,    81,    -1,    82,
586        4,    96,    -1,    82,     5,   100,    -1,    82,     6,   101,
587       -1,    82,     7,    96,    -1,    82,     8,    99,    83,   102,
588       -1,    82,     9,    70,    83,    97,    -1,    82,    10,    -1,
589      102,    -1,    98,    60,    -1,    70,    -1,    69,    -1,    70,
590       -1,   100,    83,   119,    -1,   100,    83,     3,    -1,   119,
591       -1,     3,    -1,   101,    83,   120,    -1,   120,    -1,    73,
592       -1,    84,   102,    85,    -1,    72,   102,    -1,   102,    76,
593      102,    -1,   102,    77,   102,    -1,   102,    73,   102,    -1,
594      102,    74,   102,    -1,   102,    75,   102,    -1,   102,    72,
595      102,    -1,   102,    71,   102,    -1,   102,    78,    78,   102,
596       -1,   102,    79,    79,   102,    -1,    70,    -1,    69,    -1,
597       37,    -1,    11,   121,    -1,    14,   121,    -1,    12,   104,
598       -1,    13,   104,    -1,    50,   104,    -1,    54,   104,    -1,
599       54,   105,    -1,    15,   104,    -1,    15,   105,    -1,    15,
600      106,    -1,    39,   104,    -1,    39,   105,    -1,    39,   106,
601       -1,    52,   104,    -1,    23,   110,    -1,    23,    59,    -1,
602       20,   110,    -1,    19,    56,    -1,    21,    55,    -1,    27,
603       86,    56,    71,    59,    -1,    27,    86,    59,    71,    56,
604       -1,    38,    55,    -1,    42,    -1,    43,    -1,    44,    56,
605       -1,    45,    56,    -1,    46,    56,    -1,    47,    56,    -1,
606       51,    56,    -1,    53,   104,    -1,    17,   111,    -1,    18,
607      111,    -1,    48,   111,    -1,    41,   119,    -1,    40,   119,
608       -1,    33,   122,    -1,    32,   122,    -1,    26,   123,    -1,
609       29,   123,    -1,    30,   123,    -1,    31,   123,    -1,    49,
610      123,    -1,    16,   112,    -1,    24,   107,    -1,    28,   107,
611       -1,    25,   107,    -1,    22,   108,    -1,    34,   104,    -1,
612       34,   105,    -1,    34,   109,    -1,    35,    56,    83,    86,
613       56,    71,    59,    -1,    35,    56,    83,    86,    59,    71,
614       56,    -1,    35,    56,    83,    86,    56,    71,    58,    -1,
615       35,    56,    83,    86,    58,    71,    56,    -1,    36,    56,
616       83,    86,   118,    -1,    36,    56,    83,    86,    59,    -1,
617       36,    86,   118,    83,    56,    -1,    36,    86,    59,    83,
618       56,    -1,    56,    83,   117,    -1,    56,    83,   119,    -1,
619       56,    83,    86,   118,    -1,    56,    83,    87,   119,    -1,
620      119,    83,    56,    -1,   119,    83,    87,   119,    -1,    57,
621       83,   115,    -1,    57,    83,    74,   115,    -1,    57,    83,
622       88,   115,    -1,   115,    83,   113,    -1,   117,    83,   114,
623       -1,   119,    83,   113,    -1,   117,    83,    56,    -1,   117,
624       83,   119,    -1,   117,    83,    87,   119,    -1,   119,    83,
625      117,    -1,   119,    83,   119,    -1,   119,    83,    86,   118,
626       -1,    86,   118,    83,    56,    -1,    86,   118,    83,   119,
627       -1,    86,   118,    83,    87,   119,    -1,    59,    83,    87,
628      120,    -1,    57,    83,   115,    -1,   119,    83,    57,    -1,
629      119,    60,    83,    57,    -1,    56,    -1,   117,    -1,   119,
630       -1,    86,   118,    -1,    56,    -1,    57,    -1,   115,    -1,
631       56,    83,   119,    83,   113,    -1,    56,    83,    87,   119,
632       83,   113,    -1,   117,    83,    87,   119,    83,   113,    -1,
633       86,   118,    83,    87,   119,    83,   113,    -1,   102,    -1,
634      102,    -1,   116,    60,    -1,   116,    -1,    70,    -1,    69,
635       -1,    61,    -1,    62,    -1,    63,    -1,    64,    -1,    65,
636       -1,    66,    -1,    67,    -1,    68,    -1,    61,    -1,    62,
637       -1,    63,    -1,    64,    -1,    65,    -1,    66,    -1,    67,
638       -1,    68,    -1,   102,    -1,   102,    -1,   102,    -1,   102,
639       -1,   102,    -1
640 };
641
642 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
643 static const yytype_uint16 yyrline[] =
644 {
645        0,   126,   126,   131,   132,   135,   145,   148,   153,   159,
646      164,   164,   183,   190,   191,   192,   195,   204,   210,   213,
647      223,   236,   242,   246,   254,   259,   270,   275,   287,   292,
648      306,   309,   312,   315,   318,   321,   324,   327,   330,   333,
649      336,   339,   341,   354,   366,   368,   370,   372,   374,   376,
650      378,   380,   382,   384,   386,   388,   390,   392,   394,   399,
651      401,   403,   405,   407,   409,   411,   413,   415,   417,   419,
652      421,   423,   425,   427,   429,   433,   435,   437,   441,   450,
653      459,   461,   463,   465,   467,   469,   471,   473,   475,   477,
654      479,   481,   483,   485,   487,   491,   493,   495,   497,   500,
655      502,   504,   506,   518,   524,   531,   537,   546,   553,   563,
656      570,   577,   586,   596,   603,   613,   619,   626,   633,   640,
657      648,   655,   661,   668,   675,   683,   699,   706,   725,   732,
658      738,   745,   753,   759,   765,   774,   782,   790,   798,   808,
659      825,   838,   851,   861,   867,   870,   871,   872,   873,   874,
660      875,   876,   877,   880,   881,   882,   885,   888,   891,   894,
661      897,   902,   912,   922,   937,   951
662 };
663 #endif
664
665 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
666 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
667    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
668 static const char *const yytname[] =
669 {
670   "$end", "error", "$undefined", "STRING", "D_ORG", "D_BYTE", "D_WORD",
671   "D_SKIP", "D_EQU", "D_FLAG", "D_END", "ACALL", "ADD", "ADDC", "AJMP",
672   "ANL", "CJNE", "CLR", "CPL", "DA", "DEC", "DIV", "DJNZ", "INC", "JB",
673   "JBC", "JC", "JMP", "JNB", "JNC", "JNZ", "JZ", "LCALL", "LJMP", "MOV",
674   "MOVC", "MOVX", "NOP", "MUL", "ORL", "POP", "PUSH", "RET", "RETI", "RL",
675   "RLC", "RR", "RRC", "SETB", "SJMP", "SUBB", "SWAP", "XCH", "XCHD", "XRL",
676   "AB", "A", "C", "PC", "DPTR", "BITPOS", "R0", "R1", "R2", "R3", "R4",
677   "R5", "R6", "R7", "VALUE", "SYMBOL", "'+'", "'-'", "'*'", "'/'", "'%'",
678   "'|'", "'&'", "'>'", "'<'", "':'", "'\\n'", "'.'", "','", "'('", "')'",
679   "'@'", "'#'", "'!'", "$accept", "program", "linelist", "line",
680   "linerest", "$@1", "directive", "defexpr", "flag", "flagv", "undefsym",
681   "blist", "wlist", "expr", "instr", "two_op1", "two_op2", "two_op3",
682   "two_op4", "two_op5", "two_op6", "single_op1", "single_op2", "three_op1",
683   "rel", "rel2", "bit", "bitv", "reg", "regi", "data8", "data16", "addr11",
684   "addr16", "relative", 0
685 };
686 #endif
687
688 # ifdef YYPRINT
689 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
690    token YYLEX-NUM.  */
691 static const yytype_uint16 yytoknum[] =
692 {
693        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
694      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
695      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
696      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
697      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
698      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
699      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
700      325,    43,    45,    42,    47,    37,   124,    38,    62,    60,
701       58,    10,    46,    44,    40,    41,    64,    35,    33
702 };
703 # endif
704
705 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
706 static const yytype_uint8 yyr1[] =
707 {
708        0,    89,    90,    91,    91,    92,    92,    93,    93,    93,
709       94,    93,    95,    95,    95,    95,    95,    95,    95,    96,
710       97,    98,    98,    99,   100,   100,   100,   100,   101,   101,
711      102,   102,   102,   102,   102,   102,   102,   102,   102,   102,
712      102,   102,   102,   102,   103,   103,   103,   103,   103,   103,
713      103,   103,   103,   103,   103,   103,   103,   103,   103,   103,
714      103,   103,   103,   103,   103,   103,   103,   103,   103,   103,
715      103,   103,   103,   103,   103,   103,   103,   103,   103,   103,
716      103,   103,   103,   103,   103,   103,   103,   103,   103,   103,
717      103,   103,   103,   103,   103,   103,   103,   103,   103,   103,
718      103,   103,   103,   104,   104,   104,   104,   105,   105,   106,
719      106,   106,   107,   108,   108,   109,   109,   109,   109,   109,
720      109,   109,   109,   109,   109,   109,   109,   109,   110,   110,
721      110,   110,   111,   111,   111,   112,   112,   112,   112,   113,
722      114,   115,   115,   116,   116,   117,   117,   117,   117,   117,
723      117,   117,   117,   118,   118,   118,   118,   118,   118,   118,
724      118,   119,   120,   121,   122,   123
725 };
726
727 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
728 static const yytype_uint8 yyr2[] =
729 {
730        0,     2,     1,     2,     1,     3,     1,     2,     2,     1,
731        0,     3,     3,     3,     3,     3,     5,     5,     2,     1,
732        2,     1,     1,     1,     3,     3,     1,     1,     3,     1,
733        1,     3,     2,     3,     3,     3,     3,     3,     3,     3,
734        4,     4,     1,     1,     1,     2,     2,     2,     2,     2,
735        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
736        2,     2,     2,     2,     5,     5,     2,     1,     1,     2,
737        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
738        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
739        2,     2,     2,     2,     2,     7,     7,     7,     7,     5,
740        5,     5,     5,     3,     3,     4,     4,     3,     4,     3,
741        4,     4,     3,     3,     3,     3,     3,     4,     3,     3,
742        4,     4,     4,     5,     4,     3,     3,     4,     1,     1,
743        1,     2,     1,     1,     1,     5,     6,     6,     7,     1,
744        1,     2,     1,     1,     1,     1,     1,     1,     1,     1,
745        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
746        1,     1,     1,     1,     1,     1
747 };
748
749 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
750    Performed when YYTABLE doesn't specify something else to do.  Zero
751    means the default is an error.  */
752 static const yytype_uint8 yydefact[] =
753 {
754        0,    10,     0,     0,     0,     0,     0,     0,     0,     0,
755        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
756        0,     0,     0,     0,     0,     0,     0,     0,    44,     0,
757        0,     0,     0,    67,    68,     0,     0,     0,     0,     0,
758        0,     0,     0,     0,     0,     0,    23,     9,     0,     0,
759        0,     4,     6,     0,     0,     0,     0,    43,    42,     0,
760       30,     0,   163,    45,     0,    47,    48,    46,     0,   161,
761       52,    53,    54,     0,     0,   145,   146,   147,   148,   149,
762      150,   151,   152,     0,    87,     0,   132,   133,   144,   143,
763       75,   134,   142,    76,    62,   128,     0,    61,   129,   130,
764       63,    91,     0,     0,    60,    59,    88,     0,    90,   165,
765       82,     0,    89,    83,    84,    85,   164,    81,    80,     0,
766        0,     0,    92,    93,    94,     0,     0,     0,     0,     0,
767       66,    55,    56,    57,    79,    78,    69,    70,    71,    72,
768       77,    86,    49,    73,    58,    74,    50,    51,     0,     0,
769        0,     0,     0,     0,    18,     1,     3,     7,     0,     8,
770       11,    32,     0,     0,     0,     0,     0,     0,     0,     0,
771        0,     0,     0,     0,     0,     0,   153,   154,   155,   156,
772      157,   158,   159,   160,     0,     0,   141,   131,     0,     0,
773        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
774        0,     0,     0,    12,    19,    27,    13,    26,    14,   162,
775       29,    15,     0,     0,     5,    31,    39,    38,    35,    36,
776       37,    33,    34,     0,     0,     0,     0,   103,   104,     0,
777        0,   109,   107,     0,     0,     0,     0,     0,   140,   113,
778      139,   114,   112,     0,     0,   125,     0,     0,   115,     0,
779      116,     0,   126,     0,   118,   119,     0,     0,     0,     0,
780        0,     0,     0,     0,    40,    41,   105,   106,   110,   111,
781      108,     0,     0,     0,     0,    64,    65,   124,   121,     0,
782      122,   117,   127,   120,     0,     0,     0,   100,    99,   102,
783      101,    25,    24,    28,    16,    22,    21,    17,     0,     0,
784      135,     0,     0,   123,     0,     0,     0,    20,   136,     0,
785      137,    97,    95,    98,    96,   138
786 };
787
788 /* YYDEFGOTO[NTERM-NUM].  */
789 static const yytype_int16 yydefgoto[] =
790 {
791       -1,    49,    50,    51,    52,    56,    53,   203,   297,   298,
792       54,   206,   208,    69,    55,    65,    71,    72,   106,   101,
793      124,    97,    90,    84,   241,   239,    91,    92,    98,   184,
794       73,   210,    63,   117,   110
795 };
796
797 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
798    STATE-NUM.  */
799 #define YYPACT_NINF -239
800 static const yytype_int16 yypact[] =
801 {
802      370,  -239,   139,   -24,   -24,   139,   120,    70,    15,    15,
803      -19,   470,   -12,   292,   441,    23,    23,   139,   -45,    23,
804      139,   139,   139,   139,   139,   222,    -9,   -26,  -239,    14,
805      120,   139,   139,  -239,  -239,    19,    25,    31,    49,    15,
806      139,   -24,    54,   -24,   -24,    85,  -239,  -239,   440,    89,
807      298,  -239,  -239,   -27,    37,    38,    41,  -239,  -239,   139,
808     -239,   139,   513,  -239,    64,  -239,  -239,  -239,    67,   513,
809     -239,  -239,  -239,    68,    77,  -239,  -239,  -239,  -239,  -239,
810     -239,  -239,  -239,   454,  -239,    87,  -239,  -239,  -239,  -239,
811     -239,  -239,    83,  -239,  -239,  -239,   454,  -239,  -239,  -239,
812     -239,  -239,    90,    91,  -239,  -239,  -239,   101,  -239,   513,
813     -239,   -30,  -239,  -239,  -239,  -239,   513,  -239,  -239,   102,
814      108,   454,  -239,  -239,  -239,   111,   -50,   115,   124,   485,
815     -239,  -239,  -239,  -239,  -239,  -239,  -239,  -239,  -239,  -239,
816     -239,  -239,  -239,  -239,  -239,  -239,  -239,  -239,   139,     4,
817      139,   139,   140,   143,  -239,  -239,  -239,  -239,   442,  -239,
818     -239,   104,   354,   139,   139,   139,   139,   139,   139,   139,
819       75,   145,   496,   126,   -47,   133,  -239,  -239,  -239,  -239,
820     -239,  -239,  -239,  -239,   135,   132,  -239,  -239,   139,   139,
821      139,   154,   155,    23,   141,   144,   -17,   147,    34,   146,
822      148,   150,   152,  -239,   513,  -239,   156,  -239,   158,   513,
823     -239,  -239,   159,   160,  -239,  -239,   520,   520,   104,   104,
824      104,    30,    30,   139,   139,   454,   139,  -239,  -239,    23,
825       23,  -239,  -239,   139,   139,   162,   151,   139,   513,  -239,
826      513,  -239,  -239,   172,   190,  -239,   139,    55,  -239,   139,
827     -239,   191,  -239,   454,  -239,  -239,    56,   511,   193,   195,
828       10,   139,   139,    60,  -239,  -239,  -239,  -239,  -239,  -239,
829     -239,   164,   139,   139,   170,  -239,  -239,  -239,  -239,   139,
830     -239,  -239,  -239,  -239,   183,   184,   185,  -239,  -239,  -239,
831     -239,  -239,  -239,  -239,   513,  -239,  -239,  -239,   197,   139,
832     -239,   175,   139,  -239,    86,   205,   206,  -239,  -239,   139,
833     -239,  -239,  -239,  -239,  -239,  -239
834 };
835
836 /* YYPGOTO[NTERM-NUM].  */
837 static const yytype_int16 yypgoto[] =
838 {
839     -239,  -239,  -239,   214,   107,  -239,  -239,   116,  -239,  -239,
840      114,  -239,  -239,    -2,  -239,    21,    33,   238,    26,  -239,
841     -239,   255,    22,  -239,  -186,  -239,   -14,  -239,    -1,   -85,
842        3,  -238,   266,   248,    28
843 };
844
845 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
846    positive, shift that token.  If negative, reduce the rule which
847    number is the opposite.  If YYTABLE_NINF, syntax error.  */
848 #define YYTABLE_NINF -3
849 static const yytype_int16 yytable[] =
850 {
851       62,   107,   107,    62,   242,   107,    85,   205,   277,   232,
852      197,   187,   102,   291,    99,   109,   103,    99,   109,   109,
853      109,   116,   116,   293,   125,    66,   191,    70,   126,   192,
854      128,    93,    64,   198,   134,   135,   195,    94,   109,   248,
855      233,   111,   108,   100,   202,   112,   122,   127,   113,   114,
856      115,   131,    57,    58,   157,    59,    60,   161,   123,   162,
857      129,   140,   142,   132,   144,   145,   146,    61,   141,   130,
858      249,    86,    87,    57,    58,   136,    59,    60,   147,    57,
859       58,   137,    59,    60,    88,    89,   300,   138,    61,   155,
860      232,   252,    88,    89,    61,    75,    76,    77,    78,    79,
861       80,    81,    82,    57,    58,   139,    59,    60,   170,   171,
862      143,   278,   284,   308,   285,   286,   310,   158,    61,   159,
863      253,   233,   160,   315,    57,    58,    74,    59,    60,   295,
864      296,    75,    76,    77,    78,    79,    80,    81,    82,    61,
865      266,    64,   279,   186,   311,   312,   204,   172,   209,   204,
866      173,   174,   207,   223,    57,    58,    83,    59,    60,   231,
867      175,   216,   217,   218,   219,   220,   221,   222,   283,    61,
868      185,   227,   288,   188,   189,   228,    64,    68,   235,   245,
869      168,   169,   170,   171,   190,   193,   238,   240,   240,    57,
870       58,   194,    59,    60,   196,    88,    89,   254,   199,   250,
871      229,   255,    57,    58,    61,    59,    60,   200,    57,    58,
872       46,    59,    60,   213,   230,   268,   269,    61,   236,   237,
873      234,   264,   265,    61,   224,   243,   244,   247,   246,   267,
874      251,   275,   256,   258,   257,   259,   270,   271,   273,   260,
875      274,   261,   262,   263,   209,   272,   276,   299,   282,   289,
876      280,   290,   281,   302,   304,   305,   306,   307,   309,   209,
877      294,   313,   314,   292,   156,   214,   212,   211,   133,   105,
878      240,    67,   118,     0,     0,     0,   301,     0,    64,   119,
879        0,   120,   303,    75,    76,    77,    78,    79,    80,    81,
880       82,    57,    58,     0,    59,    60,     0,   240,    -2,     1,
881      240,     0,     0,     0,     0,     0,    61,   240,   121,     2,
882        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
883       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
884       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
885       33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
886       43,    44,    45,    75,    76,    77,    78,    79,    80,    81,
887       82,    57,    58,     0,    59,    60,     0,     0,    46,     0,
888        0,     1,     0,     0,     0,     0,    61,     0,     0,    47,
889       48,     2,     3,     4,     5,     6,     7,     8,     9,    10,
890       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
891       21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
892       31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
893       41,    42,    43,    44,    45,   163,   164,   165,   166,   167,
894      168,   169,   170,   171,     0,     0,     0,     0,     0,   215,
895       46,     0,     0,     1,   148,   149,   150,   151,   152,   153,
896      154,    47,    48,     2,     3,     4,     5,     6,     7,     8,
897        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
898       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
899       29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
900       39,    40,    41,    42,    43,    44,    45,    95,     0,     0,
901      104,     0,    75,    76,    77,    78,    79,    80,    81,    82,
902       57,    58,     0,    59,    60,   176,   177,   178,   179,   180,
903      181,   182,   183,    47,    48,    61,    95,    96,     0,     0,
904        0,    75,    76,    77,    78,    79,    80,    81,    82,    57,
905       58,     0,    59,    60,   201,     0,   176,   177,   178,   179,
906      180,   181,   182,   183,    61,     0,    96,    75,    76,    77,
907       78,    79,    80,    81,    82,    57,    58,     0,    59,    60,
908      287,     0,   176,   177,   178,   179,   180,   181,   182,   183,
909       61,     0,   225,   226,   163,   164,   165,   166,   167,   168,
910      169,   170,   171,   165,   166,   167,   168,   169,   170,   171
911 };
912
913 #define yypact_value_is_default(yystate) \
914   ((yystate) == (-239))
915
916 #define yytable_value_is_error(yytable_value) \
917   YYID (0)
918
919 static const yytype_int16 yycheck[] =
920 {
921        2,    15,    16,     5,   190,    19,     7,     3,   246,    56,
922       60,    96,    13,     3,    11,    17,    13,    14,    20,    21,
923       22,    23,    24,   261,    25,     4,    56,     6,    25,    59,
924       56,     9,    56,    83,    31,    32,   121,    56,    40,    56,
925       87,    86,    16,    55,   129,    19,    25,    56,    20,    21,
926       22,    30,    69,    70,    81,    72,    73,    59,    25,    61,
927       86,    39,    41,    30,    43,    44,    45,    84,    40,    55,
928       87,    56,    57,    69,    70,    56,    72,    73,    45,    69,
929       70,    56,    72,    73,    69,    70,   272,    56,    84,     0,
930       56,    57,    69,    70,    84,    61,    62,    63,    64,    65,
931       66,    67,    68,    69,    70,    56,    72,    73,    78,    79,
932       56,    56,    56,   299,    58,    59,   302,    80,    84,    81,
933       86,    87,    81,   309,    69,    70,    56,    72,    73,    69,
934       70,    61,    62,    63,    64,    65,    66,    67,    68,    84,
935      225,    56,    87,    60,    58,    59,   148,    83,   150,   151,
936       83,    83,   149,    78,    69,    70,    86,    72,    73,   173,
937       83,   163,   164,   165,   166,   167,   168,   169,   253,    84,
938       83,   172,   257,    83,    83,   172,    56,    57,   175,   193,
939       76,    77,    78,    79,    83,    83,   188,   189,   190,    69,
940       70,    83,    72,    73,    83,    69,    70,   198,    83,   196,
941       74,   198,    69,    70,    84,    72,    73,    83,    69,    70,
942       70,    72,    73,    70,    88,   229,   230,    84,    83,    87,
943       87,   223,   224,    84,    79,    71,    71,    83,    87,   226,
944       83,    59,    86,    83,    86,    83,   233,   234,    87,    83,
945      237,    83,    83,    83,   246,    83,    56,    83,    57,    56,
946      247,    56,   249,    83,    71,    71,    71,    60,    83,   261,
947      262,    56,    56,   260,    50,   158,   152,   151,    30,    14,
948      272,     5,    24,    -1,    -1,    -1,   273,    -1,    56,    57,
949       -1,    59,   279,    61,    62,    63,    64,    65,    66,    67,
950       68,    69,    70,    -1,    72,    73,    -1,   299,     0,     1,
951      302,    -1,    -1,    -1,    -1,    -1,    84,   309,    86,    11,
952       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
953       22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
954       32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
955       42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
956       52,    53,    54,    61,    62,    63,    64,    65,    66,    67,
957       68,    69,    70,    -1,    72,    73,    -1,    -1,    70,    -1,
958       -1,     1,    -1,    -1,    -1,    -1,    84,    -1,    -1,    81,
959       82,    11,    12,    13,    14,    15,    16,    17,    18,    19,
960       20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
961       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
962       40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
963       50,    51,    52,    53,    54,    71,    72,    73,    74,    75,
964       76,    77,    78,    79,    -1,    -1,    -1,    -1,    -1,    85,
965       70,    -1,    -1,     1,     4,     5,     6,     7,     8,     9,
966       10,    81,    82,    11,    12,    13,    14,    15,    16,    17,
967       18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
968       28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
969       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
970       48,    49,    50,    51,    52,    53,    54,    56,    -1,    -1,
971       59,    -1,    61,    62,    63,    64,    65,    66,    67,    68,
972       69,    70,    -1,    72,    73,    61,    62,    63,    64,    65,
973       66,    67,    68,    81,    82,    84,    56,    86,    -1,    -1,
974       -1,    61,    62,    63,    64,    65,    66,    67,    68,    69,
975       70,    -1,    72,    73,    59,    -1,    61,    62,    63,    64,
976       65,    66,    67,    68,    84,    -1,    86,    61,    62,    63,
977       64,    65,    66,    67,    68,    69,    70,    -1,    72,    73,
978       59,    -1,    61,    62,    63,    64,    65,    66,    67,    68,
979       84,    -1,    86,    87,    71,    72,    73,    74,    75,    76,
980       77,    78,    79,    73,    74,    75,    76,    77,    78,    79
981 };
982
983 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
984    symbol of state STATE-NUM.  */
985 static const yytype_uint8 yystos[] =
986 {
987        0,     1,    11,    12,    13,    14,    15,    16,    17,    18,
988       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
989       29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
990       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
991       49,    50,    51,    52,    53,    54,    70,    81,    82,    90,
992       91,    92,    93,    95,    99,   103,    94,    69,    70,    72,
993       73,    84,   102,   121,    56,   104,   104,   121,    57,   102,
994      104,   105,   106,   119,    56,    61,    62,    63,    64,    65,
995       66,    67,    68,    86,   112,   117,    56,    57,    69,    70,
996      111,   115,   116,   111,    56,    56,    86,   110,   117,   119,
997       55,   108,   117,   119,    59,   110,   107,   115,   107,   102,
998      123,    86,   107,   123,   123,   123,   102,   122,   122,    57,
999       59,    86,   104,   105,   109,   117,   119,    56,    56,    86,
1000       55,   104,   105,   106,   119,   119,    56,    56,    56,    56,
1001      111,   123,   104,    56,   104,   104,   104,   105,     4,     5,
1002        6,     7,     8,     9,    10,     0,    92,    81,    80,    81,
1003       81,   102,   102,    71,    72,    73,    74,    75,    76,    77,
1004       78,    79,    83,    83,    83,    83,    61,    62,    63,    64,
1005       65,    66,    67,    68,   118,    83,    60,   118,    83,    83,
1006       83,    56,    59,    83,    83,   118,    83,    60,    83,    83,
1007       83,    59,   118,    96,   102,     3,   100,   119,   101,   102,
1008      120,    96,    99,    70,    93,    85,   102,   102,   102,   102,
1009      102,   102,   102,    78,    79,    86,    87,   117,   119,    74,
1010       88,   115,    56,    87,    87,   119,    83,    87,   102,   114,
1011      102,   113,   113,    71,    71,   115,    87,    83,    56,    87,
1012      119,    83,    57,    86,   117,   119,    86,    86,    83,    83,
1013       83,    83,    83,    83,   102,   102,   118,   119,   115,   115,
1014      119,   119,    83,    87,   119,    59,    56,   120,    56,    87,
1015      119,   119,    57,   118,    56,    58,    59,    59,   118,    56,
1016       56,     3,   119,   120,   102,    69,    70,    97,    98,    83,
1017      113,   119,    83,   119,    71,    71,    71,    60,   113,    83,
1018      113,    58,    59,    56,    56,   113
1019 };
1020
1021 #define yyerrok         (yyerrstatus = 0)
1022 #define yyclearin       (yychar = YYEMPTY)
1023 #define YYEMPTY         (-2)
1024 #define YYEOF           0
1025
1026 #define YYACCEPT        goto yyacceptlab
1027 #define YYABORT         goto yyabortlab
1028 #define YYERROR         goto yyerrorlab
1029
1030
1031 /* Like YYERROR except do call yyerror.  This remains here temporarily
1032    to ease the transition to the new meaning of YYERROR, for GCC.
1033    Once GCC version 2 has supplanted version 1, this can go.  However,
1034    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
1035    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1036    discussed.  */
1037
1038 #define YYFAIL          goto yyerrlab
1039 #if defined YYFAIL
1040   /* This is here to suppress warnings from the GCC cpp's
1041      -Wunused-macros.  Normally we don't worry about that warning, but
1042      some users do, and we want to make it easy for users to remove
1043      YYFAIL uses, which will produce warnings from Bison 2.5.  */
1044 #endif
1045
1046 #define YYRECOVERING()  (!!yyerrstatus)
1047
1048 #define YYBACKUP(Token, Value)                                  \
1049 do                                                              \
1050   if (yychar == YYEMPTY && yylen == 1)                          \
1051     {                                                           \
1052       yychar = (Token);                                         \
1053       yylval = (Value);                                         \
1054       YYPOPSTACK (1);                                           \
1055       goto yybackup;                                            \
1056     }                                                           \
1057   else                                                          \
1058     {                                                           \
1059       yyerror (YY_("syntax error: cannot back up")); \
1060       YYERROR;                                                  \
1061     }                                                           \
1062 while (YYID (0))
1063
1064
1065 #define YYTERROR        1
1066 #define YYERRCODE       256
1067
1068
1069 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1070    If N is 0, then set CURRENT to the empty location which ends
1071    the previous symbol: RHS[0] (always defined).  */
1072
1073 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1074 #ifndef YYLLOC_DEFAULT
1075 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
1076     do                                                                  \
1077       if (YYID (N))                                                    \
1078         {                                                               \
1079           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
1080           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
1081           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
1082           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
1083         }                                                               \
1084       else                                                              \
1085         {                                                               \
1086           (Current).first_line   = (Current).last_line   =              \
1087             YYRHSLOC (Rhs, 0).last_line;                                \
1088           (Current).first_column = (Current).last_column =              \
1089             YYRHSLOC (Rhs, 0).last_column;                              \
1090         }                                                               \
1091     while (YYID (0))
1092 #endif
1093
1094
1095 /* This macro is provided for backward compatibility. */
1096
1097 #ifndef YY_LOCATION_PRINT
1098 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1099 #endif
1100
1101
1102 /* YYLEX -- calling `yylex' with the right arguments.  */
1103
1104 #ifdef YYLEX_PARAM
1105 # define YYLEX yylex (YYLEX_PARAM)
1106 #else
1107 # define YYLEX yylex ()
1108 #endif
1109
1110 /* Enable debugging if requested.  */
1111 #if YYDEBUG
1112
1113 # ifndef YYFPRINTF
1114 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1115 #  define YYFPRINTF fprintf
1116 # endif
1117
1118 # define YYDPRINTF(Args)                        \
1119 do {                                            \
1120   if (yydebug)                                  \
1121     YYFPRINTF Args;                             \
1122 } while (YYID (0))
1123
1124 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1125 do {                                                                      \
1126   if (yydebug)                                                            \
1127     {                                                                     \
1128       YYFPRINTF (stderr, "%s ", Title);                                   \
1129       yy_symbol_print (stderr,                                            \
1130                   Type, Value); \
1131       YYFPRINTF (stderr, "\n");                                           \
1132     }                                                                     \
1133 } while (YYID (0))
1134
1135
1136 /*--------------------------------.
1137 | Print this symbol on YYOUTPUT.  |
1138 `--------------------------------*/
1139
1140 /*ARGSUSED*/
1141 #if (defined __STDC__ || defined __C99__FUNC__ \
1142      || defined __cplusplus || defined _MSC_VER)
1143 static void
1144 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1145 #else
1146 static void
1147 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1148     FILE *yyoutput;
1149     int yytype;
1150     YYSTYPE const * const yyvaluep;
1151 #endif
1152 {
1153   if (!yyvaluep)
1154     return;
1155 # ifdef YYPRINT
1156   if (yytype < YYNTOKENS)
1157     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1158 # else
1159   YYUSE (yyoutput);
1160 # endif
1161   switch (yytype)
1162     {
1163       default:
1164         break;
1165     }
1166 }
1167
1168
1169 /*--------------------------------.
1170 | Print this symbol on YYOUTPUT.  |
1171 `--------------------------------*/
1172
1173 #if (defined __STDC__ || defined __C99__FUNC__ \
1174      || defined __cplusplus || defined _MSC_VER)
1175 static void
1176 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1177 #else
1178 static void
1179 yy_symbol_print (yyoutput, yytype, yyvaluep)
1180     FILE *yyoutput;
1181     int yytype;
1182     YYSTYPE const * const yyvaluep;
1183 #endif
1184 {
1185   if (yytype < YYNTOKENS)
1186     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1187   else
1188     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1189
1190   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1191   YYFPRINTF (yyoutput, ")");
1192 }
1193
1194 /*------------------------------------------------------------------.
1195 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1196 | TOP (included).                                                   |
1197 `------------------------------------------------------------------*/
1198
1199 #if (defined __STDC__ || defined __C99__FUNC__ \
1200      || defined __cplusplus || defined _MSC_VER)
1201 static void
1202 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1203 #else
1204 static void
1205 yy_stack_print (yybottom, yytop)
1206     yytype_int16 *yybottom;
1207     yytype_int16 *yytop;
1208 #endif
1209 {
1210   YYFPRINTF (stderr, "Stack now");
1211   for (; yybottom <= yytop; yybottom++)
1212     {
1213       int yybot = *yybottom;
1214       YYFPRINTF (stderr, " %d", yybot);
1215     }
1216   YYFPRINTF (stderr, "\n");
1217 }
1218
1219 # define YY_STACK_PRINT(Bottom, Top)                            \
1220 do {                                                            \
1221   if (yydebug)                                                  \
1222     yy_stack_print ((Bottom), (Top));                           \
1223 } while (YYID (0))
1224
1225
1226 /*------------------------------------------------.
1227 | Report that the YYRULE is going to be reduced.  |
1228 `------------------------------------------------*/
1229
1230 #if (defined __STDC__ || defined __C99__FUNC__ \
1231      || defined __cplusplus || defined _MSC_VER)
1232 static void
1233 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1234 #else
1235 static void
1236 yy_reduce_print (yyvsp, yyrule)
1237     YYSTYPE *yyvsp;
1238     int yyrule;
1239 #endif
1240 {
1241   int yynrhs = yyr2[yyrule];
1242   int yyi;
1243   unsigned long int yylno = yyrline[yyrule];
1244   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1245              yyrule - 1, yylno);
1246   /* The symbols being reduced.  */
1247   for (yyi = 0; yyi < yynrhs; yyi++)
1248     {
1249       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1250       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1251                        &(yyvsp[(yyi + 1) - (yynrhs)])
1252                                        );
1253       YYFPRINTF (stderr, "\n");
1254     }
1255 }
1256
1257 # define YY_REDUCE_PRINT(Rule)          \
1258 do {                                    \
1259   if (yydebug)                          \
1260     yy_reduce_print (yyvsp, Rule); \
1261 } while (YYID (0))
1262
1263 /* Nonzero means print parse trace.  It is left uninitialized so that
1264    multiple parsers can coexist.  */
1265 int yydebug;
1266 #else /* !YYDEBUG */
1267 # define YYDPRINTF(Args)
1268 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1269 # define YY_STACK_PRINT(Bottom, Top)
1270 # define YY_REDUCE_PRINT(Rule)
1271 #endif /* !YYDEBUG */
1272
1273
1274 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1275 #ifndef YYINITDEPTH
1276 # define YYINITDEPTH 200
1277 #endif
1278
1279 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1280    if the built-in stack extension method is used).
1281
1282    Do not make this value too large; the results are undefined if
1283    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1284    evaluated with infinite-precision integer arithmetic.  */
1285
1286 #ifndef YYMAXDEPTH
1287 # define YYMAXDEPTH 10000
1288 #endif
1289
1290
1291 #if YYERROR_VERBOSE
1292
1293 # ifndef yystrlen
1294 #  if defined __GLIBC__ && defined _STRING_H
1295 #   define yystrlen strlen
1296 #  else
1297 /* Return the length of YYSTR.  */
1298 #if (defined __STDC__ || defined __C99__FUNC__ \
1299      || defined __cplusplus || defined _MSC_VER)
1300 static YYSIZE_T
1301 yystrlen (const char *yystr)
1302 #else
1303 static YYSIZE_T
1304 yystrlen (yystr)
1305     const char *yystr;
1306 #endif
1307 {
1308   YYSIZE_T yylen;
1309   for (yylen = 0; yystr[yylen]; yylen++)
1310     continue;
1311   return yylen;
1312 }
1313 #  endif
1314 # endif
1315
1316 # ifndef yystpcpy
1317 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1318 #   define yystpcpy stpcpy
1319 #  else
1320 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1321    YYDEST.  */
1322 #if (defined __STDC__ || defined __C99__FUNC__ \
1323      || defined __cplusplus || defined _MSC_VER)
1324 static char *
1325 yystpcpy (char *yydest, const char *yysrc)
1326 #else
1327 static char *
1328 yystpcpy (yydest, yysrc)
1329     char *yydest;
1330     const char *yysrc;
1331 #endif
1332 {
1333   char *yyd = yydest;
1334   const char *yys = yysrc;
1335
1336   while ((*yyd++ = *yys++) != '\0')
1337     continue;
1338
1339   return yyd - 1;
1340 }
1341 #  endif
1342 # endif
1343
1344 # ifndef yytnamerr
1345 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1346    quotes and backslashes, so that it's suitable for yyerror.  The
1347    heuristic is that double-quoting is unnecessary unless the string
1348    contains an apostrophe, a comma, or backslash (other than
1349    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1350    null, do not copy; instead, return the length of what the result
1351    would have been.  */
1352 static YYSIZE_T
1353 yytnamerr (char *yyres, const char *yystr)
1354 {
1355   if (*yystr == '"')
1356     {
1357       YYSIZE_T yyn = 0;
1358       char const *yyp = yystr;
1359
1360       for (;;)
1361         switch (*++yyp)
1362           {
1363           case '\'':
1364           case ',':
1365             goto do_not_strip_quotes;
1366
1367           case '\\':
1368             if (*++yyp != '\\')
1369               goto do_not_strip_quotes;
1370             /* Fall through.  */
1371           default:
1372             if (yyres)
1373               yyres[yyn] = *yyp;
1374             yyn++;
1375             break;
1376
1377           case '"':
1378             if (yyres)
1379               yyres[yyn] = '\0';
1380             return yyn;
1381           }
1382     do_not_strip_quotes: ;
1383     }
1384
1385   if (! yyres)
1386     return yystrlen (yystr);
1387
1388   return yystpcpy (yyres, yystr) - yyres;
1389 }
1390 # endif
1391
1392 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1393    about the unexpected token YYTOKEN for the state stack whose top is
1394    YYSSP.
1395
1396    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1397    not large enough to hold the message.  In that case, also set
1398    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1399    required number of bytes is too large to store.  */
1400 static int
1401 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1402                 yytype_int16 *yyssp, int yytoken)
1403 {
1404   YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1405   YYSIZE_T yysize = yysize0;
1406   YYSIZE_T yysize1;
1407   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1408   /* Internationalized format string. */
1409   const char *yyformat = 0;
1410   /* Arguments of yyformat. */
1411   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1412   /* Number of reported tokens (one for the "unexpected", one per
1413      "expected"). */
1414   int yycount = 0;
1415
1416   /* There are many possibilities here to consider:
1417      - Assume YYFAIL is not used.  It's too flawed to consider.  See
1418        <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1419        for details.  YYERROR is fine as it does not invoke this
1420        function.
1421      - If this state is a consistent state with a default action, then
1422        the only way this function was invoked is if the default action
1423        is an error action.  In that case, don't check for expected
1424        tokens because there are none.
1425      - The only way there can be no lookahead present (in yychar) is if
1426        this state is a consistent state with a default action.  Thus,
1427        detecting the absence of a lookahead is sufficient to determine
1428        that there is no unexpected or expected token to report.  In that
1429        case, just report a simple "syntax error".
1430      - Don't assume there isn't a lookahead just because this state is a
1431        consistent state with a default action.  There might have been a
1432        previous inconsistent state, consistent state with a non-default
1433        action, or user semantic action that manipulated yychar.
1434      - Of course, the expected token list depends on states to have
1435        correct lookahead information, and it depends on the parser not
1436        to perform extra reductions after fetching a lookahead from the
1437        scanner and before detecting a syntax error.  Thus, state merging
1438        (from LALR or IELR) and default reductions corrupt the expected
1439        token list.  However, the list is correct for canonical LR with
1440        one exception: it will still contain any token that will not be
1441        accepted due to an error action in a later state.
1442   */
1443   if (yytoken != YYEMPTY)
1444     {
1445       int yyn = yypact[*yyssp];
1446       yyarg[yycount++] = yytname[yytoken];
1447       if (!yypact_value_is_default (yyn))
1448         {
1449           /* Start YYX at -YYN if negative to avoid negative indexes in
1450              YYCHECK.  In other words, skip the first -YYN actions for
1451              this state because they are default actions.  */
1452           int yyxbegin = yyn < 0 ? -yyn : 0;
1453           /* Stay within bounds of both yycheck and yytname.  */
1454           int yychecklim = YYLAST - yyn + 1;
1455           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1456           int yyx;
1457
1458           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1459             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1460                 && !yytable_value_is_error (yytable[yyx + yyn]))
1461               {
1462                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1463                   {
1464                     yycount = 1;
1465                     yysize = yysize0;
1466                     break;
1467                   }
1468                 yyarg[yycount++] = yytname[yyx];
1469                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1470                 if (! (yysize <= yysize1
1471                        && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1472                   return 2;
1473                 yysize = yysize1;
1474               }
1475         }
1476     }
1477
1478   switch (yycount)
1479     {
1480 # define YYCASE_(N, S)                      \
1481       case N:                               \
1482         yyformat = S;                       \
1483       break
1484       YYCASE_(0, YY_("syntax error"));
1485       YYCASE_(1, YY_("syntax error, unexpected %s"));
1486       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1487       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1488       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1489       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1490 # undef YYCASE_
1491     }
1492
1493   yysize1 = yysize + yystrlen (yyformat);
1494   if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1495     return 2;
1496   yysize = yysize1;
1497
1498   if (*yymsg_alloc < yysize)
1499     {
1500       *yymsg_alloc = 2 * yysize;
1501       if (! (yysize <= *yymsg_alloc
1502              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1503         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1504       return 1;
1505     }
1506
1507   /* Avoid sprintf, as that infringes on the user's name space.
1508      Don't have undefined behavior even if the translation
1509      produced a string with the wrong number of "%s"s.  */
1510   {
1511     char *yyp = *yymsg;
1512     int yyi = 0;
1513     while ((*yyp = *yyformat) != '\0')
1514       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1515         {
1516           yyp += yytnamerr (yyp, yyarg[yyi++]);
1517           yyformat += 2;
1518         }
1519       else
1520         {
1521           yyp++;
1522           yyformat++;
1523         }
1524   }
1525   return 0;
1526 }
1527 #endif /* YYERROR_VERBOSE */
1528
1529 /*-----------------------------------------------.
1530 | Release the memory associated to this symbol.  |
1531 `-----------------------------------------------*/
1532
1533 /*ARGSUSED*/
1534 #if (defined __STDC__ || defined __C99__FUNC__ \
1535      || defined __cplusplus || defined _MSC_VER)
1536 static void
1537 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1538 #else
1539 static void
1540 yydestruct (yymsg, yytype, yyvaluep)
1541     const char *yymsg;
1542     int yytype;
1543     YYSTYPE *yyvaluep;
1544 #endif
1545 {
1546   YYUSE (yyvaluep);
1547
1548   if (!yymsg)
1549     yymsg = "Deleting";
1550   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1551
1552   switch (yytype)
1553     {
1554
1555       default:
1556         break;
1557     }
1558 }
1559
1560
1561 /* Prevent warnings from -Wmissing-prototypes.  */
1562 #ifdef YYPARSE_PARAM
1563 #if defined __STDC__ || defined __cplusplus
1564 int yyparse (void *YYPARSE_PARAM);
1565 #else
1566 int yyparse ();
1567 #endif
1568 #else /* ! YYPARSE_PARAM */
1569 #if defined __STDC__ || defined __cplusplus
1570 int yyparse (void);
1571 #else
1572 int yyparse ();
1573 #endif
1574 #endif /* ! YYPARSE_PARAM */
1575
1576
1577 /* The lookahead symbol.  */
1578 int yychar;
1579
1580 /* The semantic value of the lookahead symbol.  */
1581 YYSTYPE yylval;
1582
1583 /* Number of syntax errors so far.  */
1584 int yynerrs;
1585
1586
1587 /*----------.
1588 | yyparse.  |
1589 `----------*/
1590
1591 #ifdef YYPARSE_PARAM
1592 #if (defined __STDC__ || defined __C99__FUNC__ \
1593      || defined __cplusplus || defined _MSC_VER)
1594 int
1595 yyparse (void *YYPARSE_PARAM)
1596 #else
1597 int
1598 yyparse (YYPARSE_PARAM)
1599     void *YYPARSE_PARAM;
1600 #endif
1601 #else /* ! YYPARSE_PARAM */
1602 #if (defined __STDC__ || defined __C99__FUNC__ \
1603      || defined __cplusplus || defined _MSC_VER)
1604 int
1605 yyparse (void)
1606 #else
1607 int
1608 yyparse ()
1609
1610 #endif
1611 #endif
1612 {
1613     int yystate;
1614     /* Number of tokens to shift before error messages enabled.  */
1615     int yyerrstatus;
1616
1617     /* The stacks and their tools:
1618        `yyss': related to states.
1619        `yyvs': related to semantic values.
1620
1621        Refer to the stacks thru separate pointers, to allow yyoverflow
1622        to reallocate them elsewhere.  */
1623
1624     /* The state stack.  */
1625     yytype_int16 yyssa[YYINITDEPTH];
1626     yytype_int16 *yyss;
1627     yytype_int16 *yyssp;
1628
1629     /* The semantic value stack.  */
1630     YYSTYPE yyvsa[YYINITDEPTH];
1631     YYSTYPE *yyvs;
1632     YYSTYPE *yyvsp;
1633
1634     YYSIZE_T yystacksize;
1635
1636   int yyn;
1637   int yyresult;
1638   /* Lookahead token as an internal (translated) token number.  */
1639   int yytoken;
1640   /* The variables used to return semantic value and location from the
1641      action routines.  */
1642   YYSTYPE yyval;
1643
1644 #if YYERROR_VERBOSE
1645   /* Buffer for error messages, and its allocated size.  */
1646   char yymsgbuf[128];
1647   char *yymsg = yymsgbuf;
1648   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1649 #endif
1650
1651 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1652
1653   /* The number of symbols on the RHS of the reduced rule.
1654      Keep to zero when no symbol should be popped.  */
1655   int yylen = 0;
1656
1657   yytoken = 0;
1658   yyss = yyssa;
1659   yyvs = yyvsa;
1660   yystacksize = YYINITDEPTH;
1661
1662   YYDPRINTF ((stderr, "Starting parse\n"));
1663
1664   yystate = 0;
1665   yyerrstatus = 0;
1666   yynerrs = 0;
1667   yychar = YYEMPTY; /* Cause a token to be read.  */
1668
1669   /* Initialize stack pointers.
1670      Waste one element of value and location stack
1671      so that they stay on the same level as the state stack.
1672      The wasted elements are never initialized.  */
1673   yyssp = yyss;
1674   yyvsp = yyvs;
1675
1676   goto yysetstate;
1677
1678 /*------------------------------------------------------------.
1679 | yynewstate -- Push a new state, which is found in yystate.  |
1680 `------------------------------------------------------------*/
1681  yynewstate:
1682   /* In all cases, when you get here, the value and location stacks
1683      have just been pushed.  So pushing a state here evens the stacks.  */
1684   yyssp++;
1685
1686  yysetstate:
1687   *yyssp = yystate;
1688
1689   if (yyss + yystacksize - 1 <= yyssp)
1690     {
1691       /* Get the current used size of the three stacks, in elements.  */
1692       YYSIZE_T yysize = yyssp - yyss + 1;
1693
1694 #ifdef yyoverflow
1695       {
1696         /* Give user a chance to reallocate the stack.  Use copies of
1697            these so that the &'s don't force the real ones into
1698            memory.  */
1699         YYSTYPE *yyvs1 = yyvs;
1700         yytype_int16 *yyss1 = yyss;
1701
1702         /* Each stack pointer address is followed by the size of the
1703            data in use in that stack, in bytes.  This used to be a
1704            conditional around just the two extra args, but that might
1705            be undefined if yyoverflow is a macro.  */
1706         yyoverflow (YY_("memory exhausted"),
1707                     &yyss1, yysize * sizeof (*yyssp),
1708                     &yyvs1, yysize * sizeof (*yyvsp),
1709                     &yystacksize);
1710
1711         yyss = yyss1;
1712         yyvs = yyvs1;
1713       }
1714 #else /* no yyoverflow */
1715 # ifndef YYSTACK_RELOCATE
1716       goto yyexhaustedlab;
1717 # else
1718       /* Extend the stack our own way.  */
1719       if (YYMAXDEPTH <= yystacksize)
1720         goto yyexhaustedlab;
1721       yystacksize *= 2;
1722       if (YYMAXDEPTH < yystacksize)
1723         yystacksize = YYMAXDEPTH;
1724
1725       {
1726         yytype_int16 *yyss1 = yyss;
1727         union yyalloc *yyptr =
1728           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1729         if (! yyptr)
1730           goto yyexhaustedlab;
1731         YYSTACK_RELOCATE (yyss_alloc, yyss);
1732         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1733 #  undef YYSTACK_RELOCATE
1734         if (yyss1 != yyssa)
1735           YYSTACK_FREE (yyss1);
1736       }
1737 # endif
1738 #endif /* no yyoverflow */
1739
1740       yyssp = yyss + yysize - 1;
1741       yyvsp = yyvs + yysize - 1;
1742
1743       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1744                   (unsigned long int) yystacksize));
1745
1746       if (yyss + yystacksize - 1 <= yyssp)
1747         YYABORT;
1748     }
1749
1750   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1751
1752   if (yystate == YYFINAL)
1753     YYACCEPT;
1754
1755   goto yybackup;
1756
1757 /*-----------.
1758 | yybackup.  |
1759 `-----------*/
1760 yybackup:
1761
1762   /* Do appropriate processing given the current state.  Read a
1763      lookahead token if we need one and don't already have one.  */
1764
1765   /* First try to decide what to do without reference to lookahead token.  */
1766   yyn = yypact[yystate];
1767   if (yypact_value_is_default (yyn))
1768     goto yydefault;
1769
1770   /* Not known => get a lookahead token if don't already have one.  */
1771
1772   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1773   if (yychar == YYEMPTY)
1774     {
1775       YYDPRINTF ((stderr, "Reading a token: "));
1776       yychar = YYLEX;
1777     }
1778
1779   if (yychar <= YYEOF)
1780     {
1781       yychar = yytoken = YYEOF;
1782       YYDPRINTF ((stderr, "Now at end of input.\n"));
1783     }
1784   else
1785     {
1786       yytoken = YYTRANSLATE (yychar);
1787       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1788     }
1789
1790   /* If the proper action on seeing token YYTOKEN is to reduce or to
1791      detect an error, take that action.  */
1792   yyn += yytoken;
1793   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1794     goto yydefault;
1795   yyn = yytable[yyn];
1796   if (yyn <= 0)
1797     {
1798       if (yytable_value_is_error (yyn))
1799         goto yyerrlab;
1800       yyn = -yyn;
1801       goto yyreduce;
1802     }
1803
1804   /* Count tokens shifted since error; after three, turn off error
1805      status.  */
1806   if (yyerrstatus)
1807     yyerrstatus--;
1808
1809   /* Shift the lookahead token.  */
1810   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1811
1812   /* Discard the shifted token.  */
1813   yychar = YYEMPTY;
1814
1815   yystate = yyn;
1816   *++yyvsp = yylval;
1817
1818   goto yynewstate;
1819
1820
1821 /*-----------------------------------------------------------.
1822 | yydefault -- do the default action for the current state.  |
1823 `-----------------------------------------------------------*/
1824 yydefault:
1825   yyn = yydefact[yystate];
1826   if (yyn == 0)
1827     goto yyerrlab;
1828   goto yyreduce;
1829
1830
1831 /*-----------------------------.
1832 | yyreduce -- Do a reduction.  |
1833 `-----------------------------*/
1834 yyreduce:
1835   /* yyn is the number of a rule to reduce with.  */
1836   yylen = yyr2[yyn];
1837
1838   /* If YYLEN is nonzero, implement the default value of the action:
1839      `$$ = $1'.
1840
1841      Otherwise, the following line sets YYVAL to garbage.
1842      This behavior is undocumented and Bison
1843      users should not rely upon it.  Assigning to YYVAL
1844      unconditionally makes the parser a bit smaller, and it avoids a
1845      GCC warning that YYVAL may be used uninitialized.  */
1846   yyval = yyvsp[1-yylen];
1847
1848
1849   YY_REDUCE_PRINT (yyn);
1850   switch (yyn)
1851     {
1852         case 2:
1853
1854 /* Line 1806 of yacc.c  */
1855 #line 127 "parser.y"
1856     {
1857 }
1858     break;
1859
1860   case 5:
1861
1862 /* Line 1806 of yacc.c  */
1863 #line 136 "parser.y"
1864     {
1865         if (abort_asap) {YYABORT;}
1866         if( pass1 ) {
1867                 (yyvsp[(1) - (3)]).sym->type = LABEL;
1868                 (yyvsp[(1) - (3)]).sym->value = lc;
1869         }
1870         inclc((yyvsp[(3) - (3)]).value);
1871         bytecount = 0;
1872 }
1873     break;
1874
1875   case 6:
1876
1877 /* Line 1806 of yacc.c  */
1878 #line 145 "parser.y"
1879     { inclc((yyvsp[(1) - (1)]).value); bytecount = 0; }
1880     break;
1881
1882   case 7:
1883
1884 /* Line 1806 of yacc.c  */
1885 #line 148 "parser.y"
1886     {
1887                                                 (yyval).value = (yyvsp[(1) - (2)]).value;
1888                                                 if( dashl && pass2 )
1889                                                         dumplist((yyvsp[(2) - (2)]).str,1);
1890                                         }
1891     break;
1892
1893   case 8:
1894
1895 /* Line 1806 of yacc.c  */
1896 #line 153 "parser.y"
1897     {
1898                                                 (yyval).value = (yyvsp[(1) - (2)]).value;
1899                                                 if( dashl && pass2 )
1900                                                         dumplist((yyvsp[(2) - (2)]).str,1);
1901
1902                                         }
1903     break;
1904
1905   case 9:
1906
1907 /* Line 1806 of yacc.c  */
1908 #line 159 "parser.y"
1909     {
1910                                                 (yyval).value = 0;
1911                                                 if( dashl && pass2 )
1912                                                         dumplist((yyvsp[(1) - (1)]).str,0);
1913                                         }
1914     break;
1915
1916   case 10:
1917
1918 /* Line 1806 of yacc.c  */
1919 #line 164 "parser.y"
1920     {
1921                                                 seek_eol();
1922                                         }
1923     break;
1924
1925   case 11:
1926
1927 /* Line 1806 of yacc.c  */
1928 #line 167 "parser.y"
1929     {
1930                                                 (yyval).value = 0;
1931                                                 if( dashl && pass2 )
1932                                                         dumplist((yyvsp[(1) - (3)]).str,0);
1933                                         }
1934     break;
1935
1936   case 12:
1937
1938 /* Line 1806 of yacc.c  */
1939 #line 184 "parser.y"
1940     {
1941         lc = (yyvsp[(3) - (3)]).val.v;
1942         if( pass2 ) emitaddr(lc);
1943         bytecount = 0;
1944         (yyval).value = 0;
1945 }
1946     break;
1947
1948   case 13:
1949
1950 /* Line 1806 of yacc.c  */
1951 #line 190 "parser.y"
1952     { (yyval).value = (yyvsp[(3) - (3)]).value; }
1953     break;
1954
1955   case 14:
1956
1957 /* Line 1806 of yacc.c  */
1958 #line 191 "parser.y"
1959     { (yyval).value = (yyvsp[(3) - (3)]).value; }
1960     break;
1961
1962   case 15:
1963
1964 /* Line 1806 of yacc.c  */
1965 #line 192 "parser.y"
1966     { (yyval).value = (yyvsp[(3) - (3)]).val.v;
1967                                           if( pass2 )
1968                                                 emitaddr(lc+(yyval).value); }
1969     break;
1970
1971   case 16:
1972
1973 /* Line 1806 of yacc.c  */
1974 #line 196 "parser.y"
1975     {
1976         if( (yyvsp[(5) - (5)]).val.d == 0 )
1977                 warn("Expression is undefined in pass 1");
1978         (yyvsp[(3) - (5)]).sym->type = LABEL;
1979         (yyvsp[(3) - (5)]).sym->value = (yyvsp[(5) - (5)]).val.v;
1980         (yyval).value = 0;
1981 }
1982     break;
1983
1984   case 17:
1985
1986 /* Line 1806 of yacc.c  */
1987 #line 205 "parser.y"
1988     {
1989         (yyvsp[(3) - (5)]).sym->type = LABEL;
1990         (yyvsp[(3) - (5)]).sym->value = (yyvsp[(5) - (5)]).value;
1991         (yyval).value = 0;
1992 }
1993     break;
1994
1995   case 18:
1996
1997 /* Line 1806 of yacc.c  */
1998 #line 210 "parser.y"
1999     { (yyval).value = 0; }
2000     break;
2001
2002   case 19:
2003
2004 /* Line 1806 of yacc.c  */
2005 #line 214 "parser.y"
2006     {
2007                 if( (yyvsp[(1) - (1)]).val.d == 0 )
2008                         warn("Expression is undefined in pass 1");
2009                 if( !(isbit16((yyvsp[(1) - (1)]).val.v)) )
2010                         warn("Value greater than 16-bits");
2011                 (yyval).value = (yyvsp[(1) - (1)]).val.v;
2012 }
2013     break;
2014
2015   case 20:
2016
2017 /* Line 1806 of yacc.c  */
2018 #line 224 "parser.y"
2019     {
2020         if( !isbit8((yyvsp[(1) - (2)]).value) )
2021                 warn("Bit address exceeds 8-bits");
2022         if( isbmram((yyvsp[(1) - (2)]).value) )
2023                 (yyval).value = ((yyvsp[(1) - (2)]).value-0x20)*8+ (yyvsp[(2) - (2)]).value;
2024         else if( isbmsfr((yyvsp[(1) - (2)]).value) )
2025                 (yyval).value = (yyvsp[(1) - (2)]).value + (yyvsp[(2) - (2)]).value;
2026         else
2027                 warn("Invalid bit addressable RAM location");
2028 }
2029     break;
2030
2031   case 21:
2032
2033 /* Line 1806 of yacc.c  */
2034 #line 237 "parser.y"
2035     {
2036         if( (yyvsp[(1) - (1)]).sym->type == UNDEF )
2037                 warn("Symbol %s must be defined in pass 1",(yyvsp[(1) - (1)]).sym->name);
2038         (yyval).value = (yyvsp[(1) - (1)]).sym->value;
2039 }
2040     break;
2041
2042   case 22:
2043
2044 /* Line 1806 of yacc.c  */
2045 #line 242 "parser.y"
2046     { (yyval).value = (yyvsp[(1) - (1)]).value; }
2047     break;
2048
2049   case 23:
2050
2051 /* Line 1806 of yacc.c  */
2052 #line 247 "parser.y"
2053     {
2054         if( (yyvsp[(1) - (1)]).sym->type != UNDEF && pass1)
2055                 warn("Attempt to redefine symbol: %s",(yyvsp[(1) - (1)]).sym->name);
2056         (yyval).sym = (yyvsp[(1) - (1)]).sym;
2057 }
2058     break;
2059
2060   case 24:
2061
2062 /* Line 1806 of yacc.c  */
2063 #line 255 "parser.y"
2064     {
2065         if( pass2 ) genbyte((yyvsp[(3) - (3)]).value);
2066         (yyval).value = (yyvsp[(1) - (3)]).value + 1;
2067 }
2068     break;
2069
2070   case 25:
2071
2072 /* Line 1806 of yacc.c  */
2073 #line 260 "parser.y"
2074     {
2075         if( pass1 )
2076                 (yyval).value = (yyvsp[(1) - (3)]).value + (yyvsp[(3) - (3)]).value;
2077         else {
2078                 (yyval).value = (yyvsp[(1) - (3)]).value + strlen((yyvsp[(3) - (3)]).str);
2079                 genstr((yyvsp[(3) - (3)]).str);
2080                 
2081                 free((yyvsp[(3) - (3)]).str);
2082         }
2083 }
2084     break;
2085
2086   case 26:
2087
2088 /* Line 1806 of yacc.c  */
2089 #line 271 "parser.y"
2090     {
2091         if( pass2 ) genbyte((yyvsp[(1) - (1)]).value);
2092         (yyval).value = 1;
2093 }
2094     break;
2095
2096   case 27:
2097
2098 /* Line 1806 of yacc.c  */
2099 #line 276 "parser.y"
2100     {
2101         if( pass1 )
2102                 (yyval).value = (yyvsp[(1) - (1)]).value;
2103         else {
2104                 (yyval).value = strlen((yyvsp[(1) - (1)]).str);
2105                 genstr((yyvsp[(1) - (1)]).str);
2106                 free((yyvsp[(1) - (1)]).str);
2107         }
2108 }
2109     break;
2110
2111   case 28:
2112
2113 /* Line 1806 of yacc.c  */
2114 #line 288 "parser.y"
2115     {
2116         if( pass2 ) genword((yyvsp[(3) - (3)]).value);
2117         (yyval).value = (yyvsp[(1) - (3)]).value + 2;
2118 }
2119     break;
2120
2121   case 29:
2122
2123 /* Line 1806 of yacc.c  */
2124 #line 293 "parser.y"
2125     {
2126         if( pass2 ) genword((yyvsp[(1) - (1)]).value);
2127         (yyval).value = 2;
2128 }
2129     break;
2130
2131   case 30:
2132
2133 /* Line 1806 of yacc.c  */
2134 #line 306 "parser.y"
2135     { (yyval).val.v = lc;
2136                                           (yyval).val.d = 1; }
2137     break;
2138
2139   case 31:
2140
2141 /* Line 1806 of yacc.c  */
2142 #line 309 "parser.y"
2143     { (yyval).val.v = (yyvsp[(2) - (3)]).val.v;
2144                                           (yyval).val.d = (yyvsp[(2) - (3)]).val.d; }
2145     break;
2146
2147   case 32:
2148
2149 /* Line 1806 of yacc.c  */
2150 #line 312 "parser.y"
2151     { (yyval).val.v = -(yyvsp[(2) - (2)]).val.v;
2152                                           (yyval).val.d = (yyvsp[(2) - (2)]).val.d;  }
2153     break;
2154
2155   case 33:
2156
2157 /* Line 1806 of yacc.c  */
2158 #line 315 "parser.y"
2159     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v | (yyvsp[(3) - (3)]).val.v;
2160                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2161     break;
2162
2163   case 34:
2164
2165 /* Line 1806 of yacc.c  */
2166 #line 318 "parser.y"
2167     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v & (yyvsp[(3) - (3)]).val.v;
2168                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2169     break;
2170
2171   case 35:
2172
2173 /* Line 1806 of yacc.c  */
2174 #line 321 "parser.y"
2175     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v * (yyvsp[(3) - (3)]).val.v;
2176                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2177     break;
2178
2179   case 36:
2180
2181 /* Line 1806 of yacc.c  */
2182 #line 324 "parser.y"
2183     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v / (yyvsp[(3) - (3)]).val.v;
2184                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2185     break;
2186
2187   case 37:
2188
2189 /* Line 1806 of yacc.c  */
2190 #line 327 "parser.y"
2191     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v % (yyvsp[(3) - (3)]).val.v;
2192                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2193     break;
2194
2195   case 38:
2196
2197 /* Line 1806 of yacc.c  */
2198 #line 330 "parser.y"
2199     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v - (yyvsp[(3) - (3)]).val.v;
2200                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2201     break;
2202
2203   case 39:
2204
2205 /* Line 1806 of yacc.c  */
2206 #line 333 "parser.y"
2207     { (yyval).val.v = (yyvsp[(1) - (3)]).val.v + (yyvsp[(3) - (3)]).val.v;
2208                                           (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2209     break;
2210
2211   case 40:
2212
2213 /* Line 1806 of yacc.c  */
2214 #line 336 "parser.y"
2215     { (yyval).val.v = (yyvsp[(1) - (4)]).val.v >> (yyvsp[(4) - (4)]).val.v;
2216                                           (yyval).val.d = (yyvsp[(1) - (4)]).val.d && (yyvsp[(4) - (4)]).val.d; }
2217     break;
2218
2219   case 41:
2220
2221 /* Line 1806 of yacc.c  */
2222 #line 339 "parser.y"
2223     { (yyval).val.v = (yyvsp[(1) - (4)]).val.v << (yyvsp[(4) - (4)]).val.v;
2224                                           (yyval).val.d = (yyvsp[(1) - (4)]).val.d && (yyvsp[(4) - (4)]).val.d; }
2225     break;
2226
2227   case 42:
2228
2229 /* Line 1806 of yacc.c  */
2230 #line 342 "parser.y"
2231     {
2232         if( pass1 ) {
2233                 (yyval).val.v = (yyvsp[(1) - (1)]).sym->value;
2234                 (yyval).val.d = ((yyvsp[(1) - (1)]).sym->type != UNDEF);
2235         }
2236         else {
2237                 if( (yyvsp[(1) - (1)]).sym->type == UNDEF )
2238                         warn("Undefined symbol %s",(yyvsp[(1) - (1)]).sym->name);
2239                 (yyval).val.v = (yyvsp[(1) - (1)]).sym->value;
2240                 (yyval).val.d = 1;
2241         }
2242 }
2243     break;
2244
2245   case 43:
2246
2247 /* Line 1806 of yacc.c  */
2248 #line 354 "parser.y"
2249     { (yyval).val.v = (yyvsp[(1) - (1)]).val.v; (yyval).val.d=1; }
2250     break;
2251
2252   case 44:
2253
2254 /* Line 1806 of yacc.c  */
2255 #line 367 "parser.y"
2256     { (yyval).value = makeop((yyvsp[(1) - (1)]).op,NULL,0); }
2257     break;
2258
2259   case 45:
2260
2261 /* Line 1806 of yacc.c  */
2262 #line 369 "parser.y"
2263     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2264     break;
2265
2266   case 46:
2267
2268 /* Line 1806 of yacc.c  */
2269 #line 371 "parser.y"
2270     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2271     break;
2272
2273   case 47:
2274
2275 /* Line 1806 of yacc.c  */
2276 #line 373 "parser.y"
2277     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2278     break;
2279
2280   case 48:
2281
2282 /* Line 1806 of yacc.c  */
2283 #line 375 "parser.y"
2284     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2285     break;
2286
2287   case 49:
2288
2289 /* Line 1806 of yacc.c  */
2290 #line 377 "parser.y"
2291     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2292     break;
2293
2294   case 50:
2295
2296 /* Line 1806 of yacc.c  */
2297 #line 379 "parser.y"
2298     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2299     break;
2300
2301   case 51:
2302
2303 /* Line 1806 of yacc.c  */
2304 #line 381 "parser.y"
2305     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2306     break;
2307
2308   case 52:
2309
2310 /* Line 1806 of yacc.c  */
2311 #line 383 "parser.y"
2312     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2313     break;
2314
2315   case 53:
2316
2317 /* Line 1806 of yacc.c  */
2318 #line 385 "parser.y"
2319     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2320     break;
2321
2322   case 54:
2323
2324 /* Line 1806 of yacc.c  */
2325 #line 387 "parser.y"
2326     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,6); }
2327     break;
2328
2329   case 55:
2330
2331 /* Line 1806 of yacc.c  */
2332 #line 389 "parser.y"
2333     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2334     break;
2335
2336   case 56:
2337
2338 /* Line 1806 of yacc.c  */
2339 #line 391 "parser.y"
2340     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2341     break;
2342
2343   case 57:
2344
2345 /* Line 1806 of yacc.c  */
2346 #line 393 "parser.y"
2347     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,6); }
2348     break;
2349
2350   case 58:
2351
2352 /* Line 1806 of yacc.c  */
2353 #line 395 "parser.y"
2354     { if( get_md((yyvsp[(2) - (2)]).mode) == 3 )
2355                                         warn("Immediate mode is illegal");
2356                                   (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0);
2357                                 }
2358     break;
2359
2360   case 59:
2361
2362 /* Line 1806 of yacc.c  */
2363 #line 400 "parser.y"
2364     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2365     break;
2366
2367   case 60:
2368
2369 /* Line 1806 of yacc.c  */
2370 #line 402 "parser.y"
2371     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,4); }
2372     break;
2373
2374   case 61:
2375
2376 /* Line 1806 of yacc.c  */
2377 #line 404 "parser.y"
2378     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2379     break;
2380
2381   case 62:
2382
2383 /* Line 1806 of yacc.c  */
2384 #line 406 "parser.y"
2385     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2386     break;
2387
2388   case 63:
2389
2390 /* Line 1806 of yacc.c  */
2391 #line 408 "parser.y"
2392     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2393     break;
2394
2395   case 64:
2396
2397 /* Line 1806 of yacc.c  */
2398 #line 410 "parser.y"
2399     { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,0); }
2400     break;
2401
2402   case 65:
2403
2404 /* Line 1806 of yacc.c  */
2405 #line 412 "parser.y"
2406     { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,0); }
2407     break;
2408
2409   case 66:
2410
2411 /* Line 1806 of yacc.c  */
2412 #line 414 "parser.y"
2413     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2414     break;
2415
2416   case 67:
2417
2418 /* Line 1806 of yacc.c  */
2419 #line 416 "parser.y"
2420     { (yyval).value = makeop((yyvsp[(1) - (1)]).op,NULL,0); }
2421     break;
2422
2423   case 68:
2424
2425 /* Line 1806 of yacc.c  */
2426 #line 418 "parser.y"
2427     { (yyval).value = makeop((yyvsp[(1) - (1)]).op,NULL,0); }
2428     break;
2429
2430   case 69:
2431
2432 /* Line 1806 of yacc.c  */
2433 #line 420 "parser.y"
2434     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2435     break;
2436
2437   case 70:
2438
2439 /* Line 1806 of yacc.c  */
2440 #line 422 "parser.y"
2441     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2442     break;
2443
2444   case 71:
2445
2446 /* Line 1806 of yacc.c  */
2447 #line 424 "parser.y"
2448     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2449     break;
2450
2451   case 72:
2452
2453 /* Line 1806 of yacc.c  */
2454 #line 426 "parser.y"
2455     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2456     break;
2457
2458   case 73:
2459
2460 /* Line 1806 of yacc.c  */
2461 #line 428 "parser.y"
2462     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2463     break;
2464
2465   case 74:
2466
2467 /* Line 1806 of yacc.c  */
2468 #line 430 "parser.y"
2469     { if( get_md((yyvsp[(2) - (2)]).mode) != 2 )
2470                                         warn("Invalid addressing mode");
2471                                   (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,-2); }
2472     break;
2473
2474   case 75:
2475
2476 /* Line 1806 of yacc.c  */
2477 #line 434 "parser.y"
2478     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2479     break;
2480
2481   case 76:
2482
2483 /* Line 1806 of yacc.c  */
2484 #line 436 "parser.y"
2485     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2486     break;
2487
2488   case 77:
2489
2490 /* Line 1806 of yacc.c  */
2491 #line 438 "parser.y"
2492     { if( get_md((yyvsp[(2) - (2)]).mode) == 0 )
2493                                         warn("Invalid addressing mode");
2494                                   (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,-1); }
2495     break;
2496
2497   case 78:
2498
2499 /* Line 1806 of yacc.c  */
2500 #line 442 "parser.y"
2501     {
2502                                    struct mode tmp;
2503                                         set_md(tmp,0);
2504                                         set_ov(tmp,0);
2505                                         set_sz(tmp,1);
2506                                         set_b1(tmp,(yyvsp[(2) - (2)]).value);
2507                                         (yyval).value = makeop((yyvsp[(1) - (2)]).op,&tmp,0);
2508                                 }
2509     break;
2510
2511   case 79:
2512
2513 /* Line 1806 of yacc.c  */
2514 #line 451 "parser.y"
2515     {
2516                                    struct mode tmp;
2517                                         set_md(tmp,0);
2518                                         set_ov(tmp,0);
2519                                         set_sz(tmp,1);
2520                                         set_b1(tmp,(yyvsp[(2) - (2)]).value);
2521                                         (yyval).value = makeop((yyvsp[(1) - (2)]).op,&tmp,0);
2522                                 }
2523     break;
2524
2525   case 80:
2526
2527 /* Line 1806 of yacc.c  */
2528 #line 460 "parser.y"
2529     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2530     break;
2531
2532   case 81:
2533
2534 /* Line 1806 of yacc.c  */
2535 #line 462 "parser.y"
2536     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2537     break;
2538
2539   case 82:
2540
2541 /* Line 1806 of yacc.c  */
2542 #line 464 "parser.y"
2543     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2544     break;
2545
2546   case 83:
2547
2548 /* Line 1806 of yacc.c  */
2549 #line 466 "parser.y"
2550     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2551     break;
2552
2553   case 84:
2554
2555 /* Line 1806 of yacc.c  */
2556 #line 468 "parser.y"
2557     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2558     break;
2559
2560   case 85:
2561
2562 /* Line 1806 of yacc.c  */
2563 #line 470 "parser.y"
2564     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2565     break;
2566
2567   case 86:
2568
2569 /* Line 1806 of yacc.c  */
2570 #line 472 "parser.y"
2571     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2572     break;
2573
2574   case 87:
2575
2576 /* Line 1806 of yacc.c  */
2577 #line 474 "parser.y"
2578     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2579     break;
2580
2581   case 88:
2582
2583 /* Line 1806 of yacc.c  */
2584 #line 476 "parser.y"
2585     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2586     break;
2587
2588   case 89:
2589
2590 /* Line 1806 of yacc.c  */
2591 #line 478 "parser.y"
2592     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2593     break;
2594
2595   case 90:
2596
2597 /* Line 1806 of yacc.c  */
2598 #line 480 "parser.y"
2599     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2600     break;
2601
2602   case 91:
2603
2604 /* Line 1806 of yacc.c  */
2605 #line 482 "parser.y"
2606     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2607     break;
2608
2609   case 92:
2610
2611 /* Line 1806 of yacc.c  */
2612 #line 484 "parser.y"
2613     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2614     break;
2615
2616   case 93:
2617
2618 /* Line 1806 of yacc.c  */
2619 #line 486 "parser.y"
2620     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2621     break;
2622
2623   case 94:
2624
2625 /* Line 1806 of yacc.c  */
2626 #line 488 "parser.y"
2627     { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,6); }
2628     break;
2629
2630   case 95:
2631
2632 /* Line 1806 of yacc.c  */
2633 #line 492 "parser.y"
2634     { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,0); }
2635     break;
2636
2637   case 96:
2638
2639 /* Line 1806 of yacc.c  */
2640 #line 494 "parser.y"
2641     { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,0); }
2642     break;
2643
2644   case 97:
2645
2646 /* Line 1806 of yacc.c  */
2647 #line 496 "parser.y"
2648     { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,1); }
2649     break;
2650
2651   case 98:
2652
2653 /* Line 1806 of yacc.c  */
2654 #line 498 "parser.y"
2655     { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,1); }
2656     break;
2657
2658   case 99:
2659
2660 /* Line 1806 of yacc.c  */
2661 #line 501 "parser.y"
2662     { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,(yyvsp[(5) - (5)]).value); }
2663     break;
2664
2665   case 100:
2666
2667 /* Line 1806 of yacc.c  */
2668 #line 503 "parser.y"
2669     { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,2); }
2670     break;
2671
2672   case 101:
2673
2674 /* Line 1806 of yacc.c  */
2675 #line 505 "parser.y"
2676     { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,(yyvsp[(3) - (5)]).value+3); }
2677     break;
2678
2679   case 102:
2680
2681 /* Line 1806 of yacc.c  */
2682 #line 507 "parser.y"
2683     { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,5); }
2684     break;
2685
2686   case 103:
2687
2688 /* Line 1806 of yacc.c  */
2689 #line 519 "parser.y"
2690     {
2691                                         set_md((yyval).mode,0);
2692                                         set_ov((yyval).mode, (yyvsp[(3) - (3)]).value);
2693                                         set_sz((yyval).mode, 0);
2694                                 }
2695     break;
2696
2697   case 104:
2698
2699 /* Line 1806 of yacc.c  */
2700 #line 525 "parser.y"
2701     {
2702                                         set_md((yyval).mode,1);
2703                                         set_ov((yyval).mode,0);
2704                                         set_sz((yyval).mode,1);
2705                                         set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2706                                 }
2707     break;
2708
2709   case 105:
2710
2711 /* Line 1806 of yacc.c  */
2712 #line 532 "parser.y"
2713     {
2714                                         set_md((yyval).mode,2);
2715                                         set_ov((yyval).mode,(yyvsp[(4) - (4)]).value);
2716                                         set_sz((yyval).mode,0);
2717                                 }
2718     break;
2719
2720   case 106:
2721
2722 /* Line 1806 of yacc.c  */
2723 #line 538 "parser.y"
2724     {
2725                                         set_md((yyval).mode,3);
2726                                         set_ov((yyval).mode,0);
2727                                         set_sz((yyval).mode,1);
2728                                         set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2729                                 }
2730     break;
2731
2732   case 107:
2733
2734 /* Line 1806 of yacc.c  */
2735 #line 547 "parser.y"
2736     {
2737                                         set_md((yyval).mode,0);
2738                                         set_ov((yyval).mode,0);
2739                                         set_sz((yyval).mode,1);
2740                                         set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2741                                 }
2742     break;
2743
2744   case 108:
2745
2746 /* Line 1806 of yacc.c  */
2747 #line 554 "parser.y"
2748     {
2749                                         set_md((yyval).mode,1);
2750                                         set_ov((yyval).mode,0);
2751                                         set_sz((yyval).mode,2);
2752                                         set_b1((yyval).mode,(yyvsp[(1) - (4)]).value);
2753                                         set_b2((yyval).mode,(yyvsp[(4) - (4)]).value);
2754                                 }
2755     break;
2756
2757   case 109:
2758
2759 /* Line 1806 of yacc.c  */
2760 #line 564 "parser.y"
2761     {
2762                                         set_md((yyval).mode,0);
2763                                         set_ov((yyval).mode,0);
2764                                         set_sz((yyval).mode,1);
2765                                         set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2766                                 }
2767     break;
2768
2769   case 110:
2770
2771 /* Line 1806 of yacc.c  */
2772 #line 571 "parser.y"
2773     {
2774                                         set_md((yyval).mode,1);
2775                                         set_ov((yyval).mode,0);
2776                                         set_sz((yyval).mode,1);
2777                                         set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2778                                 }
2779     break;
2780
2781   case 111:
2782
2783 /* Line 1806 of yacc.c  */
2784 #line 578 "parser.y"
2785     {
2786                                         set_md((yyval).mode,1);
2787                                         set_ov((yyval).mode,0);
2788                                         set_sz((yyval).mode,1);
2789                                         set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2790                                 }
2791     break;
2792
2793   case 112:
2794
2795 /* Line 1806 of yacc.c  */
2796 #line 587 "parser.y"
2797     {
2798                                         set_md((yyval).mode,0);
2799                                         set_ov((yyval).mode,0);
2800                                         set_sz((yyval).mode,2);
2801                                         set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2802                                         set_b2((yyval).mode,(yyvsp[(3) - (3)]).value);
2803                                 }
2804     break;
2805
2806   case 113:
2807
2808 /* Line 1806 of yacc.c  */
2809 #line 597 "parser.y"
2810     {
2811                                         set_md((yyval).mode,0);
2812                                         set_ov((yyval).mode,(yyvsp[(1) - (3)]).value);
2813                                         set_sz((yyval).mode,1);
2814                                         set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2815                                 }
2816     break;
2817
2818   case 114:
2819
2820 /* Line 1806 of yacc.c  */
2821 #line 604 "parser.y"
2822     {
2823                                         set_md((yyval).mode,1);
2824                                         set_ov((yyval).mode,0);
2825                                         set_sz((yyval).mode,2);
2826                                         set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2827                                         set_b2((yyval).mode,(yyvsp[(3) - (3)]).value);
2828                                 }
2829     break;
2830
2831   case 115:
2832
2833 /* Line 1806 of yacc.c  */
2834 #line 614 "parser.y"
2835     {
2836                                         set_md((yyval).mode,0);
2837                                         set_ov((yyval).mode,(yyvsp[(1) - (3)]).value);
2838                                         set_sz((yyval).mode,0);
2839                                 }
2840     break;
2841
2842   case 116:
2843
2844 /* Line 1806 of yacc.c  */
2845 #line 620 "parser.y"
2846     {
2847                                         set_md((yyval).mode,1);
2848                                         set_ov((yyval).mode,(yyvsp[(1) - (3)]).value);
2849                                         set_sz((yyval).mode,1);
2850                                         set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2851                                 }
2852     break;
2853
2854   case 117:
2855
2856 /* Line 1806 of yacc.c  */
2857 #line 627 "parser.y"
2858     {
2859                                         set_md((yyval).mode,2);
2860                                         set_ov((yyval).mode,(yyvsp[(1) - (4)]).value);
2861                                         set_sz((yyval).mode,1);
2862                                         set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2863                                 }
2864     break;
2865
2866   case 118:
2867
2868 /* Line 1806 of yacc.c  */
2869 #line 634 "parser.y"
2870     {
2871                                         set_md((yyval).mode,3);
2872                                         set_ov((yyval).mode,(yyvsp[(3) - (3)]).value);
2873                                         set_sz((yyval).mode,1);
2874                                         set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2875                                 }
2876     break;
2877
2878   case 119:
2879
2880 /* Line 1806 of yacc.c  */
2881 #line 641 "parser.y"
2882     {
2883                                         set_md((yyval).mode,4);
2884                                         set_ov((yyval).mode,0);
2885                                         set_sz((yyval).mode,2);
2886                                         set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2887                                         set_b2((yyval).mode,(yyvsp[(1) - (3)]).value);
2888                                 }
2889     break;
2890
2891   case 120:
2892
2893 /* Line 1806 of yacc.c  */
2894 #line 649 "parser.y"
2895     {
2896                                         set_md((yyval).mode,5);
2897                                         set_ov((yyval).mode,(yyvsp[(4) - (4)]).value);
2898                                         set_sz((yyval).mode,1);
2899                                         set_b1((yyval).mode,(yyvsp[(1) - (4)]).value);
2900                                 }
2901     break;
2902
2903   case 121:
2904
2905 /* Line 1806 of yacc.c  */
2906 #line 656 "parser.y"
2907     {
2908                                         set_md((yyval).mode,6);
2909                                         set_ov((yyval).mode,(yyvsp[(2) - (4)]).value);
2910                                         set_sz((yyval).mode,0);
2911                                 }
2912     break;
2913
2914   case 122:
2915
2916 /* Line 1806 of yacc.c  */
2917 #line 662 "parser.y"
2918     {
2919                                         set_md((yyval).mode,7);
2920                                         set_ov((yyval).mode,(yyvsp[(2) - (4)]).value);
2921                                         set_sz((yyval).mode,1);
2922                                         set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2923                                 }
2924     break;
2925
2926   case 123:
2927
2928 /* Line 1806 of yacc.c  */
2929 #line 669 "parser.y"
2930     {
2931                                         set_md((yyval).mode,8);
2932                                         set_ov((yyval).mode,(yyvsp[(2) - (5)]).value);
2933                                         set_sz((yyval).mode,1);
2934                                         set_b1((yyval).mode,(yyvsp[(5) - (5)]).value);
2935                                 }
2936     break;
2937
2938   case 124:
2939
2940 /* Line 1806 of yacc.c  */
2941 #line 676 "parser.y"
2942     {
2943                                 set_md((yyval).mode,9);
2944                                 set_ov((yyval).mode,0);
2945                                 set_sz((yyval).mode,2);
2946                                 set_b1((yyval).mode, ((yyvsp[(4) - (4)]).value & 0xff00) >> 8 );
2947                                 set_b2((yyval).mode, ((yyvsp[(4) - (4)]).value & 0x00ff) );
2948                         }
2949     break;
2950
2951   case 125:
2952
2953 /* Line 1806 of yacc.c  */
2954 #line 684 "parser.y"
2955     {
2956                                         set_md((yyval).mode,10);
2957                                         set_ov((yyval).mode,0);
2958                                         set_sz((yyval).mode,1);
2959                                         set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2960                                 }
2961     break;
2962
2963   case 126:
2964
2965 /* Line 1806 of yacc.c  */
2966 #line 700 "parser.y"
2967     {
2968                                         set_md((yyval).mode,11);
2969                                         set_ov((yyval).mode,0);
2970                                         set_sz((yyval).mode,1);
2971                                         set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2972                                 }
2973     break;
2974
2975   case 127:
2976
2977 /* Line 1806 of yacc.c  */
2978 #line 707 "parser.y"
2979     {
2980         if( pass2 ) {
2981                 if( !isbit8((yyvsp[(1) - (4)]).value) )
2982                         warn("Bit address exceeds 8-bits");
2983                 if( isbmram((yyvsp[(1) - (4)]).value) )
2984                         set_b1((yyval).mode, ((yyvsp[(1) - (4)]).value-0x20)*8+ (yyvsp[(2) - (4)]).value );
2985                 else if( isbmsfr((yyvsp[(1) - (4)]).value) )
2986                         set_b1((yyval).mode, (yyvsp[(1) - (4)]).value + (yyvsp[(2) - (4)]).value );
2987                 else
2988                         warn("Invalid bit addressable RAM location");
2989         }
2990         set_md((yyval).mode,11);
2991         set_ov((yyval).mode,0);
2992         set_sz((yyval).mode,1);
2993 }
2994     break;
2995
2996   case 128:
2997
2998 /* Line 1806 of yacc.c  */
2999 #line 726 "parser.y"
3000     {
3001                                         set_md((yyval).mode,0);
3002                                         set_ov((yyval).mode,0);
3003                                         set_sz((yyval).mode,0);
3004                                 }
3005     break;
3006
3007   case 129:
3008
3009 /* Line 1806 of yacc.c  */
3010 #line 733 "parser.y"
3011     {
3012                                         set_md((yyval).mode,1);
3013                                         set_ov((yyval).mode,(yyvsp[(1) - (1)]).value);
3014                                         set_sz((yyval).mode,0);
3015                                 }
3016     break;
3017
3018   case 130:
3019
3020 /* Line 1806 of yacc.c  */
3021 #line 739 "parser.y"
3022     {
3023                                         set_md((yyval).mode,2);
3024                                         set_ov((yyval).mode,0);
3025                                         set_sz((yyval).mode,1);
3026                                         set_b1((yyval).mode,(yyvsp[(1) - (1)]).value);
3027                                 }
3028     break;
3029
3030   case 131:
3031
3032 /* Line 1806 of yacc.c  */
3033 #line 746 "parser.y"
3034     {
3035                                         set_md((yyval).mode,3);
3036                                         set_ov((yyval).mode,(yyvsp[(2) - (2)]).value);
3037                                         set_sz((yyval).mode,0);
3038                                 }
3039     break;
3040
3041   case 132:
3042
3043 /* Line 1806 of yacc.c  */
3044 #line 754 "parser.y"
3045     {
3046                                         set_md((yyval).mode,0);
3047                                         set_ov((yyval).mode,0);
3048                                         set_sz((yyval).mode,0);
3049                                 }
3050     break;
3051
3052   case 133:
3053
3054 /* Line 1806 of yacc.c  */
3055 #line 760 "parser.y"
3056     {
3057                                         set_md((yyval).mode,1);
3058                                         set_ov((yyval).mode,0);
3059                                         set_sz((yyval).mode,0);
3060                                 }
3061     break;
3062
3063   case 134:
3064
3065 /* Line 1806 of yacc.c  */
3066 #line 766 "parser.y"
3067     {
3068                                         set_md((yyval).mode,2);
3069                                         set_ov((yyval).mode,0);
3070                                         set_sz((yyval).mode,1);
3071                                         set_b1((yyval).mode,(yyvsp[(1) - (1)]).value);
3072                                 }
3073     break;
3074
3075   case 135:
3076
3077 /* Line 1806 of yacc.c  */
3078 #line 775 "parser.y"
3079     {
3080                                         set_md((yyval).mode,0);
3081                                         set_ov((yyval).mode,0);
3082                                         set_sz((yyval).mode,2);
3083                                         set_b1((yyval).mode,(yyvsp[(3) - (5)]).value);
3084                                         set_b2((yyval).mode,(yyvsp[(5) - (5)]).value);
3085                                 }
3086     break;
3087
3088   case 136:
3089
3090 /* Line 1806 of yacc.c  */
3091 #line 783 "parser.y"
3092     {
3093                                         set_md((yyval).mode,1);
3094                                         set_ov((yyval).mode,0);
3095                                         set_sz((yyval).mode,2);
3096                                         set_b1((yyval).mode,(yyvsp[(4) - (6)]).value);
3097                                         set_b2((yyval).mode,(yyvsp[(6) - (6)]).value);
3098                                 }
3099     break;
3100
3101   case 137:
3102
3103 /* Line 1806 of yacc.c  */
3104 #line 791 "parser.y"
3105     {
3106                                         set_md((yyval).mode,2);
3107                                         set_ov((yyval).mode,(yyvsp[(1) - (6)]).value);
3108                                         set_sz((yyval).mode,2);
3109                                         set_b1((yyval).mode,(yyvsp[(4) - (6)]).value);
3110                                         set_b2((yyval).mode,(yyvsp[(6) - (6)]).value);
3111                                 }
3112     break;
3113
3114   case 138:
3115
3116 /* Line 1806 of yacc.c  */
3117 #line 799 "parser.y"
3118     {
3119                                         set_md((yyval).mode,3);
3120                                         set_ov((yyval).mode,(yyvsp[(2) - (7)]).value);
3121                                         set_sz((yyval).mode,2);
3122                                         set_b1((yyval).mode,(yyvsp[(5) - (7)]).value);
3123                                         set_b2((yyval).mode,(yyvsp[(7) - (7)]).value);
3124                                 }
3125     break;
3126
3127   case 139:
3128
3129 /* Line 1806 of yacc.c  */
3130 #line 809 "parser.y"
3131     {
3132                 long offset;
3133                 if( pass2 ) {
3134                         offset = (yyvsp[(1) - (1)]).val.v - (lc+3);
3135                         if( offset > 127 || offset < -128 )
3136                            warn("Relative offset exceeds -128 / +127");
3137                         (yyval).value = offset;
3138                 }
3139 }
3140     break;
3141
3142   case 140:
3143
3144 /* Line 1806 of yacc.c  */
3145 #line 826 "parser.y"
3146     {
3147                 long offset;
3148                 if( pass2 ) {
3149                         offset = (yyvsp[(1) - (1)]).val.v - (lc+2); /* different! */
3150                         if( offset > 127 || offset < -128 )
3151                            warn("Relative offset exceeds -128 / +127");
3152                         (yyval).value = offset;
3153                 }
3154 }
3155     break;
3156
3157   case 141:
3158
3159 /* Line 1806 of yacc.c  */
3160 #line 839 "parser.y"
3161     {
3162         if( pass2 ) {
3163                 if( !isbit8((yyvsp[(1) - (2)]).value) )
3164                         warn("Bit address exceeds 8-bits");
3165                 if( isbmram((yyvsp[(1) - (2)]).value) )
3166                         (yyval).value = ((yyvsp[(1) - (2)]).value-0x20)*8+(yyvsp[(2) - (2)]).value;
3167                 else if( isbmsfr((yyvsp[(1) - (2)]).value) )
3168                         (yyval).value = (yyvsp[(1) - (2)]).value + (yyvsp[(2) - (2)]).value;
3169                 else
3170                         warn("Invalid bit addressable RAM location");
3171         }
3172 }
3173     break;
3174
3175   case 142:
3176
3177 /* Line 1806 of yacc.c  */
3178 #line 852 "parser.y"
3179     {
3180         if( pass2 ) {
3181                 if( !isbit8((yyvsp[(1) - (1)]).value) )
3182                         warn("Bit address exceeds 8-bits");
3183                 (yyval).value = (yyvsp[(1) - (1)]).value;
3184         }
3185 }
3186     break;
3187
3188   case 143:
3189
3190 /* Line 1806 of yacc.c  */
3191 #line 862 "parser.y"
3192     {
3193         if( (yyvsp[(1) - (1)]).sym->type == UNDEF && pass2 )
3194                 warn("Symbol %s undefined",(yyvsp[(1) - (1)]).sym->name);
3195         (yyval).value = (yyvsp[(1) - (1)]).sym->value;
3196 }
3197     break;
3198
3199   case 144:
3200
3201 /* Line 1806 of yacc.c  */
3202 #line 867 "parser.y"
3203     { (yyval).value = (yyvsp[(1) - (1)]).value; }
3204     break;
3205
3206   case 145:
3207
3208 /* Line 1806 of yacc.c  */
3209 #line 870 "parser.y"
3210     { (yyval).value = 0; }
3211     break;
3212
3213   case 146:
3214
3215 /* Line 1806 of yacc.c  */
3216 #line 871 "parser.y"
3217     { (yyval).value = 1; }
3218     break;
3219
3220   case 147:
3221
3222 /* Line 1806 of yacc.c  */
3223 #line 872 "parser.y"
3224     { (yyval).value = 2; }
3225     break;
3226
3227   case 148:
3228
3229 /* Line 1806 of yacc.c  */
3230 #line 873 "parser.y"
3231     { (yyval).value = 3; }
3232     break;
3233
3234   case 149:
3235
3236 /* Line 1806 of yacc.c  */
3237 #line 874 "parser.y"
3238     { (yyval).value = 4; }
3239     break;
3240
3241   case 150:
3242
3243 /* Line 1806 of yacc.c  */
3244 #line 875 "parser.y"
3245     { (yyval).value = 5; }
3246     break;
3247
3248   case 151:
3249
3250 /* Line 1806 of yacc.c  */
3251 #line 876 "parser.y"
3252     { (yyval).value = 6; }
3253     break;
3254
3255   case 152:
3256
3257 /* Line 1806 of yacc.c  */
3258 #line 877 "parser.y"
3259     { (yyval).value = 7; }
3260     break;
3261
3262   case 153:
3263
3264 /* Line 1806 of yacc.c  */
3265 #line 880 "parser.y"
3266     { (yyval).value = 0; }
3267     break;
3268
3269   case 154:
3270
3271 /* Line 1806 of yacc.c  */
3272 #line 881 "parser.y"
3273     { (yyval).value = 1; }
3274     break;
3275
3276   case 155:
3277
3278 /* Line 1806 of yacc.c  */
3279 #line 883 "parser.y"
3280     { (yyval).value = 0;
3281                                   warn("Illegal indirect register: @r2"); }
3282     break;
3283
3284   case 156:
3285
3286 /* Line 1806 of yacc.c  */
3287 #line 886 "parser.y"
3288     { (yyval).value = 0;
3289                                   warn("Illegal indirect register: @r3"); }
3290     break;
3291
3292   case 157:
3293
3294 /* Line 1806 of yacc.c  */
3295 #line 889 "parser.y"
3296     { (yyval).value = 0;
3297                                   warn("Illegal indirect register: @r4"); }
3298     break;
3299
3300   case 158:
3301
3302 /* Line 1806 of yacc.c  */
3303 #line 892 "parser.y"
3304     { (yyval).value = 0;
3305                                   warn("Illegal indirect register: @r5"); }
3306     break;
3307
3308   case 159:
3309
3310 /* Line 1806 of yacc.c  */
3311 #line 895 "parser.y"
3312     { (yyval).value = 0;
3313                                   warn("Illegal indirect register: @r6"); }
3314     break;
3315
3316   case 160:
3317
3318 /* Line 1806 of yacc.c  */
3319 #line 898 "parser.y"
3320     { (yyval).value = 0;
3321                                   warn("Illegal indirect register: @r7"); }
3322     break;
3323
3324   case 161:
3325
3326 /* Line 1806 of yacc.c  */
3327 #line 903 "parser.y"
3328     {
3329         if( pass2 ) {
3330                 if( !isbit8((yyvsp[(1) - (1)]).val.v) )
3331                         warn("Expression greater than 8-bits");
3332         }
3333         (yyval).value = (yyvsp[(1) - (1)]).val.v;
3334 }
3335     break;
3336
3337   case 162:
3338
3339 /* Line 1806 of yacc.c  */
3340 #line 913 "parser.y"
3341     {
3342         if( pass2 ) {
3343                 if( !isbit16((yyvsp[(1) - (1)]).val.v) )
3344                         warn("Expression greater than 16-bits");
3345         }
3346         (yyval).value = (yyvsp[(1) - (1)]).val.v;
3347 }
3348     break;
3349
3350   case 163:
3351
3352 /* Line 1806 of yacc.c  */
3353 #line 923 "parser.y"
3354     {
3355                 if( pass2 ) {
3356                         if( !isbit16((yyvsp[(1) - (1)]).val.v)  )
3357                                 warn("Address greater than 16-bits");
3358                         if( ((yyvsp[(1) - (1)]).val.v & size11) != ((lc+2) & size11) )
3359                                 warn("Address outside current 2K page");
3360                 }
3361                 set_md((yyval).mode,0);
3362                 set_ov((yyval).mode, ((yyvsp[(1) - (1)]).val.v&0x0700)>>3 );
3363                 set_sz((yyval).mode,1);
3364                 set_b1((yyval).mode,(yyvsp[(1) - (1)]).val.v&0x00ff);
3365 }
3366     break;
3367
3368   case 164:
3369
3370 /* Line 1806 of yacc.c  */
3371 #line 938 "parser.y"
3372     {
3373                 if( pass2 ) {
3374                         if( !isbit16((yyvsp[(1) - (1)]).val.v)  )
3375                                 warn("Address greater than 16-bits");
3376                 }
3377                 set_md((yyval).mode,0);
3378                 set_ov((yyval).mode, 0 );
3379                 set_sz((yyval).mode,2);
3380                 set_b1((yyval).mode, ((yyvsp[(1) - (1)]).val.v & 0xff00 ) >> 8 );
3381                 set_b2((yyval).mode, ((yyvsp[(1) - (1)]).val.v & 0x00ff ) );
3382 }
3383     break;
3384
3385   case 165:
3386
3387 /* Line 1806 of yacc.c  */
3388 #line 952 "parser.y"
3389     {
3390                 long offset=0;
3391                 if( pass2 ) {
3392                         offset = (yyvsp[(1) - (1)]).val.v - (lc+2);
3393                         if( offset>127 || offset<-128 )
3394                            warn("Relative offset exceeds -128 / +127");
3395                 }
3396                 set_md((yyval).mode,0);
3397                 set_ov((yyval).mode,0);
3398                 set_sz((yyval).mode,1);
3399                 set_b1((yyval).mode,offset);
3400
3401 }
3402     break;
3403
3404
3405
3406 /* Line 1806 of yacc.c  */
3407 #line 3408 "y.tab.c"
3408       default: break;
3409     }
3410   /* User semantic actions sometimes alter yychar, and that requires
3411      that yytoken be updated with the new translation.  We take the
3412      approach of translating immediately before every use of yytoken.
3413      One alternative is translating here after every semantic action,
3414      but that translation would be missed if the semantic action invokes
3415      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3416      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
3417      incorrect destructor might then be invoked immediately.  In the
3418      case of YYERROR or YYBACKUP, subsequent parser actions might lead
3419      to an incorrect destructor call or verbose syntax error message
3420      before the lookahead is translated.  */
3421   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3422
3423   YYPOPSTACK (yylen);
3424   yylen = 0;
3425   YY_STACK_PRINT (yyss, yyssp);
3426
3427   *++yyvsp = yyval;
3428
3429   /* Now `shift' the result of the reduction.  Determine what state
3430      that goes to, based on the state we popped back to and the rule
3431      number reduced by.  */
3432
3433   yyn = yyr1[yyn];
3434
3435   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3436   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3437     yystate = yytable[yystate];
3438   else
3439     yystate = yydefgoto[yyn - YYNTOKENS];
3440
3441   goto yynewstate;
3442
3443
3444 /*------------------------------------.
3445 | yyerrlab -- here on detecting error |
3446 `------------------------------------*/
3447 yyerrlab:
3448   /* Make sure we have latest lookahead translation.  See comments at
3449      user semantic actions for why this is necessary.  */
3450   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3451
3452   /* If not already recovering from an error, report this error.  */
3453   if (!yyerrstatus)
3454     {
3455       ++yynerrs;
3456 #if ! YYERROR_VERBOSE
3457       yyerror (YY_("syntax error"));
3458 #else
3459 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3460                                         yyssp, yytoken)
3461       {
3462         char const *yymsgp = YY_("syntax error");
3463         int yysyntax_error_status;
3464         yysyntax_error_status = YYSYNTAX_ERROR;
3465         if (yysyntax_error_status == 0)
3466           yymsgp = yymsg;
3467         else if (yysyntax_error_status == 1)
3468           {
3469             if (yymsg != yymsgbuf)
3470               YYSTACK_FREE (yymsg);
3471             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3472             if (!yymsg)
3473               {
3474                 yymsg = yymsgbuf;
3475                 yymsg_alloc = sizeof yymsgbuf;
3476                 yysyntax_error_status = 2;
3477               }
3478             else
3479               {
3480                 yysyntax_error_status = YYSYNTAX_ERROR;
3481                 yymsgp = yymsg;
3482               }
3483           }
3484         yyerror (yymsgp);
3485         if (yysyntax_error_status == 2)
3486           goto yyexhaustedlab;
3487       }
3488 # undef YYSYNTAX_ERROR
3489 #endif
3490     }
3491
3492
3493
3494   if (yyerrstatus == 3)
3495     {
3496       /* If just tried and failed to reuse lookahead token after an
3497          error, discard it.  */
3498
3499       if (yychar <= YYEOF)
3500         {
3501           /* Return failure if at end of input.  */
3502           if (yychar == YYEOF)
3503             YYABORT;
3504         }
3505       else
3506         {
3507           yydestruct ("Error: discarding",
3508                       yytoken, &yylval);
3509           yychar = YYEMPTY;
3510         }
3511     }
3512
3513   /* Else will try to reuse lookahead token after shifting the error
3514      token.  */
3515   goto yyerrlab1;
3516
3517
3518 /*---------------------------------------------------.
3519 | yyerrorlab -- error raised explicitly by YYERROR.  |
3520 `---------------------------------------------------*/
3521 yyerrorlab:
3522
3523   /* Pacify compilers like GCC when the user code never invokes
3524      YYERROR and the label yyerrorlab therefore never appears in user
3525      code.  */
3526   if (/*CONSTCOND*/ 0)
3527      goto yyerrorlab;
3528
3529   /* Do not reclaim the symbols of the rule which action triggered
3530      this YYERROR.  */
3531   YYPOPSTACK (yylen);
3532   yylen = 0;
3533   YY_STACK_PRINT (yyss, yyssp);
3534   yystate = *yyssp;
3535   goto yyerrlab1;
3536
3537
3538 /*-------------------------------------------------------------.
3539 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
3540 `-------------------------------------------------------------*/
3541 yyerrlab1:
3542   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
3543
3544   for (;;)
3545     {
3546       yyn = yypact[yystate];
3547       if (!yypact_value_is_default (yyn))
3548         {
3549           yyn += YYTERROR;
3550           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3551             {
3552               yyn = yytable[yyn];
3553               if (0 < yyn)
3554                 break;
3555             }
3556         }
3557
3558       /* Pop the current state because it cannot handle the error token.  */
3559       if (yyssp == yyss)
3560         YYABORT;
3561
3562
3563       yydestruct ("Error: popping",
3564                   yystos[yystate], yyvsp);
3565       YYPOPSTACK (1);
3566       yystate = *yyssp;
3567       YY_STACK_PRINT (yyss, yyssp);
3568     }
3569
3570   *++yyvsp = yylval;
3571
3572
3573   /* Shift the error token.  */
3574   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3575
3576   yystate = yyn;
3577   goto yynewstate;
3578
3579
3580 /*-------------------------------------.
3581 | yyacceptlab -- YYACCEPT comes here.  |
3582 `-------------------------------------*/
3583 yyacceptlab:
3584   yyresult = 0;
3585   goto yyreturn;
3586
3587 /*-----------------------------------.
3588 | yyabortlab -- YYABORT comes here.  |
3589 `-----------------------------------*/
3590 yyabortlab:
3591   yyresult = 1;
3592   goto yyreturn;
3593
3594 #if !defined(yyoverflow) || YYERROR_VERBOSE
3595 /*-------------------------------------------------.
3596 | yyexhaustedlab -- memory exhaustion comes here.  |
3597 `-------------------------------------------------*/
3598 yyexhaustedlab:
3599   yyerror (YY_("memory exhausted"));
3600   yyresult = 2;
3601   /* Fall through.  */
3602 #endif
3603
3604 yyreturn:
3605   if (yychar != YYEMPTY)
3606     {
3607       /* Make sure we have latest lookahead translation.  See comments at
3608          user semantic actions for why this is necessary.  */
3609       yytoken = YYTRANSLATE (yychar);
3610       yydestruct ("Cleanup: discarding lookahead",
3611                   yytoken, &yylval);
3612     }
3613   /* Do not reclaim the symbols of the rule which action triggered
3614      this YYABORT or YYACCEPT.  */
3615   YYPOPSTACK (yylen);
3616   YY_STACK_PRINT (yyss, yyssp);
3617   while (yyssp != yyss)
3618     {
3619       yydestruct ("Cleanup: popping",
3620                   yystos[*yyssp], yyvsp);
3621       YYPOPSTACK (1);
3622     }
3623 #ifndef yyoverflow
3624   if (yyss != yyssa)
3625     YYSTACK_FREE (yyss);
3626 #endif
3627 #if YYERROR_VERBOSE
3628   if (yymsg != yymsgbuf)
3629     YYSTACK_FREE (yymsg);
3630 #endif
3631   /* Make sure YYID is used.  */
3632   return YYID (yyresult);
3633 }
3634
3635
3636
3637 /* Line 2067 of yacc.c  */
3638 #line 967 "parser.y"
3639
3640
3641 /* ---------------------------------------------------------------------- */
3642
3643 void yyerror(const char *s)
3644 {
3645         warn("%s near \"%s\"", s, get_last_token());
3646 }
3647
3648
3649 /* ----------------------------------------------------------------------
3650  * makeop:
3651  *      This function makes an opcode based on the instruction symbol table
3652  *      entry, and an addressing mode structure.
3653  *      This function is called from both passes, but
3654  *      only generates code in pass 2.
3655  *
3656  *      Resultant opcode bytes are passed to genbyte().
3657  *
3658  *      Returns the nuumber of bytes that the instruction
3659  *      occupies.
3660  *
3661  */
3662
3663 int makeop(struct opcode * op, struct mode *m, int add)
3664 {
3665         register unsigned int newop;
3666
3667         if( m == NULL ) {
3668                 if(pass2) genbyte(op->bytes[0+add]);
3669                 return(1);
3670         }
3671
3672         if( pass2 ) {
3673                 newop = op->bytes[ get_md(*m)+add ] | get_ov(*m);
3674                 genbyte(newop);
3675                 if( get_sz(*m) > 0 ) genbyte( get_b1(*m) );
3676                 if( get_sz(*m) > 1 ) genbyte( get_b2(*m) );
3677         }
3678         return( get_sz(*m)+1 );
3679 }
3680
3681
3682 /* ----------------------------------------------------------------------
3683  * inclc:
3684  *      Increments the Location Counter by 'i' amount.
3685  *      Check to see if 'i' overflows 64K.
3686  *      Checks to see if assembler is overlapping previous sections
3687  *      of code. (using a large bit field).
3688  *
3689  */
3690
3691 #define indx(a) ( (a)/(32) )
3692 #define bit(a)  ( 1 << ((a)%(32)) )
3693
3694 #define getloc(a) (regions[indx(a)] & bit(a))
3695 #define setloc(a) (regions[indx(a)] |= bit(a))
3696
3697 static unsigned long regions[ 0x10000/(32) ];
3698
3699 void inclc(int i)
3700 {
3701
3702         while (i-- > 0) {
3703                 if( pass2 && getloc(lc) )
3704                         error("Location counter overlaps");
3705                 if( pass2 ) setloc(lc);
3706                 lc += 1;
3707         }
3708                 
3709         if( lc > 0xffff )
3710                 error("Location counter has exceeded 16-bits");
3711 }
3712
3713 void clear_location_counter(void)
3714 {
3715         memset(regions, 0, sizeof(regions));
3716 }
3717
3718
3719 /* ----------------------------------------------------------------------
3720  * padline:
3721  *      This routine returns a new string, which is equivilant to
3722  *      'line' except that all tabs have been expanded to spaces, and
3723  *      the total length has been truncated to 60 chars.
3724  */
3725
3726 char *padline(char *line)
3727 {
3728         static char newline[61];
3729         char *p1;
3730         int pos=0,nxtpos;
3731
3732         for(p1=line; pos<sizeof(newline)-1 && *p1; p1++ ) {
3733                 if( *p1 == '\t' ) {
3734                         nxtpos = pos+8-pos%8;
3735                         while(pos<sizeof(newline)-1 && pos <= nxtpos)
3736                                 newline[pos++] = ' ';
3737                 } else if( *p1 != '\n' )
3738                         newline[pos++]= *p1;
3739         }
3740         newline[pos] = '\0';
3741         return(newline);
3742 }
3743
3744
3745 /* ----------------------------------------------------------------------
3746  * dumplist:
3747  *      Outputs the current location counter, bytebuf[] array, and
3748  *      the string 'txt' to the listing file.
3749  *      This routine is called for every source line encountered in the
3750  *      source file. (Only in pass 2, and if listing is turned on).
3751  *
3752  */
3753
3754 void dumplist(char *txt, int show)
3755 {
3756         int i,j;
3757
3758         fprintf(listing,show?"%04lX: ":"      ",lc);
3759
3760         j=0;
3761         for(i=0; i<bytecount; i++ ) {
3762                 fprintf(listing,"%02X ",bytebuf[i]);
3763                 if( ++j >= 4 ) {
3764                         j = 0;
3765                         fprintf(listing,"\n      ");
3766                 }
3767         }
3768         while(++j <= 4)
3769                 fprintf(listing,"   ");
3770
3771         fprintf(listing," %s\n",padline(txt));
3772 }
3773
3774 /* ----------------------------------------------------------------------
3775  * gen* routines:
3776  *      Place information into the bytebuf[] array, and also
3777  *      call emitbyte with the byte.
3778  *
3779  */
3780
3781 void genbyte(int b)
3782 {
3783         if( bytecount < sizeof(bytebuf) )
3784                 bytebuf[bytecount++] = b;
3785         emitbyte(b);
3786 }
3787
3788 void genstr(const char *s)
3789 {
3790         while( *s )
3791                 genbyte(*s++);
3792 }
3793
3794 void genword(unsigned long w)
3795 {
3796         genbyte( (w & 0xff00) >> 8 );
3797         genbyte( (w & 0x00ff) );
3798 }
3799
3800