2 * Instruction formats for the sequencer program downloaded to
3 * Aic7xxx SCSI host adapters
5 * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions, and the following disclaimer,
13 * without modification.
14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15 * substantially similar to the "NO WARRANTY" disclaimer below
16 * ("Disclaimer") and any redistribution must be conditioned upon
17 * including a substantially similar Disclaimer requirement for further
18 * binary redistribution.
19 * 3. Neither the names of the above-listed copyright holders nor the names
20 * of any contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * Alternatively, this software may be distributed under the terms of the
24 * GNU General Public License ("GPL") version 2 as published by the Free
25 * Software Foundation.
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGES.
40 * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_insformat.h#12 $
45 #include <asm/byteorder.h>
47 /* 8bit ALU logic operations */
49 #ifdef __LITTLE_ENDIAN
50 uint32_t immediate
: 8,
66 /* 8bit ALU shift/rotate operations */
68 #ifdef __LITTLE_ENDIAN
69 uint32_t shift_control
: 8,
85 /* 8bit branch control operations */
87 #ifdef __LITTLE_ENDIAN
88 uint32_t immediate
: 8,
102 /* 16bit ALU logic operations */
104 #ifdef __LITTLE_ENDIAN
105 uint32_t opcode_ext
: 8,
121 /* 16bit branch control operations */
123 #ifdef __LITTLE_ENDIAN
124 uint32_t opcode_ext
: 8,
138 /* Far branch operations */
140 #ifdef __LITTLE_ENDIAN
158 struct ins_format1 format1
;
159 struct ins_format2 format2
;
160 struct ins_format3 format3
;
161 struct ins_format4 format4
;
162 struct ins_format5 format5
;
163 struct ins_format6 format6
;
168 union ins_formats format
;
170 struct symbol
*patch_label
;
171 STAILQ_ENTRY(instruction
) links
;
174 #define AIC_OP_OR 0x0
175 #define AIC_OP_AND 0x1
176 #define AIC_OP_XOR 0x2
177 #define AIC_OP_ADD 0x3
178 #define AIC_OP_ADC 0x4
179 #define AIC_OP_ROL 0x5
180 #define AIC_OP_BMOV 0x6
182 #define AIC_OP_MVI16 0x7
184 #define AIC_OP_JMP 0x8
185 #define AIC_OP_JC 0x9
186 #define AIC_OP_JNC 0xa
187 #define AIC_OP_CALL 0xb
188 #define AIC_OP_JNE 0xc
189 #define AIC_OP_JNZ 0xd
190 #define AIC_OP_JE 0xe
191 #define AIC_OP_JZ 0xf
194 #define AIC_OP_SHL 0x10
195 #define AIC_OP_SHR 0x20
196 #define AIC_OP_ROR 0x30
198 /* 16bit Ops. Low byte main opcode. High byte extended opcode. */
199 #define AIC_OP_OR16 0x8005
200 #define AIC_OP_AND16 0x8105
201 #define AIC_OP_XOR16 0x8205
202 #define AIC_OP_ADD16 0x8305
203 #define AIC_OP_ADC16 0x8405
204 #define AIC_OP_JNE16 0x8805
205 #define AIC_OP_JNZ16 0x8905
206 #define AIC_OP_JE16 0x8C05
207 #define AIC_OP_JZ16 0x8B05
208 #define AIC_OP_JMP16 0x9005
209 #define AIC_OP_JC16 0x9105
210 #define AIC_OP_JNC16 0x9205
211 #define AIC_OP_CALL16 0x9305
213 /* Page extension is low three bits of second opcode byte. */
214 #define AIC_OP_JMPF 0xA005
215 #define AIC_OP_CALLF 0xB005
216 #define AIC_OP_JCF 0xC005
217 #define AIC_OP_JNCF 0xD005
218 #define AIC_OP_CMPXCHG 0xE005