ns32k-opcode.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. /* ns32k-opcode.h -- Opcode table for National Semi 32k processor
  2. Copyright (C) 1987 Free Software Foundation, Inc.
  3. This file is part of GAS, the GNU Assembler.
  4. GAS is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 1, or (at your option)
  7. any later version.
  8. GAS is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GAS; see the file COPYING. If not, write to
  14. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  15. /*
  16. After deciding the instruction entry (via hash.c) the instruction parser
  17. will try to match the operands after the instruction to the required set
  18. given in the entry operandfield. Every operand will result in a change in
  19. the opcode or the addition of data to the opcode.
  20. The operands in the source instruction are checked for inconsistent
  21. semantics.
  22. F : 32 bit float general form
  23. L : 64 bit float "
  24. B : byte "
  25. W : word "
  26. D : double-word "
  27. Q : quad-word "
  28. A : double-word gen-address-form ie no regs allowed
  29. d : displacement
  30. b : displacement - pc relative addressing acb
  31. p : displacement - pc relative addressing br bcond bsr cxp
  32. q : quick
  33. i : immediate (8 bits)
  34. This is not a standard ns32k operandtype, it is used to build
  35. instructions like svc arg1,arg2
  36. Svc is the instruction SuperVisorCall and is sometimes used to
  37. call OS-routines from usermode. Some args might be handy!
  38. r : register number (3 bits)
  39. O : setcfg instruction optionslist
  40. C : cinv instruction optionslist
  41. S : stringinstruction optionslist
  42. U : registerlist save,enter
  43. u : registerlist restore,exit
  44. M : mmu register
  45. P : cpu register
  46. g : 3:rd operand of inss or exts instruction
  47. G : 4:th operand of inss or exts instruction
  48. Those operands are encoded in the same byte.
  49. This byte is placed last in the instruction.
  50. f : operand of sfsr
  51. H : sequent-hack for bsr (Warning)
  52. column 1 instructions
  53. 2 number of bits in opcode.
  54. 3 number of bits in opcode explicitly
  55. determined by the instruction type.
  56. 4 opcodeseed, the number we build our opcode
  57. from.
  58. 5 operandtypes, used by operandparser.
  59. 6 size in bytes of immediate
  60. */
  61. struct ns32k_opcode {
  62. char *name;
  63. unsigned char opcode_id_size; /* not used by the assembler */
  64. unsigned char opcode_size;
  65. unsigned long opcode_seed;
  66. char *operands;
  67. unsigned char im_size; /* not used by dissassembler */
  68. char *default_args; /* default to those args when none given */
  69. char default_modec; /* default to this addr-mode when ambigous
  70. ie when the argument of a general addr-mode
  71. is a plain constant */
  72. char default_model; /* is a plain label */
  73. };
  74. struct ns32k_opcode ns32k_opcodes[]=
  75. {
  76. { "absf", 14,24, 0x35be, "1F2F", 4, "", 20,21 },
  77. { "absl", 14,24, 0x34be, "1L2L", 8, "", 20,21 },
  78. { "absb", 14,24, 0x304e, "1B2B", 1, "", 20,21 },
  79. { "absw", 14,24, 0x314e, "1W2W", 2, "", 20,21 },
  80. { "absd", 14,24, 0x334e, "1D2D", 4, "", 20,21 },
  81. { "acbb", 7,16, 0x4c, "2B1q3p", 1, "", 20,21 },
  82. { "acbw", 7,16, 0x4d, "2W1q3p", 2, "", 20,21 },
  83. { "acbd", 7,16, 0x4f, "2D1q3p", 4, "", 20,21 },
  84. { "addf", 14,24, 0x01be, "1F2F", 4, "", 20,21 },
  85. { "addl", 14,24, 0x00be, "1L2L", 8, "", 20,21 },
  86. { "addb", 6,16, 0x00, "1B2B", 1, "", 20,21 },
  87. { "addw", 6,16, 0x01, "1W2W", 2, "", 20,21 },
  88. { "addd", 6,16, 0x03, "1D2D", 4, "", 20,21 },
  89. { "addcb", 6,16, 0x10, "1B2B", 1, "", 20,21 },
  90. { "addcw", 6,16, 0x11, "1W2W", 2, "", 20,21 },
  91. { "addcd", 6,16, 0x13, "1D2D", 4, "", 20,21 },
  92. { "addpb", 14,24, 0x3c4e, "1B2B", 1, "", 20,21 },
  93. { "addpw", 14,24, 0x3d4e, "1W2W", 2, "", 20,21 },
  94. { "addpd", 14,24, 0x3f4e, "1D2D", 4, "", 20,21 },
  95. { "addqb", 7,16, 0x0c, "2B1q", 1, "", 20,21 },
  96. { "addqw", 7,16, 0x0d, "2W1q", 2, "", 20,21 },
  97. { "addqd", 7,16, 0x0f, "2D1q", 4, "", 20,21 },
  98. { "addr", 6,16, 0x27, "1A2D", 4, "", 21,21 },
  99. { "adjspb", 11,16, 0x057c, "1B", 1, "", 20,21 },
  100. { "adjspw", 11,16, 0x057d, "1W", 2, "", 20,21 },
  101. { "adjspd", 11,16, 0x057f, "1D", 4, "", 20,21 },
  102. { "andb", 6,16, 0x28, "1B2B", 1, "", 20,21 },
  103. { "andw", 6,16, 0x29, "1W2W", 2, "", 20,21 },
  104. { "andd", 6,16, 0x2b, "1D2D", 4, "", 20,21 },
  105. { "ashb", 14,24, 0x044e, "1B2B", 1, "", 20,21 },
  106. { "ashw", 14,24, 0x054e, "1B2W", 1, "", 20,21 },
  107. { "ashd", 14,24, 0x074e, "1B2D", 1, "", 20,21 },
  108. { "beq", 8,8, 0x0a, "1p", 0, "", 20,21 },
  109. { "bne", 8,8, 0x1a, "1p", 0, "", 20,21 },
  110. { "bcs", 8,8, 0x2a, "1p", 0, "", 20,21 },
  111. { "bcc", 8,8, 0x3a, "1p", 0, "", 20,21 },
  112. { "bhi", 8,8, 0x4a, "1p", 0, "", 20,21 },
  113. { "bls", 8,8, 0x5a, "1p", 0, "", 20,21 },
  114. { "bgt", 8,8, 0x6a, "1p", 0, "", 20,21 },
  115. { "ble", 8,8, 0x7a, "1p", 0, "", 20,21 },
  116. { "bfs", 8,8, 0x8a, "1p", 0, "", 20,21 },
  117. { "bfc", 8,8, 0x9a, "1p", 0, "", 20,21 },
  118. { "blo", 8,8, 0xaa, "1p", 0, "", 20,21 },
  119. { "bhs", 8,8, 0xba, "1p", 0, "", 20,21 },
  120. { "blt", 8,8, 0xca, "1p", 0, "", 20,21 },
  121. { "bge", 8,8, 0xda, "1p", 0, "", 20,21 },
  122. { "but", 8,8, 0xea, "1p", 0, "", 20,21 },
  123. { "buf", 8,8, 0xfa, "1p", 0, "", 20,21 },
  124. { "bicb", 6,16, 0x08, "1B2B", 1, "", 20,21 },
  125. { "bicw", 6,16, 0x09, "1W2W", 2, "", 20,21 },
  126. { "bicd", 6,16, 0x0b, "1D2D", 4, "", 20,21 },
  127. { "bicpsrb", 11,16, 0x17c, "1B", 1, "", 20,21 },
  128. { "bicpsrw", 11,16, 0x17d, "1W", 2, "", 20,21 },
  129. { "bispsrb", 11,16, 0x37c, "1B", 1, "", 20,21 },
  130. { "bispsrw", 11,16, 0x37d, "1W", 2, "", 20,21 },
  131. { "bpt", 8,8, 0xf2, "", 0, "", 20,21 },
  132. { "br", 8,8, 0xea, "1p", 0, "", 20,21 },
  133. { "bsr", 8,8, 0x02, "1H", 0, "", 20,21 },
  134. { "caseb", 11,16, 0x77c, "1B", 1, "", 20,21 },
  135. { "casew", 11,16, 0x77d, "1W", 2, "", 20,21 },
  136. { "cased", 11,16, 0x77f, "1D", 4, "", 20,21 },
  137. { "cbitb", 14,24, 0x084e, "1B2D", 1, "", 20,21 },
  138. { "cbitw", 14,24, 0x094e, "1W2D", 2, "", 20,21 },
  139. { "cbitd", 14,24, 0x0b4e, "1D2D", 4, "", 20,21 },
  140. { "cbitib", 14,24, 0x0c4e, "1B2D", 1, "", 20,21 },
  141. { "cbitiw", 14,24, 0x0d4e, "1W2D", 2, "", 20,21 },
  142. { "cbitid", 14,24, 0x0f4e, "1D2D", 4, "", 20,21 },
  143. { "checkb", 11,24, 0x0ee, "2A3B1r", 1, "", 20,21 },
  144. { "checkw", 11,24, 0x1ee, "2A3W1r", 2, "", 20,21 },
  145. { "checkd", 11,24, 0x3ee, "2A3D1r", 4, "", 20,21 },
  146. { "cinv", 14,24, 0x271e, "2D1C", 4, "", 20,21 },
  147. { "cmpf", 14,24, 0x09be, "1F2F", 4, "", 20,21 },
  148. { "cmpl", 14,24, 0x08be, "1L2L", 8, "", 20,21 },
  149. { "cmpb", 6,16, 0x04, "1B2B", 1, "", 20,21 },
  150. { "cmpw", 6,16, 0x05, "1W2W", 2, "", 20,21 },
  151. { "cmpd", 6,16, 0x07, "1D2D", 4, "", 20,21 },
  152. { "cmpmb", 14,24, 0x04ce, "1A2A3b", 1, "", 20,21 },
  153. { "cmpmw", 14,24, 0x05ce, "1A2A3b", 2, "", 20,21 },
  154. { "cmpmd", 14,24, 0x07ce, "1A2A3b", 4, "", 20,21 },
  155. { "cmpqb", 7,16, 0x1c, "2B1q", 0, "", 20,21 },
  156. { "cmpqw", 7,16, 0x1d, "2W1q", 0, "", 20,21 },
  157. { "cmpqd", 7,16, 0x1f, "2D1q", 0, "", 20,21 },
  158. { "cmpsb", 16,24, 0x040e, "1S", 0, "[]", 20,21 },
  159. { "cmpsw", 16,24, 0x050e, "1S", 0, "[]", 20,21 },
  160. { "cmpsd", 16,24, 0x070e, "1S", 0, "[]", 20,21 },
  161. { "cmpst", 16,24, 0x840e, "1S", 0, "[]", 20,21 },
  162. { "comb", 14,24, 0x344e, "1B2B", 1, "", 20,21 },
  163. { "comw", 14,24, 0x354e, "1W2W", 2, "", 20,21 },
  164. { "comd", 14,24, 0x374e, "1D2D", 4, "", 20,21 },
  165. { "cvtp", 11,24, 0x036e, "2A3D1r", 4, "", 20,21 },
  166. { "cxp", 8,8, 0x22, "1p", 0, "", 20,21 },
  167. { "cxpd", 11,16, 0x07f, "1A", 4, "", 20,21 },
  168. { "deib", 14,24, 0x2cce, "1B2W", 1, "", 20,21 },
  169. { "deiw", 14,24, 0x2dce, "1W2D", 2, "", 20,21 },
  170. { "deid", 14,24, 0x2fce, "1D2Q", 4, "", 20,21 },
  171. { "dia", 8,8, 0xc2, "", 1, "", 20,21 },
  172. { "divf", 14,24, 0x21be, "1F2F", 4, "", 20,21 },
  173. { "divl", 14,24, 0x20be, "1L2L", 8, "", 20,21 },
  174. { "divb", 14,24, 0x3cce, "1B2B", 1, "", 20,21 },
  175. { "divw", 14,24, 0x3dce, "1W2W", 2, "", 20,21 },
  176. { "divd", 14,24, 0x3fce, "1D2D", 4, "", 20,21 },
  177. { "enter", 8,8, 0x82, "1U2d", 0, "", 20,21 },
  178. { "exit", 8,8, 0x92, "1u", 0, "", 20,21 },
  179. { "extb", 11,24, 0x02e, "2D3B1r4d", 1, "", 20,21 },
  180. { "extw", 11,24, 0x12e, "2D3W1r4d", 2, "", 20,21 },
  181. { "extd", 11,24, 0x32e, "2D3D1r4d", 4, "", 20,21 },
  182. { "extsb", 14,24, 0x0cce, "1D2B3g4G", 1, "", 20,21 },
  183. { "extsw", 14,24, 0x0dce, "1D2W3g4G", 2, "", 20,21 },
  184. { "extsd", 14,24, 0x0fce, "1D2D3g4G", 4, "", 20,21 },
  185. { "ffsb", 14,24, 0x046e, "1B2B", 1, "", 20,21 },
  186. { "ffsw", 14,24, 0x056e, "1W2B", 2, "", 20,21 },
  187. { "ffsd", 14,24, 0x076e, "1D2B", 4, "", 20,21 },
  188. { "flag", 8,8, 0xd2, "", 0, "", 20,21 },
  189. { "floorfb", 14,24, 0x3c3e, "1F2B", 4, "", 20,21 },
  190. { "floorfw", 14,24, 0x3d3e, "1F2W", 4, "", 20,21 },
  191. { "floorfd", 14,24, 0x3f3e, "1F2D", 4, "", 20,21 },
  192. { "floorlb", 14,24, 0x383e, "1L2B", 8, "", 20,21 },
  193. { "floorlw", 14,24, 0x393e, "1L2W", 8, "", 20,21 },
  194. { "floorld", 14,24, 0x3b3e, "1L2D", 8, "", 20,21 },
  195. { "ibitb", 14,24, 0x384e, "1B2D", 1, "", 20,21 },
  196. { "ibitw", 14,24, 0x394e, "1W2D", 2, "", 20,21 },
  197. { "ibitd", 14,24, 0x3b4e, "1D2D", 4, "", 20,21 },
  198. { "indexb", 11,24, 0x42e, "2B3B1r", 1, "", 20,21 },
  199. { "indexw", 11,24, 0x52e, "2W3W1r", 2, "", 20,21 },
  200. { "indexd", 11,24, 0x72e, "2D3D1r", 4, "", 20,21 },
  201. { "insb", 11,24, 0x0ae, "2B3B1r4d", 1, "", 20,21 },
  202. { "insw", 11,24, 0x1ae, "2W3W1r4d", 2, "", 20,21 },
  203. { "insd", 11,24, 0x3ae, "2D3D1r4d", 4, "", 20,21 },
  204. { "inssb", 14,24, 0x08ce, "1B2D3g4G", 1, "", 20,21 },
  205. { "inssw", 14,24, 0x09ce, "1W2D3g4G", 2, "", 20,21 },
  206. { "inssd", 14,24, 0x0bce, "1D2D3g4G", 4, "", 20,21 },
  207. { "jsr", 11,16, 0x67f, "1A", 4, "", 20,21 },
  208. { "jump", 11,16, 0x27f, "1A", 4, "", 20,21 },
  209. { "lfsr", 19,24, 0x00f3e,"1D", 4, "", 20,21 },
  210. { "lmr", 15,24, 0x0b1e, "2D1M", 4, "", 20,21 },
  211. { "lprb", 7,16, 0x6c, "2B1P", 1, "", 20,21 },
  212. { "lprw", 7,16, 0x6d, "2W1P", 2, "", 20,21 },
  213. { "lprd", 7,16, 0x6f, "2D1P", 4, "", 20,21 },
  214. { "lshb", 14,24, 0x144e, "1B2B", 1, "", 20,21 },
  215. { "lshw", 14,24, 0x154e, "1B2W", 2, "", 20,21 },
  216. { "lshd", 14,24, 0x174e, "1B2D", 4, "", 20,21 },
  217. { "meib", 14,24, 0x24ce, "1B2W", 1, "", 20,21 },
  218. { "meiw", 14,24, 0x25ce, "1W2D", 2, "", 20,21 },
  219. { "meid", 14,24, 0x27ce, "1D2Q", 4, "", 20,21 },
  220. { "modb", 14,24, 0x38ce, "1B2B", 1, "", 20,21 },
  221. { "modw", 14,24, 0x39ce, "1W2W", 2, "", 20,21 },
  222. { "modd", 14,24, 0x3bce, "1D2D", 4, "", 20,21 },
  223. { "movf", 14,24, 0x05be, "1F2F", 4, "", 20,21 },
  224. { "movl", 14,24, 0x04be, "1L2L", 8, "", 20,21 },
  225. { "movb", 6,16, 0x14, "1B2B", 1, "", 20,21 },
  226. { "movw", 6,16, 0x15, "1W2W", 2, "", 20,21 },
  227. { "movd", 6,16, 0x17, "1D2D", 4, "", 20,21 },
  228. { "movbf", 14,24, 0x043e, "1B2F", 1, "", 20,21 },
  229. { "movwf", 14,24, 0x053e, "1W2F", 2, "", 20,21 },
  230. { "movdf", 14,24, 0x073e, "1D2F", 4, "", 20,21 },
  231. { "movbl", 14,24, 0x003e, "1B2L", 1, "", 20,21 },
  232. { "movwl", 14,24, 0x013e, "1W2L", 2, "", 20,21 },
  233. { "movdl", 14,24, 0x033e, "1D2L", 4, "", 20,21 },
  234. { "movfl", 14,24, 0x1b3e, "1F2L", 4, "", 20,21 },
  235. { "movlf", 14,24, 0x163e, "1L2F", 8, "", 20,21 },
  236. { "movmb", 14,24, 0x00ce, "1A2A3b", 1, "", 20,21 },
  237. { "movmw", 14,24, 0x01ce, "1A2A3b", 2, "", 20,21 },
  238. { "movmd", 14,24, 0x03ce, "1A2A3b", 4, "", 20,21 },
  239. { "movqb", 7,16, 0x5c, "2B1q", 1, "", 20,21 },
  240. { "movqw", 7,16, 0x5d, "2B1q", 2, "", 20,21 },
  241. { "movqd", 7,16, 0x5f, "2B1q", 4, "", 20,21 },
  242. { "movsb", 16,24, 0x000e, "1S", 0, "[]", 20,21 },
  243. { "movsw", 16,24, 0x010e, "1S", 0, "[]", 20,21 },
  244. { "movsd", 16,24, 0x030e, "1S", 0, "[]", 20,21 },
  245. { "movst", 16,24, 0x800e, "1S", 0, "[]", 20,21 },
  246. { "movsub", 14,24, 0x0cae, "1A2A", 1, "", 20,21 },
  247. { "movsuw", 14,24, 0x0dae, "1A2A", 2, "", 20,21 },
  248. { "movsud", 14,24, 0x0fae, "1A2A", 4, "", 20,21 },
  249. { "movusb", 14,24, 0x1cae, "1A2A", 1, "", 20,21 },
  250. { "movusw", 14,24, 0x1dae, "1A2A", 2, "", 20,21 },
  251. { "movusd", 14,24, 0x1fae, "1A2A", 4, "", 20,21 },
  252. { "movxbd", 14,24, 0x1cce, "1B2D", 1, "", 20,21 },
  253. { "movxwd", 14,24, 0x1dce, "1W2D", 2, "", 20,21 },
  254. { "movxbw", 14,24, 0x10ce, "1B2W", 1, "", 20,21 },
  255. { "movzbd", 14,24, 0x18ce, "1B2D", 1, "", 20,21 },
  256. { "movzwd", 14,24, 0x19ce, "1W2D", 2, "", 20,21 },
  257. { "movzbw", 14,24, 0x14ce, "1B2W", 1, "", 20,21 },
  258. { "mulf", 14,24, 0x31be, "1F2F", 4, "", 20,21 },
  259. { "mull", 14,24, 0x30be, "1L2L", 8, "", 20,21 },
  260. { "mulb", 14,24, 0x20ce, "1B2B", 1, "", 20,21 },
  261. { "mulw", 14,24, 0x21ce, "1W2W", 2, "", 20,21 },
  262. { "muld", 14,24, 0x23ce, "1D2D", 4, "", 20,21 },
  263. { "negf", 14,24, 0x15be, "1F2F", 4, "", 20,21 },
  264. { "negl", 14,24, 0x14be, "1L2L", 8, "", 20,21 },
  265. { "negb", 14,24, 0x204e, "1B2B", 1, "", 20,21 },
  266. { "negw", 14,24, 0x214e, "1W2W", 2, "", 20,21 },
  267. { "negd", 14,24, 0x234e, "1D2D", 4, "", 20,21 },
  268. { "nop", 8,8, 0xa2, "", 0, "", 20,21 },
  269. { "notb", 14,24, 0x244e, "1B2B", 1, "", 20,21 },
  270. { "notw", 14,24, 0x254e, "1W2W", 2, "", 20,21 },
  271. { "notd", 14,24, 0x274e, "1D2D", 4, "", 20,21 },
  272. { "orb", 6,16, 0x18, "1B2B", 1, "", 20,21 },
  273. { "orw", 6,16, 0x19, "1W2W", 2, "", 20,21 },
  274. { "ord", 6,16, 0x1b, "1D2D", 4, "", 20,21 },
  275. { "quob", 14,24, 0x30ce, "1B2B", 1, "", 20,21 },
  276. { "quow", 14,24, 0x31ce, "1W2W", 2, "", 20,21 },
  277. { "quod", 14,24, 0x33ce, "1D2D", 4, "", 20,21 },
  278. { "rdval", 19,24, 0x0031e,"1A", 4, "", 20,21 },
  279. { "remb", 14,24, 0x34ce, "1B2B", 1, "", 20,21 },
  280. { "remw", 14,24, 0x35ce, "1W2W", 2, "", 20,21 },
  281. { "remd", 14,24, 0x37ce, "1D2D", 4, "", 20,21 },
  282. { "restore", 8,8, 0x72, "1u", 0, "", 20,21 },
  283. { "ret", 8,8, 0x12, "1d", 0, "", 20,21 },
  284. { "reti", 8,8, 0x52, "", 0, "", 20,21 },
  285. { "rett", 8,8, 0x42, "1d", 0, "", 20,21 },
  286. { "rotb", 14,24, 0x004e, "1B2B", 1, "", 20,21 },
  287. { "rotw", 14,24, 0x014e, "1B2W", 1, "", 20,21 },
  288. { "rotd", 14,24, 0x034e, "1B2D", 1, "", 20,21 },
  289. { "roundfb", 14,24, 0x243e, "1F2B", 4, "", 20,21 },
  290. { "roundfw", 14,24, 0x253e, "1F2W", 4, "", 20,21 },
  291. { "roundfd", 14,24, 0x273e, "1F2D", 4, "", 20,21 },
  292. { "roundlb", 14,24, 0x203e, "1L2B", 8, "", 20,21 },
  293. { "roundlw", 14,24, 0x213e, "1L2W", 8, "", 20,21 },
  294. { "roundld", 14,24, 0x233e, "1L2D", 8, "", 20,21 },
  295. { "rxp", 8,8, 0x32, "1d", 0, "", 20,21 },
  296. { "seqb", 11,16, 0x3c, "1B", 0, "", 20,21 },
  297. { "seqw", 11,16, 0x3d, "1W", 0, "", 20,21 },
  298. { "seqd", 11,16, 0x3f, "1D", 0, "", 20,21 },
  299. { "sneb", 11,16, 0xbc, "1B", 0, "", 20,21 },
  300. { "snew", 11,16, 0xbd, "1W", 0, "", 20,21 },
  301. { "sned", 11,16, 0xbf, "1D", 0, "", 20,21 },
  302. { "scsb", 11,16, 0x13c, "1B", 0, "", 20,21 },
  303. { "scsw", 11,16, 0x13d, "1W", 0, "", 20,21 },
  304. { "scsd", 11,16, 0x13f, "1D", 0, "", 20,21 },
  305. { "sccb", 11,16, 0x1bc, "1B", 0, "", 20,21 },
  306. { "sccw", 11,16, 0x1bd, "1W", 0, "", 20,21 },
  307. { "sccd", 11,16, 0x1bf, "1D", 0, "", 20,21 },
  308. { "shib", 11,16, 0x23c, "1B", 0, "", 20,21 },
  309. { "shiw", 11,16, 0x23d, "1W", 0, "", 20,21 },
  310. { "shid", 11,16, 0x23f, "1D", 0, "", 20,21 },
  311. { "slsb", 11,16, 0x2bc, "1B", 0, "", 20,21 },
  312. { "slsw", 11,16, 0x2bd, "1W", 0, "", 20,21 },
  313. { "slsd", 11,16, 0x2bf, "1D", 0, "", 20,21 },
  314. { "sgtb", 11,16, 0x33c, "1B", 0, "", 20,21 },
  315. { "sgtw", 11,16, 0x33d, "1W", 0, "", 20,21 },
  316. { "sgtd", 11,16, 0x33f, "1D", 0, "", 20,21 },
  317. { "sleb", 11,16, 0x3bc, "1B", 0, "", 20,21 },
  318. { "slew", 11,16, 0x3bd, "1W", 0, "", 20,21 },
  319. { "sled", 11,16, 0x3bf, "1D", 0, "", 20,21 },
  320. { "sfsb", 11,16, 0x43c, "1B", 0, "", 20,21 },
  321. { "sfsw", 11,16, 0x43d, "1W", 0, "", 20,21 },
  322. { "sfsd", 11,16, 0x43f, "1D", 0, "", 20,21 },
  323. { "sfcb", 11,16, 0x4bc, "1B", 0, "", 20,21 },
  324. { "sfcw", 11,16, 0x4bd, "1W", 0, "", 20,21 },
  325. { "sfcd", 11,16, 0x4bf, "1D", 0, "", 20,21 },
  326. { "slob", 11,16, 0x53c, "1B", 0, "", 20,21 },
  327. { "slow", 11,16, 0x53d, "1W", 0, "", 20,21 },
  328. { "slod", 11,16, 0x53f, "1D", 0, "", 20,21 },
  329. { "shsb", 11,16, 0x5bc, "1B", 0, "", 20,21 },
  330. { "shsw", 11,16, 0x5bd, "1W", 0, "", 20,21 },
  331. { "shsd", 11,16, 0x5bf, "1D", 0, "", 20,21 },
  332. { "sltb", 11,16, 0x63c, "1B", 0, "", 20,21 },
  333. { "sltw", 11,16, 0x63d, "1W", 0, "", 20,21 },
  334. { "sltd", 11,16, 0x63f, "1D", 0, "", 20,21 },
  335. { "sgeb", 11,16, 0x6bc, "1B", 0, "", 20,21 },
  336. { "sgew", 11,16, 0x6bd, "1W", 0, "", 20,21 },
  337. { "sged", 11,16, 0x6bf, "1D", 0, "", 20,21 },
  338. { "sutb", 11,16, 0x73c, "1B", 0, "", 20,21 },
  339. { "sutw", 11,16, 0x73d, "1W", 0, "", 20,21 },
  340. { "sutd", 11,16, 0x73f, "1D", 0, "", 20,21 },
  341. { "sufb", 11,16, 0x7bc, "1B", 0, "", 20,21 },
  342. { "sufw", 11,16, 0x7bd, "1W", 0, "", 20,21 },
  343. { "sufd", 11,16, 0x7bf, "1D", 0, "", 20,21 },
  344. { "save", 8,8, 0x62, "1U", 0, "", 20,21 },
  345. { "sbitb", 14,24, 0x184e, "1B2A", 1, "", 20,21 },
  346. { "sbitw", 14,24, 0x194e, "1W2A", 2, "", 20,21 },
  347. { "sbitd", 14,24, 0x1b4e, "1D2A", 4, "", 20,21 },
  348. { "sbitib", 14,24, 0x1c4e, "1B2A", 1, "", 20,21 },
  349. { "sbitiw", 14,24, 0x1d4e, "1W2A", 2, "", 20,21 },
  350. { "sbitid", 14,24, 0x1f4e, "1D2A", 4, "", 20,21 },
  351. { "setcfg", 15,24, 0x0b0e, "1O", 0, "", 20,21 },
  352. { "sfsr", 14,24, 0x373e, "1f", 0, "", 20,21 },
  353. { "skpsb", 16,24, 0x0c0e, "1S", 0, "[]", 20,21 },
  354. { "skpsw", 16,24, 0x0d0e, "1S", 0, "[]", 20,21 },
  355. { "skpsd", 16,24, 0x0f0e, "1S", 0, "[]", 20,21 },
  356. { "skpst", 16,24, 0x8c0e, "1S", 0, "[]", 20,21 },
  357. { "smr", 15,24, 0x0f1e, "2D1M", 4, "", 20,21 },
  358. { "sprb", 7,16, 0x2c, "2B1P", 1, "", 20,21 },
  359. { "sprw", 7,16, 0x2d, "2W1P", 2, "", 20,21 },
  360. { "sprd", 7,16, 0x2f, "2D1P", 4, "", 20,21 },
  361. { "subf", 14,24, 0x11be, "1F2F", 4, "", 20,21 },
  362. { "subl", 14,24, 0x10be, "1L2L", 8, "", 20,21 },
  363. { "subb", 6,16, 0x20, "1B2B", 1, "", 20,21 },
  364. { "subw", 6,16, 0x21, "1W2W", 2, "", 20,21 },
  365. { "subd", 6,16, 0x23, "1D2D", 4, "", 20,21 },
  366. { "subcb", 6,16, 0x30, "1B2B", 1, "", 20,21 },
  367. { "subcw", 6,16, 0x31, "1W2W", 2, "", 20,21 },
  368. { "subcd", 6,16, 0x33, "1D2D", 4, "", 20,21 },
  369. { "subpb", 14,24, 0x2c4e, "1B2B", 1, "", 20,21 },
  370. { "subpw", 14,24, 0x2d4e, "1W2W", 2, "", 20,21 },
  371. { "subpd", 14,24, 0x2f4e, "1D2D", 4, "", 20,21 },
  372. #ifdef NS32K_SVC_IMMED_OPERANDS
  373. { "svc", 8,8, 0xe2, "2i1i", 1, "", 20,21 }, /* not really, but unix uses it */
  374. #else
  375. { "svc", 8,8, 0xe2, "", 0, "", 20,21 },
  376. #endif
  377. { "tbitb", 6,16, 0x34, "1B2A", 1, "", 20,21 },
  378. { "tbitw", 6,16, 0x35, "1W2A", 2, "", 20,21 },
  379. { "tbitd", 6,16, 0x37, "1D2A", 4, "", 20,21 },
  380. { "truncfb", 14,24, 0x2c3e, "1F2B", 4, "", 20,21 },
  381. { "truncfw", 14,24, 0x2d3e, "1F2W", 4, "", 20,21 },
  382. { "truncfd", 14,24, 0x2f3e, "1F2D", 4, "", 20,21 },
  383. { "trunclb", 14,24, 0x283e, "1L2B", 8, "", 20,21 },
  384. { "trunclw", 14,24, 0x293e, "1L2W", 8, "", 20,21 },
  385. { "truncld", 14,24, 0x2b3e, "1L2D", 8, "", 20,21 },
  386. { "wait", 8,8, 0xb2, "", 0, "", 20,21 },
  387. { "wrval", 19,24, 0x0071e,"1A", 0, "", 20,21 },
  388. { "xorb", 6,16, 0x38, "1B2B", 1, "", 20,21 },
  389. { "xorw", 6,16, 0x39, "1W2W", 2, "", 20,21 },
  390. { "xord", 6,16, 0x3b, "1D2D", 4, "", 20,21 },
  391. #if defined(NS32381) /* I'm not too sure of these */
  392. { "dotf", 14,24, 0x0dfe, "1F2F", 4, "", 20,21 },
  393. { "dotl", 14,24, 0x0cfe, "1L2L", 8, "", 20,21 },
  394. { "logbf", 14,24, 0x15fe, "1F2F", 4, "", 20,21 },
  395. { "logbl", 14,24, 0x14fe, "1L2L", 8, "", 20,21 },
  396. { "polyf", 14,24, 0x09fe, "1F2F", 4, "", 20,21 },
  397. { "polyl", 14,24, 0x08fe, "1L2L", 8, "", 20,21 },
  398. { "scalbf", 14,24, 0x11fe, "1F2F", 4, "", 20,21 },
  399. { "scalbl", 14,24, 0x10fe, "1L2L", 8, "", 20,21 },
  400. #endif
  401. };
  402. int numopcodes=sizeof(ns32k_opcodes)/sizeof(ns32k_opcodes[0]);
  403. struct ns32k_opcode *endop = ns32k_opcodes+sizeof(ns32k_opcodes)/sizeof(ns32k_opcodes[0]);
  404. #define MAX_ARGS 4
  405. #define ARG_LEN 50