-
Notifications
You must be signed in to change notification settings - Fork 1
/
M68k_Suba.c
86 lines (59 loc) · 1.44 KB
/
M68k_Suba.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* Copyright (c) 2014-2024 Rene W. Olsen < renewolsen @ gmail . com >
*
* This software is released under the GNU General Public License, version 3.
* For the full text of the license, please visit:
* https://www.gnu.org/licenses/gpl-3.0.html
*
* You can also find a copy of the license in the LICENSE file included with this software.
*/
// --
#include "ReSrc4.h"
// --
void Cmd_SUBA( struct M68kStruct *ms )
{
int opmode;
opmode = ( ms->ms_Opcode & 0x01c00000 ) >> 22;
switch( opmode )
{
// 0 : Sub.b
// 1 : Sub.w
// 2 : Sub.l
case 3:
{
ms->ms_Str_Opcode = ( ShortOpcodes ) ? "Sub.w" : "Suba.w";
ms->ms_ArgType = OS_Word;
break;
}
// 4 : Sub.b
// 5 : Sub.w
// 6 : Sub.l
case 7:
{
ms->ms_Str_Opcode = ( ShortOpcodes ) ? "Sub.l" : "Suba.l";
ms->ms_ArgType = OS_Long;
break;
}
default:
{
printf( "Unsupported 'Suba' Opcode (Mode: %d)\n", opmode );
ms->ms_DecodeStatus = MSTAT_Error;
goto bailout;
}
}
// --
ms->ms_ArgEMode = ( ms->ms_Opcode & 0x00380000 ) >> 19;
ms->ms_ArgEReg = ( ms->ms_Opcode & 0x00070000 ) >> 16;
ms->ms_CurRegister = & ms->ms_SrcRegister;
M68k_EffectiveAddress( ms );
ms->ms_ArgEMode = 0x01; // Ax Reg
ms->ms_ArgEReg = ( ms->ms_Opcode & 0x0e000000 ) >> 25;
ms->ms_CurRegister = & ms->ms_DstRegister;
M68k_EffectiveAddress( ms );
ms->ms_CurRegister->mr_Type = RT_Unknown;
ms->ms_OpcodeSize = ms->ms_ArgSize;
// --
bailout:
return;
}
// --