1
/**********************************/
3
/* Copyright 2000, David Grant */
5
/* see LICENSE for more details */
7
/**********************************/
11
/* Negate with Excend (NEGX) instruction */
15
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
16
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
17
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | Register |
18
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
25
INSTRUCTION_2ARGS(NEGX,
29
static void execute(void)
31
struct _Address Destination;
32
unsigned int Result, DValue;
35
Memory_RetrWordFromPC(&Instr.Code);
37
if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return;
38
EA_GetValue(&DValue, &Destination);
40
Result = 0 - DValue - (unsigned int)SRBits->X;
43
SR_Set(I_NEGX, 0, DValue, Result);
45
EA_PutValue(&Destination, Result);
52
static int disassemble(char *Instruction, char *Arg1, char *Arg2)
55
Memory_RetrWordFromPC(&Instr.Code);
57
sprintf(Instruction, "NEGX.L");
58
Addressing_Print(32, 0, Instr.Bits.Register, Arg1);
63
int negx_5206_register(void)
65
instruction_register(0x4080, 0xFFF8, &execute, &disassemble);