blob: 27d80cbfc77e31ee0b8ced049d09baf994ccb3ce (
plain) (
blame)
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
|
// license:BSD-3-Clause
// copyright-holders:Andrew Gardner
/***************************************************************************
dsp56dsm.c
Disassembler for the portable Motorola/Freescale dsp56k emulator.
Written by Andrew Gardner
***************************************************************************/
#include "opcode.h"
#include "emu.h"
#include "dsp56k.h"
/*****************************/
/* Main disassembly function */
/*****************************/
static offs_t internal_disasm_dsp56k(cpu_device *device, std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options)
{
const uint16_t w0 = oprom[0] | (oprom[1] << 8);
const uint16_t w1 = oprom[2] | (oprom[3] << 8);
// Decode and disassemble.
DSP56K::Opcode op(w0, w1);
stream << op.disassemble();
const unsigned size = op.size();
return (size | DASMFLAG_SUPPORTED);
}
CPU_DISASSEMBLE(dsp56k)
{
std::ostringstream stream;
offs_t result = internal_disasm_dsp56k(device, stream, pc, oprom, opram, options);
std::string stream_str = stream.str();
strcpy(buffer, stream_str.c_str());
return result;
}
|