Pristine Ack-5.5
[Ack-5.5.git] / mach / z8000 / as / mach2.c
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 #define RCSID2 "$Id: mach2.c,v 0.3 1994/06/24 13:56:17 ceriel Exp $"
6
7 /*
8 ** Zilog z8000 machine dependent yacc declarations
9 */
10 /*      Some of the following mnemonics might seem a little cryptic,
11 ** especially those like F1_1a.  The decision to choose these mnemo-
12 ** nics is based on the fact that the manual `Z8000 PLZ/ASM Assembly
13 ** Language  Programming Manual' distinguishes some instruction for-
14 ** mats and gave them names like F1.1, etc.   In fact section 3.3 of
15 ** this manual describes the instruction set and mentions with  each
16 ** instruction also the corresponding instruction format(s).    So I
17 ** sorted  all instructions on their instruction format(s) resulting
18 ** in groups named F1_1, F1_2, F2_1, etc.  (Groups consisting of one
19 ** member where named to that member).  Almost all  groups  were  so
20 ** consistent that writing one yacc-rule per group sufficed.    Only
21 ** some  groups had to be split up resulting in mnemonics like F1_1a
22 ** and F1_1b.
23 */
24 %token <y_word>  CALR  CC  CTLR  CTLRFLAGS  DJNZ  FLAG  F1_1a  F1_1b
25 %token <y_word>  F1_1F2_3  F1_2  F1_2F6_3  F2_1  F2_1F5_1  F5_1L  F5_1R
26 %token <y_word>  F6_4  F6_5  F6_6  F9_1  F9_2  F9_3  IN  INTCB  JP  JR
27 %token <y_word>  LD  LDA  LDAR  LDCTL  LDCTLB  LDK  LDL  LDM  LDR  MREQ
28 %token <y_word>  OUT  POP  PUSH  R8  R16  R32  R64  RET  SC  TCC
29
30
31     /* From all addressing modes only 'im' and 'ra' might need more than
32     ** 16 bits;      This is achieved by using the global var 'immed' in
33     ** case of 'im' and by returning a long in case of 'ra'.
34     */
35 %type <y_word>  ba  bx  coco1  coco2  ctlargs  ctlbargs  da  dst  flags
36 %type <y_word>  im  imexpr  ints  ir  opr  option  option2  reg  src  x
37
38 %type <y_expr>  ra