1 :option:::insn-bit-size:16
5 :option:::format-names:I,II,III,IV,V,VI,VII,VIII,IX,X
6 :option:::format-names:XI,XII,XIII
7 :option:::format-names:XIV,XV
8 :option:::format-names:Z
13 :option:::multi-sim:true
15 :option:::multi-sim:true
16 :model:::v850e1:v850e1:
20 :cache:::unsigned:reg1:RRRRR:(RRRRR)
21 :cache:::unsigned:reg2:rrrrr:(rrrrr)
22 :cache:::unsigned:reg3:wwwww:(wwwww)
24 :cache:::unsigned:disp4:dddd:(dddd)
25 :cache:::unsigned:disp5:dddd:(dddd << 1)
26 :cache:::unsigned:disp7:ddddddd:ddddddd
27 :cache:::unsigned:disp8:ddddddd:(ddddddd << 1)
28 :cache:::unsigned:disp8:dddddd:(dddddd << 2)
29 :cache:::unsigned:disp9:ddddd,ddd:SEXT32 ((ddddd << 4) + (ddd << 1), 9 - 1)
30 :cache:::unsigned:disp16:dddddddddddddddd:EXTEND16 (dddddddddddddddd)
31 :cache:::unsigned:disp16:ddddddddddddddd: EXTEND16 (ddddddddddddddd << 1)
32 :cache:::unsigned:disp22:dddddd,ddddddddddddddd: SEXT32 ((dddddd << 16) + (ddddddddddddddd << 1), 22 - 1)
34 :cache:::unsigned:imm5:iiiii:SEXT32 (iiiii, 4)
35 :cache:::unsigned:imm6:iiiiii:iiiiii
36 :cache:::unsigned:imm9:iiiii,IIII:SEXT ((IIII << 5) + iiiii, 9 - 1)
37 :cache:::unsigned:imm5:iiii:(32 - (iiii << 1))
38 :cache:::unsigned:simm16:iiiiiiiiiiiiiiii:EXTEND16 (iiiiiiiiiiiiiiii)
39 :cache:::unsigned:uimm16:iiiiiiiiiiiiiiii:iiiiiiiiiiiiiiii
40 :cache:::unsigned:imm32:iiiiiiiiiiiiiiii,IIIIIIIIIIIIIIII:(iiiiiiiiiiiiiiii < 16 + IIIIIIIIIIIIIIII)
41 :cache:::unsigned:uimm32:iiiiiiiiiiiiiiii,dddddddddddddddd:((iiiiiiiiiiiiiiii << 16) + dddddddddddddddd)
43 :cache:::unsigned:vector:iiiii:iiiii
45 :cache:::unsigned:list12:L,LLLLLLLLLLL:((L << 11) + LLLLLLLLLLL)
46 :cache:::unsigned:list18:LLLL,LLLLLLLLLLLL:((LLLL << 12) + LLLLLLLLLLLL)
48 :cache:::unsigned:bit3:bbb:bbb
51 // What do we do with an illegal instruction?
54 sim_io_eprintf (SD, "Illegal instruction at address 0x%lx\n",
56 sim_engine_halt (SD, CPU, NULL, cia, sim_signalled, SIM_SIGILL);
63 rrrrr,001110,RRRRR:I:::add
64 "add r<reg1>, r<reg2>"
69 rrrrr,010010,iiiii:II:::add
78 rrrrr,110000,RRRRR + iiiiiiiiiiiiiiii:VI:::addi
79 "addi <simm16>, r<reg1>, r<reg2>"
87 rrrrr,001010,RRRRR:I:::and
88 "and r<reg1>, r<reg2>"
96 rrrrr,110110,RRRRR + iiiiiiiiiiiiiiii:VI:::andi
97 "andi <uimm16>, r<reg1>, r<reg2>"
104 // Map condition code to a string
109 case 0xf: return "gt";
110 case 0xe: return "ge";
111 case 0x6: return "lt";
113 case 0x7: return "le";
115 case 0xb: return "h";
116 case 0x9: return "nl";
117 case 0x1: return "l";
119 case 0x3: return "nh";
121 case 0x2: return "e";
123 case 0xa: return "ne";
125 case 0x0: return "v";
126 case 0x8: return "nv";
127 case 0x4: return "n";
128 case 0xc: return "p";
129 /* case 0x1: return "c"; */
130 /* case 0x9: return "nc"; */
131 /* case 0x2: return "z"; */
132 /* case 0xa: return "nz"; */
133 case 0x5: return "r"; /* always */
134 case 0xd: return "sa";
141 ddddd,1011,ddd,cccc:III:::Bcond
145 if ((ddddd == 0x00) && (ddd == 0x00) && (cccc == 0x05)) {
146 // Special case - treat "br *" like illegal instruction
147 sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
149 cond = condition_met (cccc);
152 TRACE_BRANCH1 (cond);
159 rrrrr,11111100000 + wwwww,01101000010:XII:::bsh
162 "bsh r<reg2>, r<reg3>"
165 TRACE_ALU_INPUT1 (GR[reg2]);
167 value = (MOVED32 (GR[reg2], 23, 16, 31, 24)
168 | MOVED32 (GR[reg2], 31, 24, 23, 16)
169 | MOVED32 (GR[reg2], 7, 0, 15, 8)
170 | MOVED32 (GR[reg2], 15, 8, 7, 0));
173 PSW &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
174 if ((value & 0xffff) == 0) PSW |= PSW_Z;
175 if (value & 0x80000000) PSW |= PSW_S;
176 if (((value & 0xff) == 0) || ((value & 0xff00) == 0)) PSW |= PSW_CY;
178 TRACE_ALU_RESULT (GR[reg3]);
182 rrrrr,11111100000 + wwwww,01101000000:XII:::bsw
185 "bsw r<reg2>, r<reg3>"
187 #define WORDHASNULLBYTE(x) (((x) - 0x01010101) & ~(x)&0x80808080)
189 TRACE_ALU_INPUT1 (GR[reg2]);
193 value |= (GR[reg2] << 24);
194 value |= ((GR[reg2] << 8) & 0x00ff0000);
195 value |= ((GR[reg2] >> 8) & 0x0000ff00);
198 PSW &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
200 if (value == 0) PSW |= PSW_Z;
201 if (value & 0x80000000) PSW |= PSW_S;
202 if (WORDHASNULLBYTE (value)) PSW |= PSW_CY;
204 TRACE_ALU_RESULT (GR[reg3]);
208 0000001000,iiiiii:II:::callt
217 adr = (CTBP & ~1) + (imm6 << 1);
218 off = load_mem (adr, 2) & ~1; /* Force alignment */
219 nia = (CTBP & ~1) + off;
220 TRACE_BRANCH3 (adr, CTBP, off);
225 10,bbb,111110,RRRRR + dddddddddddddddd:VIII:::clr1
226 "clr1 <bit3>, <disp16>[r<reg1>]"
228 COMPAT_2 (OP_87C0 ());
231 rrrrr,111111,RRRRR + 0000000011100100:IX:::clr1
234 "clr1 r<reg2>, [r<reg1>]"
236 COMPAT_2 (OP_E407E0 ());
241 0000011111100000 + 0000000101000100:X:::ctret
247 PSW = (CTPSW & (CPU)->psw_mask);
252 rrrrr,111111,RRRRR + wwwww,011001,cccc,0:XI:::cmov
255 "cmov %s<cccc>, r<reg1>, r<reg2>, r<reg3>"
257 int cond = condition_met (cccc);
258 TRACE_ALU_INPUT3 (cond, GR[reg1], GR[reg2]);
259 GR[reg3] = cond ? GR[reg1] : GR[reg2];
260 TRACE_ALU_RESULT (GR[reg3]);
263 rrrrr,111111,iiiii + wwwww,011000,cccc,0:XII:::cmov
266 "cmov %s<cccc>, <imm5>, r<reg2>, r<reg3>"
268 int cond = condition_met (cccc);
269 TRACE_ALU_INPUT3 (cond, imm5, GR[reg2]);
270 GR[reg3] = cond ? imm5 : GR[reg2];
271 TRACE_ALU_RESULT (GR[reg3]);
275 rrrrr,001111,RRRRR:I:::cmp
276 "cmp r<reg1>, r<reg2>"
278 COMPAT_1 (OP_1E0 ());
281 rrrrr,010011,iiiii:II:::cmp
282 "cmp <imm5>, r<reg2>"
284 COMPAT_1 (OP_260 ());
290 0000011111100000 + 0000000101100000:X:::di
293 COMPAT_2 (OP_16007E0 ());
299 // 0000011001,iiiii,L + LLLLLLLLLLL,00000:XIII:::dispose
300 // "dispose <imm5>, <list12>"
301 0000011001,iiiii,L + LLLLLLLLLLL,RRRRR:XIII:::dispose
304 "dispose <imm5>, <list12>":RRRRR == 0
305 "dispose <imm5>, <list12>, [reg1]"
310 trace_input ("dispose", OP_PUSHPOP1, 0);
312 SP += (OP[3] & 0x3e) << 1;
314 /* Load the registers with lower number registers being retrieved
315 from higher addresses. */
317 if ((OP[3] & (1 << type1_regs[ i ])))
319 State.regs[ 20 + i ] = load_mem (SP, 4);
323 if ((OP[3] & 0x1f0000) != 0)
325 nia = State.regs[ (OP[3] >> 16) & 0x1f];
328 trace_output (OP_PUSHPOP1);
333 rrrrr,111111,RRRRR + wwwww,01011000000:XI:::div
336 "div r<reg1>, r<reg2>, r<reg3>"
338 COMPAT_2 (OP_2C007E0 ());
343 rrrrr!0,000010,RRRRR!0:I:::divh
344 "divh r<reg1>, r<reg2>"
347 signed long int op0, op1, result;
349 trace_input ("divh", OP_REG_REG, 0);
352 OP[0] = instruction_0 & 0x1f;
353 OP[1] = (instruction_0 >> 11) & 0x1f;
355 /* Compute the result. */
356 op0 = EXTEND16 (State.regs[OP[0]]);
357 op1 = State.regs[OP[1]];
359 if (op0 == -1 && op1 == 0x80000000)
362 PSW |= PSW_OV | PSW_S;
363 State.regs[OP[1]] = 0x80000000;
371 result = (signed32) op1 / op0;
374 /* Compute the condition codes. */
376 s = (result & 0x80000000);
378 /* Store the result and condition codes. */
379 State.regs[OP[1]] = result;
380 PSW &= ~(PSW_Z | PSW_S | PSW_OV);
381 PSW |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0) | (ov ? PSW_OV : 0));
384 trace_output (OP_REG_REG);
390 rrrrr,111111,RRRRR + wwwww,01010000000:XI:::divh
393 "divh r<reg1>, r<reg2>, r<reg3>"
395 COMPAT_2 (OP_28007E0 ());
400 rrrrr,111111,RRRRR + wwwww,01010000010:XI:::divhu
403 "divhu r<reg1>, r<reg2>, r<reg3>"
405 COMPAT_2 (OP_28207E0 ());
410 rrrrr,111111,RRRRR + wwwww,01011000010:XI:::divu
413 "divu r<reg1>, r<reg2>, r<reg3>"
415 COMPAT_2 (OP_2C207E0 ());
420 1000011111100000 + 0000000101100000:X:::ei
423 COMPAT_2 (OP_16087E0 ());
429 0000011111100000 + 0000000100100000:X:::halt
432 COMPAT_2 (OP_12007E0 ());
438 rrrrr,11111100000 + wwwww,01101000100:XII:::hsw
441 "hsw r<reg2>, r<reg3>"
444 TRACE_ALU_INPUT1 (GR[reg2]);
448 value |= (GR[reg2] << 16);
452 PSW &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
454 if (value == 0) PSW |= PSW_Z;
455 if (value & 0x80000000) PSW |= PSW_S;
456 if (((value & 0xffff) == 0) || (value & 0xffff0000) == 0) PSW |= PSW_CY;
458 TRACE_ALU_RESULT (GR[reg3]);
464 rrrrr!0,11110,dddddd + ddddddddddddddd,0:V:::jarl
465 "jarl <disp22>, r<reg2>"
469 TRACE_BRANCH1 (GR[reg2]);
475 00000000011,RRRRR:I:::jmp
485 0000011110,dddddd + ddddddddddddddd,0:V:::jr
495 rrrrr,111000,RRRRR + dddddddddddddddd:VII:::ld.b
496 "ld.b <disp16>[r<reg1>], r<reg2>"
498 COMPAT_2 (OP_700 ());
501 rrrrr,111001,RRRRR + ddddddddddddddd,0:VII:::ld.h
502 "ld.h <disp16>[r<reg1>], r<reg2>"
504 COMPAT_2 (OP_720 ());
507 rrrrr,111001,RRRRR + ddddddddddddddd,1:VII:::ld.w
508 "ld.w <disp16>[r<reg1>], r<reg2>"
510 COMPAT_2 (OP_10720 ());
513 rrrrr!0,11110,b,RRRRR + ddddddddddddddd,1:VII:::ld.bu
516 "ld.bu <disp16>[r<reg1>], r<reg2>"
518 COMPAT_2 (OP_10780 ());
521 rrrrr!0,111111,RRRRR + ddddddddddddddd,1:VII:::ld.hu
524 "ld.hu <disp16>[r<reg1>], r<reg2>"
526 COMPAT_2 (OP_107E0 ());
531 regID,111111,RRRRR + 0000000000100000:IX:::ldsr
532 "ldsr r<reg1>, s<regID>"
534 TRACE_ALU_INPUT1 (GR[reg1]);
536 if (&PSW == &SR[regID])
537 PSW = (GR[reg1] & (CPU)->psw_mask);
539 SR[regID] = GR[reg1];
541 TRACE_ALU_RESULT (SR[regID]);
547 rrrrr!0,000000,RRRRR:I:::mov
548 "mov r<reg1>, r<reg2>"
552 TRACE_ALU_RESULT (GR[reg2]);
556 rrrrr!0,010000,iiiii:II:::mov
557 "mov <imm5>, r<reg2>"
559 COMPAT_1 (OP_200 ());
562 00000110001,RRRRR + iiiiiiiiiiiiiiii + IIIIIIIIIIIIIIII:VI:::mov
565 "mov <imm32>, r<reg1>"
568 trace_input ("mov", OP_IMM_REG, 4);
569 State.regs[ OP[0] ] = load_mem (PC + 2, 4);
570 trace_output (OP_IMM_REG);
576 rrrrr!0,110001,RRRRR + iiiiiiiiiiiiiiii:VI:::movea
577 "movea <simm16>, r<reg1>, r<reg2>"
579 TRACE_ALU_INPUT2 (GR[reg1], simm16);
580 GR[reg2] = GR[reg1] + simm16;
581 TRACE_ALU_RESULT (GR[reg2]);
587 rrrrr!0,110010,RRRRR + iiiiiiiiiiiiiiii:VI:::movhi
588 "movhi <uimm16>, r<reg1>, r<reg2>"
590 COMPAT_2 (OP_640 ());
596 rrrrr,111111,RRRRR + wwwww,01000100000:XI:::mul
599 "mul r<reg1>, r<reg2>, r<reg3>"
601 COMPAT_2 (OP_22007E0 ());
604 rrrrr,111111,iiiii + wwwww,01001,IIII,00:XII:::mul
607 "mul <imm9>, r<reg2>, r<reg3>"
609 COMPAT_2 (OP_24007E0 ());
614 rrrrr!0,000111,RRRRR:I:::mulh
615 "mulh r<reg1>, r<reg2>"
620 rrrrr!0,010111,iiiii:II:::mulh
621 "mulh <imm5>, r<reg2>"
623 COMPAT_1 (OP_2E0 ());
629 rrrrr!0,110111,RRRRR + iiiiiiiiiiiiiiii:VI:::mulhi
630 "mulhi <uimm16>, r<reg1>, r<reg2>"
632 COMPAT_2 (OP_6E0 ());
638 rrrrr,111111,RRRRR + wwwww,01000100010:XI:::mulu
641 "mulu r<reg1>, r<reg2>, r<reg3>"
643 COMPAT_2 (OP_22207E0 ());
646 rrrrr,111111,iiiii + wwwww,01001,IIII,10:XII:::mulu
649 "mulu <imm9>, r<reg2>, r<reg3>"
651 COMPAT_2 (OP_24207E0 ());
657 0000000000000000:I:::nop
660 /* do nothing, trace nothing */
666 rrrrr,000001,RRRRR:I:::not
667 "not r<reg1>, r<reg2>"
675 01,bbb,111110,RRRRR + dddddddddddddddd:VIII:::not1
676 "not1 <bit3>, <disp16>[r<reg1>]"
678 COMPAT_2 (OP_47C0 ());
681 rrrrr,111111,RRRRR + 0000000011100010:IX:::not1
684 "not1 r<reg2>, r<reg1>"
686 COMPAT_2 (OP_E207E0 ());
692 rrrrr,001000,RRRRR:I:::or
693 "or r<reg1>, r<reg2>"
695 COMPAT_1 (OP_100 ());
701 rrrrr,110100,RRRRR + iiiiiiiiiiiiiiii:VI:::ori
702 "ori <uimm16>, r<reg1>, r<reg2>"
704 COMPAT_2 (OP_680 ());
710 0000011110,iiiii,L + LLLLLLLLLLL,00001:XIII:::prepare
713 "prepare <list12>, <imm5>"
718 trace_input ("prepare", OP_PUSHPOP1, 0);
720 /* Store the registers with lower number registers being placed at
722 for (i = 0; i < 12; i++)
723 if ((OP[3] & (1 << type1_regs[ i ])))
726 store_mem (SP, 4, State.regs[ 20 + i ]);
729 SP -= (OP[3] & 0x3e) << 1;
731 trace_output (OP_PUSHPOP1);
735 0000011110,iiiii,L + LLLLLLLLLLL,00011:XIII:::prepare00
738 "prepare <list12>, <imm5>, sp"
740 COMPAT_2 (OP_30780 ());
743 0000011110,iiiii,L + LLLLLLLLLLL,01011 + iiiiiiiiiiiiiiii:XIII:::prepare01
746 "prepare <list12>, <imm5>, <uimm16>"
748 COMPAT_2 (OP_B0780 ());
751 0000011110,iiiii,L + LLLLLLLLLLL,10011 + iiiiiiiiiiiiiiii:XIII:::prepare10
754 "prepare <list12>, <imm5>, <uimm16>"
756 COMPAT_2 (OP_130780 ());
759 0000011110,iiiii,L + LLLLLLLLLLL,11011 + iiiiiiiiiiiiiiii + dddddddddddddddd:XIII:::prepare11
762 "prepare <list12>, <imm5>, <uimm32>"
764 COMPAT_2 (OP_1B0780 ());
770 0000011111100000 + 0000000101000000:X:::reti
778 else if ((PSW & PSW_NP))
794 rrrrr,111111,RRRRR + 0000000010100000:IX:::sar
795 "sar r<reg1>, r<reg2>"
797 COMPAT_2 (OP_A007E0 ());
800 rrrrr,010101,iiiii:II:::sar
801 "sar <imm5>, r<reg2>"
803 COMPAT_1 (OP_2A0 ());
809 rrrrr,1111110,cccc + 0000001000000000:IX:::sasf
812 "sasf %s<cccc>, r<reg2>"
814 COMPAT_2 (OP_20007E0 ());
821 rrrrr!0,000110,RRRRR:I:::satadd
822 "satadd r<reg1>, r<reg2>"
827 rrrrr!0,010001,iiiii:II:::satadd
828 "satadd <imm5>, r<reg2>"
830 COMPAT_1 (OP_220 ());
836 rrrrr!0,000101,RRRRR:I:::satsub
837 "satsub r<reg1>, r<reg2>"
845 rrrrr!0,110011,RRRRR + iiiiiiiiiiiiiiii:VI:::satsubi
846 "satsubi <simm16>, r<reg1>, r<reg2>"
848 COMPAT_2 (OP_660 ());
854 rrrrr!0,000100,RRRRR:I:::satsubr
855 "satsubr r<reg1>, r<reg2>"
863 rrrrr,1111110,cccc + 0000000000000000:IX:::setf
864 "setf %s<cccc>, r<reg2>"
866 COMPAT_2 (OP_7E0 ());
872 00,bbb,111110,RRRRR + dddddddddddddddd:VIII:::set1
873 "set1 <bit3>, <disp16>[r<reg1>]"
875 COMPAT_2 (OP_7C0 ());
878 rrrrr,111111,RRRRR + 0000000011100000:IX:::set1
881 "set1 r<reg2>, [r<reg1>]"
883 COMPAT_2 (OP_E007E0 ());
889 rrrrr,111111,RRRRR + 0000000011000000:IX:::shl
890 "shl r<reg1>, r<reg2>"
892 COMPAT_2 (OP_C007E0 ());
895 rrrrr,010110,iiiii:II:::shl
896 "shl <imm5>, r<reg2>"
898 COMPAT_1 (OP_2C0 ());
904 rrrrr,111111,RRRRR + 0000000010000000:IX:::shr
905 "shr r<reg1>, r<reg2>"
907 COMPAT_2 (OP_8007E0 ());
910 rrrrr,010100,iiiii:II:::shr
911 "shr <imm5>, r<reg2>"
913 COMPAT_1 (OP_280 ());
919 rrrrr,0110,ddddddd:IV:::sld.b
920 "sld.bu <disp7>[ep], r<reg2>":(PSW & PSW_US)
921 "sld.b <disp7>[ep], r<reg2>"
923 unsigned32 addr = EP + disp7;
924 unsigned32 result = load_mem (addr, 1);
928 TRACE_LD_NAME ("sld.bu", addr, result);
932 result = EXTEND8 (result);
934 TRACE_LD (addr, result);
938 rrrrr,1000,ddddddd:IV:::sld.h
939 "sld.hu <disp8>[ep], r<reg2>":(PSW & PSW_US)
940 "sld.h <disp8>[ep], r<reg2>"
942 unsigned32 addr = EP + disp8;
943 unsigned32 result = load_mem (addr, 2);
947 TRACE_LD_NAME ("sld.hu", addr, result);
951 result = EXTEND16 (result);
953 TRACE_LD (addr, result);
957 rrrrr,1010,dddddd,0:IV:::sld.w
958 "sld.w <disp8>[ep], r<reg2>"
960 unsigned32 addr = EP + disp8;
961 unsigned32 result = load_mem (addr, 4);
963 TRACE_LD (addr, result);
966 rrrrr!0,0000110,dddd:IV:::sld.bu
969 "sld.b <disp4>[ep], r<reg2>":(PSW & PSW_US)
970 "sld.bu <disp4>[ep], r<reg2>"
972 unsigned32 addr = EP + disp4;
973 unsigned32 result = load_mem (addr, 1);
976 result = EXTEND8 (result);
978 TRACE_LD_NAME ("sld.b", addr, result);
983 TRACE_LD (addr, result);
987 rrrrr!0,0000111,dddd:IV:::sld.hu
990 "sld.h <disp5>[ep], r<reg2>":(PSW & PSW_US)
991 "sld.hu <disp5>[ep], r<reg2>"
993 unsigned32 addr = EP + disp5;
994 unsigned32 result = load_mem (addr, 2);
997 result = EXTEND16 (result);
999 TRACE_LD_NAME ("sld.h", addr, result);
1004 TRACE_LD (addr, result);
1009 rrrrr,0111,ddddddd:IV:::sst.b
1010 "sst.b r<reg2>, <disp7>[ep]"
1012 COMPAT_1 (OP_380 ());
1015 rrrrr,1001,ddddddd:IV:::sst.h
1016 "sst.h r<reg2>, <disp8>[ep]"
1018 COMPAT_1 (OP_480 ());
1021 rrrrr,1010,dddddd,1:IV:::sst.w
1022 "sst.w r<reg2>, <disp8>[ep]"
1024 COMPAT_1 (OP_501 ());
1028 rrrrr,111010,RRRRR + dddddddddddddddd:VII:::st.b
1029 "st.b r<reg2>, <disp16>[r<reg1>]"
1031 COMPAT_2 (OP_740 ());
1034 rrrrr,111011,RRRRR + ddddddddddddddd,0:VII:::st.h
1035 "st.h r<reg2>, <disp16>[r<reg1>]"
1037 COMPAT_2 (OP_760 ());
1040 rrrrr,111011,RRRRR + ddddddddddddddd,1:VII:::st.w
1041 "st.w r<reg2>, <disp16>[r<reg1>]"
1043 COMPAT_2 (OP_10760 ());
1047 rrrrr,111111,regID + 0000000001000000:IX:::stsr
1048 "stsr s<regID>, r<reg2>"
1050 TRACE_ALU_INPUT1 (SR[regID]);
1051 GR[reg2] = SR[regID];
1052 TRACE_ALU_RESULT (GR[reg2]);
1056 rrrrr,001101,RRRRR:I:::sub
1057 "sub r<reg1>, r<reg2>"
1059 COMPAT_1 (OP_1A0 ());
1063 rrrrr,001100,RRRRR:I:::subr
1064 "subr r<reg1>, r<reg2>"
1066 COMPAT_1 (OP_180 ());
1070 00000000010,RRRRR:I:::switch
1077 trace_input ("switch", OP_REG, 0);
1078 adr = (cia + 2) + (State.regs[ reg1 ] << 1);
1079 nia = (cia + 2) + (EXTEND16 (load_mem (adr, 2)) << 1);
1080 trace_output (OP_REG);
1084 00000000101,RRRRR:I:::sxb
1089 TRACE_ALU_INPUT1 (GR[reg1]);
1090 GR[reg1] = EXTEND8 (GR[reg1]);
1091 TRACE_ALU_RESULT (GR[reg1]);
1095 00000000111,RRRRR:I:::sxh
1100 TRACE_ALU_INPUT1 (GR[reg1]);
1101 GR[reg1] = EXTEND16 (GR[reg1]);
1102 TRACE_ALU_RESULT (GR[reg1]);
1106 00000111111,iiiii + 0000000100000000:X:::trap
1109 COMPAT_2 (OP_10007E0 ());
1113 rrrrr,001011,RRRRR:I:::tst
1114 "tst r<reg1>, r<reg2>"
1116 COMPAT_1 (OP_160 ());
1120 11,bbb,111110,RRRRR + dddddddddddddddd:VIII:::tst1
1121 "tst1 <bit3>, <disp16>[r<reg1>]"
1123 COMPAT_2 (OP_C7C0 ());
1126 rrrrr,111111,RRRRR + 0000000011100110:IX:::tst1
1129 "tst1 r<reg2>, [r<reg1>]"
1131 COMPAT_2 (OP_E607E0 ());
1135 rrrrr,001001,RRRRR:I:::xor
1136 "xor r<reg1>, r<reg2>"
1138 COMPAT_1 (OP_120 ());
1142 rrrrr,110101,RRRRR + iiiiiiiiiiiiiiii:VI:::xori
1143 "xori <uimm16>, r<reg1>, r<reg2>"
1145 COMPAT_2 (OP_6A0 ());
1149 00000000100,RRRRR:I:::zxb
1154 TRACE_ALU_INPUT1 (GR[reg1]);
1155 GR[reg1] = GR[reg1] & 0xff;
1156 TRACE_ALU_RESULT (GR[reg1]);
1160 00000000110,RRRRR:I:::zxh
1165 TRACE_ALU_INPUT1 (GR[reg1]);
1166 GR[reg1] = GR[reg1] & 0xffff;
1167 TRACE_ALU_RESULT (GR[reg1]);
1170 // Right field must be zero so that it doesn't clash with DIVH
1171 // Left field must be non-zero so that it doesn't clash with SWITCH
1172 11111,000010,00000:I:::break
1176 sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
1179 11111,000010,00000:I:::dbtrap
1185 PSW = PSW | (PSW_NP | PSW_EP | PSW_ID);
1191 // New breakpoint: 0x7E0 0x7E0
1192 00000,111111,00000 + 00000,11111,100000:X:::ilgop
1194 sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
1197 // Return from debug trap: 0x146007e0
1198 0000011111100000 + 0000000101000110:X:::dbret
1204 TRACE_BRANCH1 (PSW);