diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/mn10300/ChangeLog | 2 | ||||
-rw-r--r-- | sim/mn10300/mn10300.igen | 1809 |
2 files changed, 1365 insertions, 446 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 90d1f87..22ab4cd 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,6 +1,8 @@ start-sanitize-am33 Mon Jul 6 15:39:22 1998 Jeffrey A Law (law@cygnus.com) + * mn10300.igen: Add am33 support. + * Makefile.in: Use multi-sim to support both a mn10300 and am33 simulator. diff --git a/sim/mn10300/mn10300.igen b/sim/mn10300/mn10300.igen index 2e16d27..d16af48 100644 --- a/sim/mn10300/mn10300.igen +++ b/sim/mn10300/mn10300.igen @@ -1,7 +1,9 @@ +// -*- C -*- :option:::insn-bit-size:8 :option:::insn-specifying-widths:true :option:::hi-bit-nr:7 :model:::mn10300:mn10300: +:model:::am33:am33: // What do we do with an illegal instruction? :internal::::illegal: @@ -12,24 +14,30 @@ } // 1000 DnDn imm8....; mov imm8,Dn (imm8 is sign extended) +4.0x8,2.DM1,2.DN0=DM1+IMM8:S0i:::mov +"mov" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // OP_8000 (); + signed32 immed = EXTEND8 (IMM8); + State.regs[REG_D0+DN0] = immed; + PC = cia; +} + // 1000 DmDn; mov Dm,Dn (Dm != Dn, see above when Dm == Dn) -4.0x8,2.DM1,2.DN0:S0:::mov +4.0x8,2.DM1,2.DN0!DM1:S0:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { PC = cia; - if ( DM1 == DN0 ) - { - // OP_8000 (); - signed32 immed = EXTEND8 (IMEM8_IMMED (cia, 1)); - nia = cia + 2; - State.regs[REG_D0+DN0] = immed; - } - else - { - // OP_80 (); - State.regs[REG_D0+DN0] = State.regs[REG_D0+DM1]; - } + // OP_80 (); + State.regs[REG_D0+DN0] = State.regs[REG_D0+DM1]; } @@ -37,6 +45,9 @@ 8.0xf1+1110,2.DM1,2.AN0:D0:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F1E0 (); PC = cia; @@ -48,6 +59,9 @@ 8.0xf1+1101,2.AM1,2.DN0:D0a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F1D0 (); PC = cia; @@ -56,24 +70,30 @@ // 1001 AnAn imm8....; mov imm8,An (imm8 is zero-extended) +4.0x9,2.AM1,2.AN0=AM1+IMM8:S0ai:::mov +"mov" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + PC = cia; + // OP_9000 (); + State.regs[REG_A0+AN0] = IMM8; +} + + // 1001 AmAn; mov Am,An (Am != An, save above when Am == An) -4.0x9,2.AM1,2.AN0:S0a:::mov +4.0x9,2.AM1,2.AN0!AM1:S0a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { PC = cia; - if ( AM1 == AN0 ) - { - // OP_9000 (); - unsigned long immed = IMEM8_IMMED (cia, 1); - nia = cia + 2; - State.regs[REG_A0+AN0] = immed; - } - else - { - // OP_90 (); - State.regs[REG_A0+AN0] = State.regs[REG_A0+AM1]; - } + // OP_90 (); + State.regs[REG_A0+AN0] = State.regs[REG_A0+AM1]; } @@ -81,6 +101,9 @@ 4.0x3,11,2.AN0:S0b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_3C (); PC = cia; @@ -92,6 +115,9 @@ 8.0xf2+4.0xf,2.AM1,00:D0b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2F0 (); PC = cia; @@ -103,6 +129,9 @@ 8.0xf2+4.0xe,01,2.DN0:D0c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2E4 (); PC = cia; @@ -114,6 +143,9 @@ 8.0xf2+4.0xf,2.DM1,11:D0d:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2F3 (); PC = cia; @@ -125,6 +157,9 @@ 8.0xf2+4.0xe,00,2.DN0:D0e:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2E0 (); PC = cia; @@ -136,6 +171,9 @@ 8.0xf2+4.0xf,2.DM1,10:D0f:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2F2 (); PC = cia; @@ -147,6 +185,9 @@ 4.0x7,2.DN1,2.AM0:S0c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_70 (); PC = cia; @@ -158,6 +199,9 @@ 8.0xf8+4.0x0,2.DN1,2.AM0+8.D8:D1:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F80000 (); PC = cia; @@ -170,6 +214,9 @@ 8.0xfa+4.0x0,2.DN1,2.AM0+8.D16A+8.D16B:D2:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA000000 (); PC = cia; @@ -182,6 +229,9 @@ 8.0xfc+4.0x0,2.DN1,2.AM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC000000 (); PC = cia; @@ -195,6 +245,9 @@ 4.0x5,10,2.DN0+8.D8:S1:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_5800 (); PC = cia; @@ -206,6 +259,9 @@ 8.0xfa+4.0xb,01,2.DN0+8.IMM16A+8.IMM16B:D2a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAB40000 (); PC = cia; @@ -218,6 +274,9 @@ 8.0xfc+4.0xb,01,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCB40000 (); PC = cia; @@ -227,9 +286,12 @@ // 1111 0011 00Dn DiAm; mov (Di,Am),Dn -8.0xf3+00,2.DI,2.AM0,2.DN2:D0g:::mov +8.0xf3+00,2.DN2,2.DI,2.AM0:D0g:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F300 (); PC = cia; @@ -242,6 +304,9 @@ 4.0x3,00,2.DN0+8.IMM16A+8.IMM16B:S2:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_300000 (); PC = cia; @@ -252,6 +317,9 @@ 8.0xfc+4.0xa,01,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCA40000 (); PC = cia; @@ -263,6 +331,9 @@ 8.0xf0+4.0x0,2.AN1,2.AM0:D0h:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F000 (); PC = cia; @@ -274,6 +345,9 @@ 8.0xf8+4.0x2,2.AN1,2.AM0+8.D8:D1a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F82000 (); PC = cia; @@ -286,6 +360,9 @@ 8.0xfa+4.0x2,2.AN1,2.AM0+8.D16A+8.D16B:D2b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA200000 (); PC = cia; @@ -299,6 +376,9 @@ 8.0xfc+4.0x2,2.AN1,2.AM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC200000 (); PC = cia; @@ -312,6 +392,9 @@ 4.0x5,11,2.AN0+8.D8:S1a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_5C00 (); PC = cia; @@ -324,6 +407,9 @@ 8.0xfa+4.0xb,00,2.AN0+8.IMM16A+8.IMM16B:D2c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAB00000 (); PC = cia; @@ -336,6 +422,9 @@ 8.0xfc+4.0xb,00,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4d:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCB00000 (); PC = cia; @@ -349,6 +438,9 @@ 8.0xf3+10,2.AN2,2.DI,2.AM0:D0i:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F380 (); PC = cia; @@ -362,6 +454,9 @@ 8.0xfa+4.0xa,00,2.AN0+8.IMM16A+8.IMM16B:D2d:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAA00000 (); PC = cia; @@ -373,6 +468,9 @@ 8.0xfc+4.0xa,00,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4e:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCA00000 (); PC = cia; @@ -385,6 +483,9 @@ 8.0xf8+4.0xf,00,2.AM0+8.D8:D1b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8F000 (); PC = cia; @@ -397,6 +498,9 @@ 4.0x6,2.DM1,2.AN0:S0d:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_60 (); PC = cia; @@ -408,6 +512,9 @@ 8.0xf8+4.0x1,2.DM1,2.AN0+8.D8:D1c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F81000 (); PC = cia; @@ -420,6 +527,9 @@ 8.0xfa+4.0x1,2.DM1,2.AN0+8.D16A+8.D16B:D2e:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA100000 (); PC = cia; @@ -432,6 +542,9 @@ 8.0xfc+4.0x1,2.DM1,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4f:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC100000 (); PC = cia; @@ -445,6 +558,9 @@ 4.0x4,2.DM1,10+8.D8:S1b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_4200 (); PC = cia; @@ -456,6 +572,9 @@ 8.0xfa+4.0x9,2.DM1,01+8.IMM16A+8.IMM16B:D2f:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA910000 (); PC = cia; @@ -468,6 +587,9 @@ 8.0xfc+4.0x9,2.DM1,01+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4g:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC910000 (); PC = cia; @@ -480,6 +602,9 @@ 8.0xf3+01,2.DM2,2.DI,2.AN0:D0j:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F340 (); PC = cia; @@ -492,6 +617,9 @@ 4.0x0,2.DM1,01+8.IMM16A+8.IMM16B:S2a:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_10000 (); PC = cia; @@ -503,6 +631,9 @@ 8.0xfc+4.0x8,2.DM1,01+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4h:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC810000 (); PC = cia; @@ -515,6 +646,9 @@ 8.0xf0+4.0x1,2.AM1,2.AN0:D0k:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F010 (); PC = cia; @@ -526,6 +660,9 @@ 8.0xf8+4.0x3,2.AM1,2.AN0+8.D8:D1d:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F83000 (); PC = cia; @@ -538,6 +675,9 @@ 8.0xfa+4.0x3,2.AM1,2.AN0+8.D16A+8.D16B:D2g:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA300000 (); PC = cia; @@ -550,6 +690,9 @@ 8.0xfc+4.0x3,2.AM1,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4i:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC300000 (); PC = cia; @@ -563,6 +706,9 @@ 4.0x4,2.AM1,11+8.D8:S1c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_4300 (); PC = cia; @@ -574,6 +720,9 @@ 8.0xfa+4.0x9,2.AM1,00+8.IMM16A+8.IMM16B:D2h:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA900000 (); PC = cia; @@ -586,6 +735,9 @@ 8.0xfc+4.0x9,2.AM1,00+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4j:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC900000 (); PC = cia; @@ -598,6 +750,9 @@ 8.0xf3+11,2.AM2,2.DI,2.AN0:D0l:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F3C0 (); PC = cia; @@ -610,6 +765,9 @@ 8.0xfa+4.0x8,2.AM1,00+8.IMM16A+8.IMM16B:D2i:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA800000 (); PC = cia; @@ -622,6 +780,9 @@ 8.0xfc+4.0x8,2.AM1,00+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4k:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC800000 (); PC = cia; @@ -634,6 +795,9 @@ 8.0xf8+4.0xf,01,2.AN0+8.D8:D1e:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8F400 (); PC = cia; @@ -646,6 +810,9 @@ 4.0x2,11,2.DN0+8.IMM16A+8.IMM16B:S2b:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_2C0000 (); unsigned long value; @@ -660,6 +827,9 @@ 8.0xfc+4.0xc,11,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4l:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCCC0000 (); unsigned long value; @@ -674,6 +844,9 @@ 4.0x2,01,2.AN0+8.IMM16A+8.IMM16B:S2c:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_240000 (); unsigned long value; @@ -688,6 +861,9 @@ 8.0xfc+4.0xd,11,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4m:::mov "mov" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCDC0000 (); PC = cia; @@ -699,6 +875,9 @@ 8.0xf0+4.0x4,2.DN1,2.AM0:D0:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F040 (); PC = cia; @@ -711,6 +890,9 @@ 8.0xf8+4.0x4,2.DN1,2.AM0+8.D8:D1f:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F84000 (); PC = cia; @@ -723,6 +905,9 @@ 8.0xfa+4.0x4,2.DN1,2.AM0+8.D16A+8.D16B:D2:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA400000 (); PC = cia; @@ -736,6 +921,9 @@ 8.0xfc+4.0x4,2.DN1,2.AM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC400000 (); PC = cia; @@ -749,6 +937,9 @@ 8.0xf8+4.0xb,10,2.DN0+8.D8:D1a:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8B800 (); PC = cia; @@ -761,6 +952,9 @@ 8.0xfa+4.0xb,10,2.DN0+8.IMM16A+8.IMM16B:D2a:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAB80000 (); PC = cia; @@ -774,6 +968,9 @@ 8.0xfc+4.0xb,10,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCB80000 (); PC = cia; @@ -787,6 +984,9 @@ 8.0xf4+00,2.DN2,2.DI,2.AM0:D0a:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F400 (); PC = cia; @@ -800,6 +1000,9 @@ 4.0x3,01,2.DN0+8.IMM16A+8.IMM16B:S2:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_340000 (); PC = cia; @@ -811,6 +1014,9 @@ 8.0xfc+4.0xa,10,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4b:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCA80000 (); PC = cia; @@ -823,6 +1029,9 @@ 8.0xf0+4.0x5,2.DM1,2.AN0:D0b:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F050 (); PC = cia; @@ -834,6 +1043,9 @@ 8.0xf8+4.0x5,2.DM1,2.AN0+8.D8:D1b:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F85000 (); PC = cia; @@ -846,6 +1058,9 @@ 8.0xfa+4.0x5,2.DM1,2.AN0+8.D16A+8.D16B:D2b:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA500000 (); PC = cia; @@ -858,6 +1073,9 @@ 8.0xfc+4.0x5,2.DM1,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4c:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC500000 (); PC = cia; @@ -871,6 +1089,9 @@ 8.0xf8+4.0x9,2.DM1,10+8.D8:D1c:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F89200 (); PC = cia; @@ -882,6 +1103,9 @@ 8.0xfa+4.0x9,2.DM1,10+8.IMM16A+8.IMM16B:D2c:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA920000 (); PC = cia; @@ -894,6 +1118,9 @@ 8.0xfc+4.0x9,2.DM1,10+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4d:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC920000 (); PC = cia; @@ -906,6 +1133,9 @@ 8.0xf4+01,2.DM2,2.DI,2.AN0:D0c:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F440 (); PC = cia; @@ -918,6 +1148,9 @@ 4.0x0,2.DM1,10+8.IMM16A+8.IMM16B:S2a:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_20000 (); PC = cia; @@ -930,6 +1163,9 @@ 8.0xfc+4.0x8,2.DM1,10+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4e:::movbu "movbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC820000 (); PC = cia; @@ -942,6 +1178,9 @@ 8.0xf0+4.0x6,2.DN1,2.AM0:D0:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F060 (); PC = cia; @@ -954,6 +1193,9 @@ 8.0xf8+4.0x6,2.DN1,2.AM0+8.D8:D1d:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F86000 (); PC = cia; @@ -966,6 +1208,9 @@ 8.0xfa+4.0x6,2.DN1,2.AM0+8.D16A+8.D16B:D2:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA600000 (); PC = cia; @@ -979,6 +1224,9 @@ 8.0xfc+4.0x6,2.DN1,2.AM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC600000 (); PC = cia; @@ -992,6 +1240,9 @@ 8.0xf8+4.0xb,11,2.DN0+8.D8:D1a:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8BC00 (); PC = cia; @@ -1004,6 +1255,9 @@ 8.0xfa+4.0xb,11,2.DN0+8.IMM16A+8.IMM16B:D2a:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FABC0000 (); PC = cia; @@ -1016,6 +1270,9 @@ 8.0xfc+4.0xb,11,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCBC0000 (); PC = cia; @@ -1028,6 +1285,9 @@ 8.0xf4+10,2.DN2,2.DI,2.AM0:D0a:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F480 (); PC = cia; @@ -1040,6 +1300,9 @@ 4.0x3,10,2.DN0+8.IMM16A+8.IMM16B:S2:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_380000 (); PC = cia; @@ -1051,6 +1314,9 @@ 8.0xfc+4.0xa,11,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4b:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCAC0000 (); PC = cia; @@ -1063,6 +1329,9 @@ 8.0xf0+4.0x7,2.DM1,2.AN0:D0b:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F070 (); PC = cia; @@ -1075,6 +1344,9 @@ 8.0xf8+4.0x7,2.DM1,2.AN0+8.D8:D1b:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F87000 (); PC = cia; @@ -1087,6 +1359,9 @@ 8.0xfa+4.0x7,2.DM1,2.AN0+8.D16A+8.D16B:D2b:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA700000 (); PC = cia; @@ -1099,6 +1374,9 @@ 8.0xfc+4.0x7,2.DM1,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4c:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC700000 (); PC = cia; @@ -1112,6 +1390,9 @@ 8.0xf8+4.0x9,2.DM1,11+8.D8:D1c:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F89300 (); PC = cia; @@ -1124,6 +1405,9 @@ 8.0xfa+4.0x9,2.DM1,11+8.IMM16A+8.IMM16B:D2c:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FA930000 (); PC = cia; @@ -1136,6 +1420,9 @@ 8.0xfc+4.0x9,2.DM1,11+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4d:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC930000 (); PC = cia; @@ -1148,6 +1435,9 @@ 8.0xf4+11,2.DM2,2.DI,2.AN0:D0c:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F4C0 (); PC = cia; @@ -1160,6 +1450,9 @@ 4.0x0,2.DM1,11+8.IMM16A+8.IMM16B:S2a:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_30000 (); PC = cia; @@ -1171,6 +1464,9 @@ 8.0xfc+4.0x8,2.DM1,11+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4e:::movhu "movhu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FC830000 (); PC = cia; @@ -1183,6 +1479,9 @@ 8.0xf2+4.0xd,00,2.DN0:D0:::ext "ext" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2D0 (); PC = cia; @@ -1197,6 +1496,9 @@ 4.0x1,00,2.DN0:S0:::extb "extb" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_10 (); PC = cia; @@ -1208,6 +1510,9 @@ 4.0x1,01,2.DN0:S0:::extbu "extbu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_14 (); PC = cia; @@ -1219,6 +1524,9 @@ 4.0x1,10,2.DN0:S0:::exth "exth" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_18 (); PC = cia; @@ -1230,6 +1538,9 @@ 4.0x1,11,2.DN0:S0:::exthu "exthu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_1C (); PC = cia; @@ -1237,130 +1548,13 @@ } -// 1100 1110 regs....; movm (SP),regs -8.0xce+8.REGS:S1:::movm -"movm" -*mn10300 -{ - // OP_CE00 (); - unsigned long sp = State.regs[REG_SP]; - unsigned long mask; - - PC = cia; - mask = REGS; - - if (mask & 0x8) - { - sp += 4; - State.regs[REG_LAR] = load_word (sp); - sp += 4; - State.regs[REG_LIR] = load_word (sp); - sp += 4; - State.regs[REG_MDR] = load_word (sp); - sp += 4; - State.regs[REG_A0 + 1] = load_word (sp); - sp += 4; - State.regs[REG_A0] = load_word (sp); - sp += 4; - State.regs[REG_D0 + 1] = load_word (sp); - sp += 4; - State.regs[REG_D0] = load_word (sp); - sp += 4; - } - - if (mask & 0x10) - { - State.regs[REG_A0 + 3] = load_word (sp); - sp += 4; - } - - if (mask & 0x20) - { - State.regs[REG_A0 + 2] = load_word (sp); - sp += 4; - } - - if (mask & 0x40) - { - State.regs[REG_D0 + 3] = load_word (sp); - sp += 4; - } - - if (mask & 0x80) - { - State.regs[REG_D0 + 2] = load_word (sp); - sp += 4; - } - - /* And make sure to update the stack pointer. */ - State.regs[REG_SP] = sp; -} - - -// 1100 1111 regs....; movm regs,(SP) -8.0xcf+8.REGS:S1a:::movm -"movm" -*mn10300 -{ - // OP_CF00 (); - unsigned long sp = State.regs[REG_SP]; - unsigned long mask; - - PC = cia; - mask = REGS; - - if (mask & 0x80) - { - sp -= 4; - store_word (sp, State.regs[REG_D0 + 2]); - } - - if (mask & 0x40) - { - sp -= 4; - store_word (sp, State.regs[REG_D0 + 3]); - } - - if (mask & 0x20) - { - sp -= 4; - store_word (sp, State.regs[REG_A0 + 2]); - } - - if (mask & 0x10) - { - sp -= 4; - store_word (sp, State.regs[REG_A0 + 3]); - } - - if (mask & 0x8) - { - sp -= 4; - store_word (sp, State.regs[REG_D0]); - sp -= 4; - store_word (sp, State.regs[REG_D0 + 1]); - sp -= 4; - store_word (sp, State.regs[REG_A0]); - sp -= 4; - store_word (sp, State.regs[REG_A0 + 1]); - sp -= 4; - store_word (sp, State.regs[REG_MDR]); - sp -= 4; - store_word (sp, State.regs[REG_LIR]); - sp -= 4; - store_word (sp, State.regs[REG_LAR]); - sp -= 4; - } - - /* And make sure to update the stack pointer. */ - State.regs[REG_SP] = sp; -} - - // 0000 Dn00; clr Dn 4.0x0,2.DN1,00:S0:::clr "clr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_0 (); PC = cia; @@ -1375,6 +1569,9 @@ 4.0xe,2.DM1,2.DN0:S0:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_E0 (); PC = cia; @@ -1385,6 +1582,9 @@ 8.0xf1+4.0x6,2.DM1,2.AN0:D0:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F160 (); PC = cia; @@ -1396,6 +1596,9 @@ 8.0xf1+4.0x5,2.AM1,2.DN0:D0a:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F150 (); PC = cia; @@ -1407,6 +1610,9 @@ 8.0xf1+4.0x7,2.AM1,2.AN0:D0b:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F170 (); PC = cia; @@ -1418,6 +1624,9 @@ 4.0x2,10,2.DN0+8.IMM8:S1:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_2800 (); PC = cia; @@ -1429,6 +1638,9 @@ 8.0xfa+4.0xc,00,2.DN0+8.IMM16A+8.IMM16B:D2:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAC00000 (); PC = cia; @@ -1440,6 +1652,9 @@ 8.0xfc+4.0xc,00,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCC00000 (); PC = cia; @@ -1451,6 +1666,9 @@ 4.0x2,00,2.AN0+8.IMM8:S1a:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_2000 (); PC = cia; @@ -1462,6 +1680,9 @@ 8.0xfa+4.0xd,00,2.AN0+8.IMM16A+8.IMM16B:D2a:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAD00000 (); PC = cia; @@ -1473,6 +1694,9 @@ 8.0xfc+4.0xd,00,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCD00000 (); PC = cia; @@ -1484,6 +1708,9 @@ 8.0xf8+8.0xfe+8.IMM8:D1:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8FE00 (); unsigned long imm; @@ -1499,6 +1726,9 @@ 8.0xfa+8.0xfe+8.IMM16A+8.IMM16B:D2b:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAFE0000 (); unsigned long imm; @@ -1514,6 +1744,9 @@ 8.0xfc+8.0xfe+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4b:::add "add" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCFE0000 (); unsigned long imm; @@ -1529,6 +1762,9 @@ 8.0xf1+4.0x4,2.DM1,2.DN0:D0:::addc "addc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F140 (); int z, c, n, v; @@ -1556,6 +1792,9 @@ 8.0xf1+4.0x0,2.DM1,2.DN0:D0:::sub "sub" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F100 (); PC = cia; @@ -1566,6 +1805,9 @@ 8.0xf1+4.0x2,2.DM1,2.AN0:D0a:::sub "sub" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F120 (); PC = cia; @@ -1577,6 +1819,9 @@ 8.0xf1+4.0x1,2.AM1,2.DN0:D0b:::sub "sub" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F110 (); PC = cia; @@ -1588,6 +1833,9 @@ 8.0xf1+4.0x3,2.AM1,2.AN0:D0c:::sub "sub" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F130 (); PC = cia; @@ -1599,6 +1847,9 @@ 8.0xfc+4.0xc,01,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::sub "sub" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCC40000 (); PC = cia; @@ -1610,6 +1861,9 @@ 8.0xfc+4.0xd,01,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::sub "sub" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCD40000 (); PC = cia; @@ -1621,6 +1875,9 @@ 8.0xf1+4.0x8,2.DM1,2.DN0:D0:::subc "subc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F180 (); int z, c, n, v; @@ -1648,6 +1905,9 @@ 8.0xf2+4.0x4,2.DM1,2.DN0:D0:::mul "mul" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F240 (); unsigned long long temp; @@ -1669,6 +1929,9 @@ 8.0xf2+4.0x5,2.DM1,2.DN0:D0:::mulu "mulu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F250 (); unsigned long long temp; @@ -1690,6 +1953,9 @@ 8.0xf2+4.0x6,2.DM1,2.DN0:D0:::div "div" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F260 (); long long temp; @@ -1713,6 +1979,9 @@ 8.0xf2+4.0x7,2.DM1,2.DN0:D0:::divu "divu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F270 (); unsigned long long temp; @@ -1736,6 +2005,9 @@ 4.0x4,2.DN1,00:S0:::inc "inc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_40 (); unsigned int imm; @@ -1750,6 +2022,9 @@ 4.0x4,2.AN1,01:S0a:::inc "inc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_41 (); PC = cia; @@ -1761,6 +2036,9 @@ 4.0x5,00,2.AN0:S0:::inc4 "inc4" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_50 (); PC = cia; @@ -1769,24 +2047,30 @@ // 1010 DnDn imm8....; cmp imm8,Dn (imm8 is sign-extended.) +4.0xa,2.DM1,2.DN0=DM1+IMM8:S0i:::cmp +"cmp" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + PC = cia; + // OP_A000 (); + genericCmp(EXTEND8 (IMM8), State.regs[REG_D0 + DN0]); +} + + // 1010 DmDn; cmp Dm,Dn (Dm != Dn, see above when Dm == Dn) -4.0xa,2.DM1,2.DN0:S0:::cmp +4.0xa,2.DM1,2.DN0!DM1:S0:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { PC = cia; - if ( DM1 == DN0 ) - { - signed32 immed = EXTEND8 (IMEM8_IMMED (cia, 1)); - nia = cia + 2; - // OP_A000 (); - genericCmp(immed, State.regs[REG_D0 + DN0]); - } - else - { - // OP_A0 (); - genericCmp(State.regs[REG_D0 + DM1], State.regs[REG_D0 + DN0]); - } + // OP_A0 (); + genericCmp(State.regs[REG_D0 + DM1], State.regs[REG_D0 + DN0]); } @@ -1794,6 +2078,9 @@ 8.0xf1+4.0xa,2.DM1,2.AN0:D0:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F1A0 (); PC = cia; @@ -1805,6 +2092,9 @@ 8.0xf1+4.0x9,2.AM1,2.DN0:D0a:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F190 (); PC = cia; @@ -1813,24 +2103,31 @@ // 1011 AnAn imm8....; cmp imm8,An (imm8 is zero-extended.) +4.0xb,2.AM1,2.AN0=AM1+IMM8:S0ai:::cmp +"cmp" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + PC = cia; + // op_B000 (); + genericCmp(IMM8, + State.regs[REG_A0 + AN0]); +} + + // 1011 AmAn; cmp Am,An (Dm != Dn, see above when Dm == Dn) -4.0xb,2.AM1,2.AN0:S0a:::cmp +4.0xb,2.AM1,2.AN0!AM1:S0a:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { PC = cia; - if ( AM1 == AN0 ) - { - // op_B000 (); - genericCmp(IMEM8_IMMED (cia, 1), - State.regs[REG_A0 + AN0]); - nia = cia + 2; - } - else - { - // OP_B0 (); - genericCmp(State.regs[REG_A0 + AM1], State.regs[REG_A0 + AN0]); - } + // OP_B0 (); + genericCmp(State.regs[REG_A0 + AM1], State.regs[REG_A0 + AN0]); } @@ -1838,6 +2135,9 @@ 8.0xfa+4.0xc,10,2.DN0+8.IMM16A+8.IMM16B:D2:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAC80000 (); PC = cia; @@ -1850,6 +2150,9 @@ 8.0xfc+4.0xc,10,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCC80000 (); PC = cia; @@ -1862,6 +2165,9 @@ 8.0xfa+4.0xd,10,2.AN0+8.IMM16A+8.IMM16B:D2a:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAD80000 (); PC = cia; @@ -1874,6 +2180,9 @@ 8.0xfc+4.0xd,10,2.AN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::cmp "cmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCD80000 (); PC = cia; @@ -1886,6 +2195,9 @@ 8.0xf2+4.0x0,2.DM1,2.DN0:D0:::and "and" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F200 (); int n, z; @@ -1903,6 +2215,9 @@ 8.0xf8+4.0xe,00,2.DN0+8.IMM8:D1:::and "and" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8E000 (); int n, z; @@ -1920,6 +2235,9 @@ 8.0xfa+4.0xe,00,2.DN0+8.IMM16A+8.IMM16B:D2:::and "and" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAE00000 (); int n, z; @@ -1937,6 +2255,9 @@ 8.0xfc+4.0xe,00,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::and "and" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCE00000 (); int n, z; @@ -1955,6 +2276,9 @@ 8.0xfa+8.0xfc+8.IMM16A+8.IMM16B:D2a:::and "and" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAFC0000 (); PC = cia; @@ -1967,6 +2291,9 @@ 8.0xf2+4.0x1,2.DM1,2.DN0:D0:::or "or" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F210 (); PC = cia; @@ -1978,6 +2305,9 @@ 8.0xf8+4.0xe,01,2.DN0+8.IMM8:D1:::or "or" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8E400 (); PC = cia; @@ -1989,6 +2319,9 @@ 8.0xfa+4.0xe,01,2.DN0+8.IMM16A+8.IMM16B:D2:::or "or" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAE40000 (); PC = cia; @@ -2000,6 +2333,9 @@ 8.0xfc+4.0xe,01,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::or "or" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCE40000 (); PC = cia; @@ -2011,6 +2347,9 @@ 8.0xfa+8.0xfd+8.IMM16A+8.IMM16B:D2a:::or "or" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAFD0000 (); PC = cia; @@ -2022,6 +2361,9 @@ 8.0xf2+4.0x2,2.DM1,2.DN0:D0:::xor "xor" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F220 (); PC = cia; @@ -2033,6 +2375,9 @@ 8.0xfa+4.0xe,10,2.DN0+8.IMM16A+8.IMM16B:D2:::xor "xor" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAE80000 (); PC = cia; @@ -2044,6 +2389,9 @@ 8.0xfc+4.0xe,10,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::xor "xor" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCE80000 (); PC = cia; @@ -2055,6 +2403,9 @@ 8.0xf2+4.0x3,00,2.DN0:D0:::not "not" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F230 (); int n, z; @@ -2072,6 +2423,9 @@ 8.0xf8+4.0xe,11,2.DN0+8.IMM8:D1:::btst "btst" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8EC00 (); PC = cia; @@ -2083,6 +2437,9 @@ 8.0xfa+4.0xe,11,2.DN0+8.IMM16A+8.IMM16B:D2:::btst "btst" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAEC0000 (); PC = cia; @@ -2094,6 +2451,9 @@ 8.0xfc+4.0xe,11,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::btst "btst" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCEC0000 (); PC = cia; @@ -2106,6 +2466,9 @@ 8.0xfe+8.0x02+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D+8.IMM8:D5:::btst "btst" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FE020000 (); PC = cia; @@ -2119,6 +2482,9 @@ 8.0xfa+4.0xf,10,2.AN0+8.D8+8.IMM8:D2a:::btst "btst" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAF80000 (); PC = cia; @@ -2131,6 +2497,9 @@ 8.0xf0+4.8,2.DM1,2.AN0:D0:::bset "bset" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F080 (); unsigned long temp; @@ -2151,6 +2520,9 @@ 8.0xfe+8.0x00+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D+8.IMM8:D5:::bset "bset" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FE000000 (); unsigned long temp; @@ -2171,6 +2543,9 @@ 8.0xfa+4.0xf,00,2.AN0+8.D8+8.IMM8:D2:::bset "bset" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAF00000 (); unsigned long temp; @@ -2190,6 +2565,9 @@ 8.0xf0+4.0x9,2.DM1,2.AN0:D0:::bclr "bclr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F090 (); unsigned long temp; @@ -2210,6 +2588,9 @@ 8.0xfe+8.0x01+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D+8.IMM8:D5:::bclr "bclr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FE010000 (); unsigned long temp; @@ -2230,6 +2611,9 @@ 8.0xfa+4.0xf,01,2.AN0+8.D8+8.IMM8:D2:::bclr "bclr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAF40000 (); unsigned long temp; @@ -2249,6 +2633,9 @@ 8.0xf2+4.0xb,2.DM1,2.DN0:D0:::asr "asr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2B0 (); long temp; @@ -2270,6 +2657,9 @@ 8.0xf8+4.0xc,10,2.DN0+8.IMM8:D1:::asr "asr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8C800 (); long temp; @@ -2291,6 +2681,9 @@ 8.0xf2+4.0xa,2.DM1,2.DN0:D0:::lsr "lsr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F2A0 (); int z, n, c; @@ -2310,6 +2703,9 @@ 8.0xf8+4.0xc,01,2.DN0+8.IMM8:D1:::lsr "lsr" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8C400 (); int z, n, c; @@ -2328,6 +2724,9 @@ 8.0xf2+4.0x9,2.DM1,2.DN0:D0:::asl "asl" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F290 (); int n, z; @@ -2346,6 +2745,9 @@ 8.0xf8+4.0xc,00,2.DN0+8.IMM8:D1:::asl "asl" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8C000 (); int n, z; @@ -2363,6 +2765,9 @@ 4.0x5,01,2.DN0:S0:::asl2 "asl2" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_54 (); int n, z; @@ -2380,6 +2785,9 @@ 8.0xf2+4.0x8,01,2.DN0:D0:::ror "ror" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F284 (); unsigned long value; @@ -2403,6 +2811,9 @@ 8.0xf2+4.0x8,00,2.DN0:D0:::rol "rol" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // handle ror above, too. // OP_F280 (); @@ -2427,6 +2838,9 @@ 8.0xc8+8.D8:S1:::beq "beq" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C800 (); PC = cia; @@ -2442,6 +2856,9 @@ 8.0xc9+8.D8:S1:::bne "bne" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C900 (); PC = cia; @@ -2457,6 +2874,9 @@ 8.0xc1+8.D8:S1:::bgt "bgt" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C100 (); PC = cia; @@ -2473,6 +2893,9 @@ 8.0xc2+8.D8:S1:::bge "bge" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C200 (); PC = cia; @@ -2488,6 +2911,9 @@ 8.0xc3+8.D8:S1:::ble "ble" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C300 (); PC = cia; @@ -2504,6 +2930,9 @@ 8.0xc0+8.D8:S1:::blt "blt" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C000 (); PC = cia; @@ -2519,6 +2948,9 @@ 8.0xc5+8.D8:S1:::bhi "bhi" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C500 (); PC = cia; @@ -2534,6 +2966,9 @@ 8.0xc6+8.D8:S1:::bcc "bcc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C600 (); PC = cia; @@ -2549,6 +2984,9 @@ 8.0xc7+8.D8:S1:::bls "bls" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C700 (); PC = cia; @@ -2564,6 +3002,9 @@ 8.0xc4+8.D8:S1:::bcs "bcs" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_C400 (); PC = cia; @@ -2579,6 +3020,9 @@ 8.0xf8+8.0xe8+8.D8:D1:::bvc "bvc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8E800 (); PC = cia; @@ -2594,6 +3038,9 @@ 8.0xf8+8.0xe9+8.D8:D1:::bvs "bvs" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8E900 (); PC = cia; @@ -2609,6 +3056,9 @@ 8.0xf8+8.0xea+8.D8:D1:::bnc "bnc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8EA00 (); PC = cia; @@ -2624,6 +3074,9 @@ 8.0xf8+8.0xeb+8.D8:D1:::bns "bns" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F8EB00 (); PC = cia; @@ -2639,6 +3092,9 @@ 8.0xca+8.D8:S1:::bra "bra" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_CA00 (); PC = cia; @@ -2651,6 +3107,9 @@ 8.0xd8:S0:::leq "leq" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D8 (); PC = cia; @@ -2666,6 +3125,9 @@ 8.0xd9:S0:::lne "lne" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D9 (); PC = cia; @@ -2681,6 +3143,9 @@ 8.0xd1:S0:::lgt "lgt" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D1 (); PC = cia; @@ -2697,6 +3162,9 @@ 8.0xd2:S0:::lge "lge" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D2 (); PC = cia; @@ -2712,6 +3180,9 @@ 8.0xd3:S0:::lle "lle" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D3 (); PC = cia; @@ -2728,6 +3199,9 @@ 8.0xd0:S0:::llt "llt" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D0 (); PC = cia; @@ -2743,6 +3217,9 @@ 8.0xd5:S0:::lhi "lhi" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D5 (); PC = cia; @@ -2758,6 +3235,9 @@ 8.0xd6:S0:::lcc "lcc" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D6 (); PC = cia; @@ -2773,6 +3253,9 @@ 8.0xd7:S0:::lls "lls" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D7 (); PC = cia; @@ -2788,6 +3271,9 @@ 8.0xd4:S0:::lcs "lcs" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_D4 (); PC = cia; @@ -2803,6 +3289,9 @@ 8.0xda:S0:::lra "lra" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_DA (); PC = cia; @@ -2815,6 +3304,9 @@ 8.0xdb:S0:::setlb "setlb" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_DB (); PC = cia; @@ -2827,6 +3319,9 @@ 8.0xf0+4.0xf,01,2.AN0:D0:::jmp "jmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F0F4 (); PC = State.regs[REG_A0 + AN0]; @@ -2838,6 +3333,9 @@ 8.0xcc+8.D16A+8.D16B:S2:::jmp "jmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_CC0000 (); PC = cia + EXTEND16(FETCH16(D16A, D16B)); @@ -2849,6 +3347,9 @@ 8.0xdc+8.D32A+8.D32B+8.D32C+8.D32D:S4:::jmp "jmp" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_DC000000 (); PC = cia + FETCH32(D32A, D32B, D32C, D32D); @@ -2856,155 +3357,13 @@ } -// 1100 1101 d16..... regs.... imm8....; -// call (d16,PC),regs,imm8 (d16 is sign-extended., imm8 is zero-extended.) -8.0xcd+8.D16A+8.D16B+8.REGS+8.IMM8:S4:::call -"call" -*mn10300 -{ - // OP_CD000000 (); - unsigned int next_pc, sp; - unsigned long mask; - - PC = cia; - sp = State.regs[REG_SP]; - next_pc = PC + 5; - store_word(sp, next_pc); - - mask = REGS; - - if (mask & 0x80) - { - sp -= 4; - store_word (sp, State.regs[REG_D0 + 2]); - } - - if (mask & 0x40) - { - sp -= 4; - store_word (sp, State.regs[REG_D0 + 3]); - } - - if (mask & 0x20) - { - sp -= 4; - store_word (sp, State.regs[REG_A0 + 2]); - } - - if (mask & 0x10) - { - sp -= 4; - store_word (sp, State.regs[REG_A0 + 3]); - } - - if (mask & 0x8) - { - sp -= 4; - store_word (sp, State.regs[REG_D0]); - sp -= 4; - store_word (sp, State.regs[REG_D0 + 1]); - sp -= 4; - store_word (sp, State.regs[REG_A0]); - sp -= 4; - store_word (sp, State.regs[REG_A0 + 1]); - sp -= 4; - store_word (sp, State.regs[REG_MDR]); - sp -= 4; - store_word (sp, State.regs[REG_LIR]); - sp -= 4; - store_word (sp, State.regs[REG_LAR]); - sp -= 4; - } - - /* Update the stack pointer, note that the register saves to do not - modify SP. The SP adjustment is derived totally from the imm8 - field. */ - State.regs[REG_SP] -= IMM8; - State.regs[REG_MDR] = next_pc; - State.regs[REG_PC] += EXTEND16 (FETCH16(D16A, D16B)); - nia = PC; -} - - -// 1101 1101 d32..... regs.... imm8....; -// call (d32,PC),regs,imm8 (imm8 is zero-extended.) -8.0xdd+8.D32A+8.D32B+8.D32C+8.D32D+8.REGS+8.IMM8:S6:::call -"call" -*mn10300 -{ - // op_DD000000(); - unsigned int next_pc, sp; - unsigned long mask; - - PC = cia; - sp = State.regs[REG_SP]; - next_pc = State.regs[REG_PC] + 7; - /* could assert that nia == next_pc here */ - store_word(sp, next_pc); -// store_byte(sp, next_pc & 0xff); -// store_byte(sp+1, (next_pc & 0xff00) >> 8 ); -// store_byte(sp+2, (next_pc & 0xff0000) >> 16 ); -// store_byte(sp+3, (next_pc & 0xff000000) >> 24); - - mask = REGS; - - if (mask & 0x80) - { - sp -= 4; - store_word (sp, State.regs[REG_D0 + 2]); - } - - if (mask & 0x40) - { - sp -= 4; - store_word (sp, State.regs[REG_D0 + 3]); - } - - if (mask & 0x20) - { - sp -= 4; - store_word (sp, State.regs[REG_A0 + 2]); - } - - if (mask & 0x10) - { - sp -= 4; - store_word (sp, State.regs[REG_A0 + 3]); - } - - if (mask & 0x8) - { - sp -= 4; - store_word (sp, State.regs[REG_D0]); - sp -= 4; - store_word (sp, State.regs[REG_D0 + 1]); - sp -= 4; - store_word (sp, State.regs[REG_A0]); - sp -= 4; - store_word (sp, State.regs[REG_A0 + 1]); - sp -= 4; - store_word (sp, State.regs[REG_MDR]); - sp -= 4; - store_word (sp, State.regs[REG_LIR]); - sp -= 4; - store_word (sp, State.regs[REG_LAR]); - sp -= 4; - } - - /* Update the stack pointer, note that the register saves to do not - modify SP. The SP adjustment is derived totally from the imm8 - field. */ - State.regs[REG_SP] -= IMM8; - State.regs[REG_MDR] = next_pc; - State.regs[REG_PC] += FETCH32(D32A, D32B, D32C, D32D); - nia = PC; -} - - // 1111 0000 1111 00An; calls (An) 8.0xf0+4.0xf,00,2.AN0:D0:::calls "calls" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F0F0 (); unsigned int next_pc, sp; @@ -3023,6 +3382,9 @@ 8.0xfa+8.0xff+8.D16A+8.D16B:D2:::calls "calls" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FAFF0000 (); unsigned int next_pc, sp; @@ -3041,6 +3403,9 @@ 8.0xfc+8.0xff+8.D32A+8.D32B+8.D32C+8.D32D:D4:::calls "calls" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FCFF0000 (); unsigned int next_pc, sp; @@ -3055,135 +3420,13 @@ } -// 1101 1111 regs.... imm8....; ret regs,imm8 (imm8 is zero-extended.) -8.0xdf+8.REGS+8.IMM8:S2:::ret -"ret" -*mn10300 -{ - // OP_DF0000 (); - unsigned int sp, offset; - unsigned long mask; - - PC = cia; - State.regs[REG_SP] += IMM8; - sp = State.regs[REG_SP]; - - offset = -4; - mask = REGS; - - if (mask & 0x80) - { - State.regs[REG_D0 + 2] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x40) - { - State.regs[REG_D0 + 3] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x20) - { - State.regs[REG_A0 + 2] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x10) - { - State.regs[REG_A0 + 3] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x8) - { - State.regs[REG_D0] = load_word (sp + offset); - offset -= 4; - State.regs[REG_D0 + 1] = load_word (sp + offset); - offset -= 4; - State.regs[REG_A0] = load_word (sp + offset); - offset -= 4; - State.regs[REG_A0 + 1] = load_word (sp + offset); - offset -= 4; - State.regs[REG_MDR] = load_word (sp + offset); - offset -= 4; - State.regs[REG_LIR] = load_word (sp + offset); - offset -= 4; - State.regs[REG_LAR] = load_word (sp + offset); - offset -= 4; - } - - /* Restore the PC value. */ - State.regs[REG_PC] = load_word(sp); - nia = PC; -} - - -// 1101 1110 regs.... imm8....; retf regs,imm8 (imm8 is zero-extended.) -8.0xde+8.REGS+8.IMM8:S2:::retf -"retf" -*mn10300 -{ - // OP_DE0000 (); - unsigned int sp, offset; - unsigned long mask; - - PC = cia; - State.regs[REG_SP] += IMM8; - sp = State.regs[REG_SP]; - State.regs[REG_PC] = State.regs[REG_MDR] - 3; - - offset = -4; - mask = REGS; - - if (mask & 0x80) - { - State.regs[REG_D0 + 2] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x40) - { - State.regs[REG_D0 + 3] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x20) - { - State.regs[REG_A0 + 2] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x10) - { - State.regs[REG_A0 + 3] = load_word (sp + offset); - offset -= 4; - } - - if (mask & 0x8) - { - State.regs[REG_D0] = load_word (sp + offset); - offset -= 4; - State.regs[REG_D0 + 1] = load_word (sp + offset); - offset -= 4; - State.regs[REG_A0] = load_word (sp + offset); - offset -= 4; - State.regs[REG_A0 + 1] = load_word (sp + offset); - offset -= 4; - State.regs[REG_MDR] = load_word (sp + offset); - offset -= 4; - State.regs[REG_LIR] = load_word (sp + offset); - offset -= 4; - State.regs[REG_LAR] = load_word (sp + offset); - offset -= 4; - } -} - - // 1111 0000 1111 1100; rets 8.0xf0+8.0xfc:D0:::rets "rets" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F0FC (); unsigned int sp; @@ -3198,6 +3441,9 @@ 8.0xf0+8.0xfd:D0:::rti "rti" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F0FD (); unsigned int sp; @@ -3214,6 +3460,9 @@ 8.0xf0+8.0xfe:D0:::trap "trap" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F0FE (); unsigned int sp, next_pc; @@ -3230,6 +3479,9 @@ 8.0xf0+8.0xff:D0:::rtm "rtm" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F0FF (); PC = cia; @@ -3241,6 +3493,9 @@ 8.0xcb:S0:::nop "nop" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_CB (); PC = cia; @@ -3262,6 +3517,9 @@ 8.0xf6+4.0xf,2.DM1,2.DN0:D0:::getx "getx" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F6F0 (); int z, n; @@ -3280,6 +3538,9 @@ 8.0xf6+4.0x0,2.DM1,2.DN0:D0:::mulq "mulq" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F600 (); unsigned long long temp; @@ -3301,6 +3562,9 @@ 8.0xf9+4.0x,00,2.DN0+8.IMM8:D1:::mulq "mulq" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F90000 (); unsigned long long temp; @@ -3322,6 +3586,9 @@ 8.0xfb+4.0x0,00,2.DN0+8.IMM16A+8.IMM16B:D2:::mulq "mulq" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FB000000 (); unsigned long long temp; @@ -3343,6 +3610,9 @@ 8.0xfd+4.0x0,00,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::mulq "mulq" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FD000000 (); unsigned long long temp; @@ -3364,6 +3634,9 @@ 8.0xf6+4.0x1,2.DM1,2.DN0:D0:::mulqu "mulqu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F610 (); unsigned long long temp; @@ -3385,6 +3658,9 @@ 8.0xf9+4.0x1,01,2.DN0+8.IMM8:D1:::mulqu "mulqu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F91400 (); unsigned long long temp; @@ -3406,6 +3682,9 @@ 8.0xfb+4.0x1,01,2.DN0+8.IMM16A+8.IMM16B:D2:::mulqu "mulqu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FB140000 (); unsigned long long temp; @@ -3427,6 +3706,9 @@ 8.0xfd+4.0x1,01,2.DN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4:::mulqu "mulqu" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FD140000 (); unsigned long long temp; @@ -3448,6 +3730,9 @@ 8.0xf6+4.0x4,2.DM1,2.DN0:D0:::sat16 "sat16" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F640 (); int temp; @@ -3464,6 +3749,9 @@ 8.0xf6+4.0x5,2.DM1,2.DN0:D0:::sat24 "sat24" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F650 (); int temp; @@ -3480,6 +3768,9 @@ 8.0xf6+4.0x7,2.DM1,2.DN0:D0:::bsch "bsch" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_F670 (); int temp, c; @@ -3493,12 +3784,15 @@ } -// 1111 0000 0010 0000; syscall -8.0xf0+8.0x20:D0:::syscall +// 1111 0000 1100 0000; syscall +8.0xf0+8.0xc0:D0:::syscall "syscall" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { - // OP_F020 (); + // OP_F0C0 (); PC = cia; do_syscall (); } @@ -3508,6 +3802,9 @@ 8.0xff:S0:::break "break" *mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 { // OP_FF (); PC = cia; @@ -3515,3 +3812,623 @@ sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP); PC -= 1; } + +// 1100 1110 regs....; movm (SP),regs +8.0xce+8.REGS:S1:::movm +"movm" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // OP_CE00 (); + unsigned long sp = State.regs[REG_SP]; + unsigned long mask; + + PC = cia; + mask = REGS; + + if (mask & 0x8) + { + sp += 4; + State.regs[REG_LAR] = load_word (sp); + sp += 4; + State.regs[REG_LIR] = load_word (sp); + sp += 4; + State.regs[REG_MDR] = load_word (sp); + sp += 4; + State.regs[REG_A0 + 1] = load_word (sp); + sp += 4; + State.regs[REG_A0] = load_word (sp); + sp += 4; + State.regs[REG_D0 + 1] = load_word (sp); + sp += 4; + State.regs[REG_D0] = load_word (sp); + sp += 4; + } + + if (mask & 0x10) + { + State.regs[REG_A0 + 3] = load_word (sp); + sp += 4; + } + + if (mask & 0x20) + { + State.regs[REG_A0 + 2] = load_word (sp); + sp += 4; + } + + if (mask & 0x40) + { + State.regs[REG_D0 + 3] = load_word (sp); + sp += 4; + } + + if (mask & 0x80) + { + State.regs[REG_D0 + 2] = load_word (sp); + sp += 4; + } + + /* start-sanitize-am33 */ + if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33) + { + if (mask & 0x1) + { + /* Need to restore MDQR, MCRH, MCRL, and MCVF */ + sp += 16; + State.regs[REG_E0 + 1] = load_word (sp); + sp += 4; + State.regs[REG_E0 + 0] = load_word (sp); + sp += 4; + } + + if (mask & 0x2) + { + State.regs[REG_E0 + 7] = load_word (sp); + sp += 4; + State.regs[REG_E0 + 6] = load_word (sp); + sp += 4; + State.regs[REG_E0 + 5] = load_word (sp); + sp += 4; + State.regs[REG_E0 + 4] = load_word (sp); + sp += 4; + } + + if (mask & 0x4) + { + State.regs[REG_E0 + 3] = load_word (sp); + sp += 4; + State.regs[REG_E0 + 2] = load_word (sp); + sp += 4; + } + } + /* end-sanitize-am33 */ + + /* And make sure to update the stack pointer. */ + State.regs[REG_SP] = sp; +} + + +// 1100 1111 regs....; movm regs,(SP) +8.0xcf+8.REGS:S1a:::movm +"movm" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // OP_CF00 (); + unsigned long sp = State.regs[REG_SP]; + unsigned long mask; + + PC = cia; + mask = REGS; + + /* start-sanitize-am33 */ + if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33) + { + if (mask & 0x4) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 2]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 3]); + } + + if (mask & 0x2) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 4]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 5]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 6]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 7]); + } + + if (mask & 0x1) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 0]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 1]); + sp -= 16; + /* Need to save MDQR, MCRH, MCRL, and MCVF */ + } + } + /* end-sanitize-am33 */ + + if (mask & 0x80) + { + sp -= 4; + store_word (sp, State.regs[REG_D0 + 2]); + } + + if (mask & 0x40) + { + sp -= 4; + store_word (sp, State.regs[REG_D0 + 3]); + } + + if (mask & 0x20) + { + sp -= 4; + store_word (sp, State.regs[REG_A0 + 2]); + } + + if (mask & 0x10) + { + sp -= 4; + store_word (sp, State.regs[REG_A0 + 3]); + } + + if (mask & 0x8) + { + sp -= 4; + store_word (sp, State.regs[REG_D0]); + sp -= 4; + store_word (sp, State.regs[REG_D0 + 1]); + sp -= 4; + store_word (sp, State.regs[REG_A0]); + sp -= 4; + store_word (sp, State.regs[REG_A0 + 1]); + sp -= 4; + store_word (sp, State.regs[REG_MDR]); + sp -= 4; + store_word (sp, State.regs[REG_LIR]); + sp -= 4; + store_word (sp, State.regs[REG_LAR]); + sp -= 4; + } + + /* And make sure to update the stack pointer. */ + State.regs[REG_SP] = sp; +} + +// 1100 1101 d16..... regs.... imm8....; +// call (d16,PC),regs,imm8 (d16 is sign-extended., imm8 is zero-extended.) +8.0xcd+8.D16A+8.D16B+8.REGS+8.IMM8:S4:::call +"call" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // OP_CD000000 (); + unsigned int next_pc, sp; + unsigned long mask; + + PC = cia; + sp = State.regs[REG_SP]; + next_pc = PC + 5; + store_word(sp, next_pc); + + mask = REGS; + + /* start-sanitize-am33 */ + if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33) + { + if (mask & 0x4) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 2]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 3]); + } + + if (mask & 0x2) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 4]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 5]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 6]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 7]); + } + + if (mask & 0x1) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 0]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 1]); + sp -= 16; + /* Need to save MDQR, MCRH, MCRL, and MCVF */ + } + } + /* end-sanitize-am33 */ + + if (mask & 0x80) + { + sp -= 4; + store_word (sp, State.regs[REG_D0 + 2]); + } + + if (mask & 0x40) + { + sp -= 4; + store_word (sp, State.regs[REG_D0 + 3]); + } + + if (mask & 0x20) + { + sp -= 4; + store_word (sp, State.regs[REG_A0 + 2]); + } + + if (mask & 0x10) + { + sp -= 4; + store_word (sp, State.regs[REG_A0 + 3]); + } + + if (mask & 0x8) + { + sp -= 4; + store_word (sp, State.regs[REG_D0]); + sp -= 4; + store_word (sp, State.regs[REG_D0 + 1]); + sp -= 4; + store_word (sp, State.regs[REG_A0]); + sp -= 4; + store_word (sp, State.regs[REG_A0 + 1]); + sp -= 4; + store_word (sp, State.regs[REG_MDR]); + sp -= 4; + store_word (sp, State.regs[REG_LIR]); + sp -= 4; + store_word (sp, State.regs[REG_LAR]); + sp -= 4; + } + + /* Update the stack pointer, note that the register saves to do not + modify SP. The SP adjustment is derived totally from the imm8 + field. */ + State.regs[REG_SP] -= IMM8; + State.regs[REG_MDR] = next_pc; + State.regs[REG_PC] += EXTEND16 (FETCH16(D16A, D16B)); + nia = PC; +} + + +// 1101 1101 d32..... regs.... imm8....; +// call (d32,PC),regs,imm8 (imm8 is zero-extended.) +8.0xdd+8.D32A+8.D32B+8.D32C+8.D32D+8.REGS+8.IMM8:S6:::call +"call" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // op_DD000000(); + unsigned int next_pc, sp; + unsigned long mask; + + PC = cia; + sp = State.regs[REG_SP]; + next_pc = State.regs[REG_PC] + 7; + /* could assert that nia == next_pc here */ + store_word(sp, next_pc); +// store_byte(sp, next_pc & 0xff); +// store_byte(sp+1, (next_pc & 0xff00) >> 8 ); +// store_byte(sp+2, (next_pc & 0xff0000) >> 16 ); +// store_byte(sp+3, (next_pc & 0xff000000) >> 24); + + mask = REGS; + + /* start-sanitize-am33 */ + if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33) + { + if (mask & 0x4) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 2]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 3]); + } + + if (mask & 0x2) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 4]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 5]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 6]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 7]); + } + + if (mask & 0x1) + { + sp -= 4; + store_word (sp, State.regs[REG_E0 + 0]); + sp -= 4; + store_word (sp, State.regs[REG_E0 + 1]); + sp -= 16; + /* Need to save MDQR, MCRH, MCRL, and MCVF */ + } + } + /* end-sanitize-am33 */ + + if (mask & 0x80) + { + sp -= 4; + store_word (sp, State.regs[REG_D0 + 2]); + } + + if (mask & 0x40) + { + sp -= 4; + store_word (sp, State.regs[REG_D0 + 3]); + } + + if (mask & 0x20) + { + sp -= 4; + store_word (sp, State.regs[REG_A0 + 2]); + } + + if (mask & 0x10) + { + sp -= 4; + store_word (sp, State.regs[REG_A0 + 3]); + } + + if (mask & 0x8) + { + sp -= 4; + store_word (sp, State.regs[REG_D0]); + sp -= 4; + store_word (sp, State.regs[REG_D0 + 1]); + sp -= 4; + store_word (sp, State.regs[REG_A0]); + sp -= 4; + store_word (sp, State.regs[REG_A0 + 1]); + sp -= 4; + store_word (sp, State.regs[REG_MDR]); + sp -= 4; + store_word (sp, State.regs[REG_LIR]); + sp -= 4; + store_word (sp, State.regs[REG_LAR]); + sp -= 4; + } + + /* Update the stack pointer, note that the register saves to do not + modify SP. The SP adjustment is derived totally from the imm8 + field. */ + State.regs[REG_SP] -= IMM8; + State.regs[REG_MDR] = next_pc; + State.regs[REG_PC] += FETCH32(D32A, D32B, D32C, D32D); + nia = PC; +} + + +// 1101 1111 regs.... imm8....; ret regs,imm8 (imm8 is zero-extended.) +8.0xdf+8.REGS+8.IMM8:S2:::ret +"ret" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // OP_DF0000 (); + unsigned int sp, offset; + unsigned long mask; + + PC = cia; + State.regs[REG_SP] += IMM8; + sp = State.regs[REG_SP]; + + offset = -4; + mask = REGS; + + if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33) + { + + if (mask & 0x4) + { + State.regs[REG_E0 + 2] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 3] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x2) + { + State.regs[REG_E0 + 4] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 5] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 6] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 7] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x1) + { + /* Need to restore MDQR, MCRH, MCRL, and MCVF */ + offset -= 16; + State.regs[REG_E0 + 0] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 1] = load_word (sp + offset); + offset -= 4; + } + + } + + if (mask & 0x80) + { + State.regs[REG_D0 + 2] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x40) + { + State.regs[REG_D0 + 3] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x20) + { + State.regs[REG_A0 + 2] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x10) + { + State.regs[REG_A0 + 3] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x8) + { + State.regs[REG_D0] = load_word (sp + offset); + offset -= 4; + State.regs[REG_D0 + 1] = load_word (sp + offset); + offset -= 4; + State.regs[REG_A0] = load_word (sp + offset); + offset -= 4; + State.regs[REG_A0 + 1] = load_word (sp + offset); + offset -= 4; + State.regs[REG_MDR] = load_word (sp + offset); + offset -= 4; + State.regs[REG_LIR] = load_word (sp + offset); + offset -= 4; + State.regs[REG_LAR] = load_word (sp + offset); + offset -= 4; + } + + /* Restore the PC value. */ + State.regs[REG_PC] = load_word(sp); + nia = PC; +} + + +// 1101 1110 regs.... imm8....; retf regs,imm8 (imm8 is zero-extended.) +8.0xde+8.REGS+8.IMM8:S2:::retf +"retf" +*mn10300 +// start-sanitize-am33 +*am33 +// end-sanitize-am33 +{ + // OP_DE0000 (); + unsigned int sp, offset; + unsigned long mask; + + PC = cia; + State.regs[REG_SP] += IMM8; + sp = State.regs[REG_SP]; + State.regs[REG_PC] = State.regs[REG_MDR] - 3; + + offset = -4; + mask = REGS; + + if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33) + { + + if (mask & 0x4) + { + State.regs[REG_E0 + 2] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 3] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x2) + { + State.regs[REG_E0 + 4] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 5] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 6] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 7] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x1) + { + /* Need to restore MDQR, MCRH, MCRL, and MCVF */ + offset -= 16; + State.regs[REG_E0 + 0] = load_word (sp + offset); + offset -= 4; + State.regs[REG_E0 + 1] = load_word (sp + offset); + offset -= 4; + } + + } + + if (mask & 0x80) + { + State.regs[REG_D0 + 2] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x40) + { + State.regs[REG_D0 + 3] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x20) + { + State.regs[REG_A0 + 2] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x10) + { + State.regs[REG_A0 + 3] = load_word (sp + offset); + offset -= 4; + } + + if (mask & 0x8) + { + State.regs[REG_D0] = load_word (sp + offset); + offset -= 4; + State.regs[REG_D0 + 1] = load_word (sp + offset); + offset -= 4; + State.regs[REG_A0] = load_word (sp + offset); + offset -= 4; + State.regs[REG_A0 + 1] = load_word (sp + offset); + offset -= 4; + State.regs[REG_MDR] = load_word (sp + offset); + offset -= 4; + State.regs[REG_LIR] = load_word (sp + offset); + offset -= 4; + State.regs[REG_LAR] = load_word (sp + offset); + offset -= 4; + } +} + +// start-sanitize-am33 +:include::am33:am33.igen +// end-sanitize-am33 |