1 /* 2 * Copyright (c) 1983 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)ops.sun.c 5.2 (Berkeley) 06/01/90"; 10 #endif /* not lint */ 11 12 /* 13 * Machine operators. 14 */ 15 16 #include "defs.h" 17 #include "ops.h" 18 #include "machine.h" 19 20 #ifndef public 21 22 /* 23 * 68000 opcodes. 24 */ 25 26 #define IMDF "#0x%x" /* immediate data format */ 27 28 typedef struct { 29 unsigned short mask, match; 30 int (*opfun)(); 31 char *farg; 32 } Optab; 33 34 #endif 35 36 public String bname[16] = { 37 "ra", "sr", "hi", "ls", "cc", "cs", "ne", 38 "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le" 39 }; 40 41 public String cname[16] = { 42 "ra", "f", "hi", "ls", "cc", "cs", "ne", 43 "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le" 44 }; 45 46 public String dbname[16] = { 47 "t", "ra", "hi", "ls", "cc", "cs", "ne", 48 "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le" 49 }; 50 51 public String shro[4] = { "as", "ls", "rox", "ro" }; 52 53 public String bit[4] = { "btst", "bchg", "bclr", "bset" }; 54 55 /* 56 * order is important here 57 */ 58 59 public Optab optab[] = { 60 0xF000, 0x1000, omove, "b", /* move instructions */ 61 0xF000, 0x2000, omove, "l", 62 0xF000, 0x3000, omove, "w", 63 0xF000, 0x6000, obranch, 0, /* branches */ 64 0xFF00, 0x0000, oimmed, "or", /* op class 0 */ 65 0xFF00, 0x0200, oimmed, "and", 66 0xFF00, 0x0400, oimmed, "sub", 67 0xFF00, 0x0600, oimmed, "add", 68 0xFF00, 0x0A00, oimmed, "eor", 69 0xFF00, 0x0C00, oimmed, "cmp", 70 0xFF00, 0x0E00, omovs, "movs", 71 0xF100, 0x0100, biti, 0, 72 0xF800, 0x0800, biti, 0, 73 0xFFC0, 0x40C0, oneop, "move_from_sr\t", /* op class 4 */ 74 0xFF00, 0x4000, soneop, "negx", 75 0xFFC0, 0x42C0, oneop, "movw cc,", 76 0xFF00, 0x4200, soneop, "clr", 77 0xFFC0, 0x44C0, oneop, "move_to_ccr ", 78 0xFF00, 0x4400, soneop, "neg", 79 0xFFC0, 0x46C0, oneop, "move_to_sr ", 80 0xFF00, 0x4600, soneop, "not", 81 0xFFC0, 0x4800, oneop, "nbcd ", 82 0xFFF8, 0x4840, oreg, "\tswap\td%D", 83 0xFFC0, 0x4840, oneop, "pea ", 84 0xFFF8, 0x4880, oreg, "\textw\td%D", 85 0xFFF8, 0x48C0, oreg, "\textl\td%D", 86 0xFB80, 0x4880, omovem, 0, 87 0xFFC0, 0x4AC0, oneop, "tas ", 88 0xFF00, 0x4A00, soneop, "tst", 89 0xFFF0, 0x4E40, otrap, 0, 90 0xFFF8, 0x4E50, olink, 0, 91 0xFFFE, 0x4E7A, omovc, "\tmovc\t", 92 0xFFF8, 0x4880, oreg, "\textw\td%D", 93 0xFFF8, 0x48C0, oreg, "\textl\td%D", 94 0xFFF8, 0x4E58, oreg, "\tunlk\ta%D", 95 0xFFF8, 0x4E60, oreg, "\tmove\ta%D,usp", 96 0xFFF8, 0x4E68, oreg, "\tmove\tusp,a%D", 97 0xFFFF, 0x4E70, oprint, "reset", 98 0xFFFF, 0x4E71, oprint, "nop", 99 0xFFFF, 0x4E72, ostop, "\tstop\t0x%x", 100 0xFFFF, 0x4E73, oprint, "rte", 101 0xFFFF, 0x4E74, ortspop, "\trts\t0x%x", 102 0xFFFF, 0x4E75, orts, "rts", 103 0xFFFF, 0x4E76, oprint, "trapv", 104 0xFFFF, 0x4E77, oprint, "rtr", 105 0xFFC0, 0x4E80, jsrop, "jsr ", 106 0xFFC0, 0x4EC0, jmpop, "jmp ", 107 0xF1C0, 0x4180, ochk, "chk", 108 0xF1C0, 0x41C0, ochk, "lea", 109 0xF0F8, 0x50C8, odbcc, "\tdb%s\td%D,", 110 0xF0C0, 0x50C0, oscc, 0, 111 0xF100, 0x5000, oquick, "addq", 112 0xF100, 0x5100, oquick, "subq", 113 0xF000, 0x7000, omoveq, 0, 114 0xF1C0, 0x80C0, ochk, "divu", 115 0xF1C0, 0x81C0, ochk, "divs", 116 0xF1F0, 0x8100, extend, "sbcd", 117 0xF000, 0x8000, opmode, "or", 118 0xF1C0, 0x91C0, opmode, "sub", 119 0xF130, 0x9100, extend, "subx", 120 0xF000, 0x9000, opmode, "sub", 121 0xF1C0, 0xB1C0, opmode, "cmp", 122 0xF138, 0xB108, extend, "cmpm", 123 0xF100, 0xB000, opmode, "cmp", 124 0xF100, 0xB100, opmode, "eor", 125 0xF1C0, 0xC0C0, ochk, "mulu", 126 0xF1C0, 0xC1C0, ochk, "muls", 127 0xF1F8, 0xC188, extend, "exg", 128 0xF1F8, 0xC148, extend, "exg", 129 0xF1F8, 0xC140, extend, "exg", 130 0xF1F0, 0xC100, extend, "abcd", 131 0xF000, 0xC000, opmode, "and", 132 0xF1C0, 0xD1C0, opmode, "add", 133 0xF130, 0xD100, extend, "addx", 134 0xF000, 0xD000, opmode, "add", 135 0xF100, 0xE000, shroi, "r", 136 0xF100, 0xE100, shroi, "l", 137 0, 0, 0, 0 138 }; 139 140