mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
hp64k: Improved HP Hybrid CPU (still no DMA)
This commit is contained in:
parent
7717489f3e
commit
eecc50b48a
File diff suppressed because it is too large
Load Diff
@ -10,13 +10,11 @@
|
||||
// discrete implementation of the 1960s into a multi-chip module (hence the "hybrid" name).
|
||||
// This emulator currently supports the 5061-3011 version only.
|
||||
//
|
||||
// There is very little information around on this processor.
|
||||
// For this emulator I mainly relied on these sources:
|
||||
// - http://www.hp9845.net/ website
|
||||
// - HP manual "Assembly development ROM manual for the HP9845": this is the most precious
|
||||
// and "enabling" resource of all
|
||||
// - US Patent 4,180,854 describing the HP9845 system
|
||||
// - Some manual for the 2116 processor
|
||||
// - Study of disassembly of firmware of HP64000 system
|
||||
// - A lot of "educated" guessing
|
||||
|
||||
@ -40,6 +38,9 @@
|
||||
#define HP_IOADDR_PA_SHIFT 2
|
||||
#define HP_IOADDR_IC_SHIFT 0
|
||||
|
||||
// Compose an I/O address from PA & IC
|
||||
#define HP_MAKE_IOADDR(pa , ic) (((pa) << HP_IOADDR_PA_SHIFT) | ((ic) << HP_IOADDR_IC_SHIFT))
|
||||
|
||||
// Addresses of memory mapped registers
|
||||
#define HP_REG_A_ADDR 0x0000
|
||||
#define HP_REG_B_ADDR 0x0001
|
||||
@ -65,75 +66,76 @@ class hp_hybrid_cpu_device : public cpu_device
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
|
||||
hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
// device_execute_interface overrides
|
||||
virtual UINT32 execute_min_cycles() const { return 6; }
|
||||
virtual UINT32 execute_max_cycles() const { return 25; }
|
||||
virtual UINT32 execute_input_lines() const { return 2; }
|
||||
virtual UINT32 execute_default_irq_vector() const { return 0xffff; }
|
||||
virtual void execute_run();
|
||||
virtual void execute_set_input(int inputnum, int state);
|
||||
// device_execute_interface overrides
|
||||
virtual UINT32 execute_min_cycles() const { return 6; }
|
||||
virtual UINT32 execute_max_cycles() const { return 25; }
|
||||
virtual UINT32 execute_input_lines() const { return 2; }
|
||||
virtual UINT32 execute_default_irq_vector() const { return 0xffff; }
|
||||
virtual void execute_run();
|
||||
virtual void execute_set_input(int inputnum, int state);
|
||||
|
||||
UINT16 execute_one(UINT16 opcode);
|
||||
UINT16 execute_one_sub(UINT16 opcode);
|
||||
UINT16 execute_one(UINT16 opcode);
|
||||
UINT16 execute_one_sub(UINT16 opcode);
|
||||
|
||||
// device_memory_interface overrides
|
||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); }
|
||||
// device_memory_interface overrides
|
||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); }
|
||||
|
||||
// device_state_interface overrides
|
||||
void state_string_export(const device_state_entry &entry, std::string &str);
|
||||
// device_state_interface overrides
|
||||
void state_string_export(const device_state_entry &entry, std::string &str);
|
||||
|
||||
// device_disasm_interface overrides
|
||||
virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
|
||||
virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
|
||||
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
||||
// device_disasm_interface overrides
|
||||
virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
|
||||
virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
|
||||
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
||||
|
||||
private:
|
||||
address_space_config m_program_config;
|
||||
address_space_config m_io_config;
|
||||
|
||||
private:
|
||||
address_space_config m_program_config;
|
||||
address_space_config m_io_config;
|
||||
|
||||
address_space *m_program;
|
||||
direct_read_data *m_direct;
|
||||
address_space *m_io;
|
||||
int m_icount;
|
||||
address_space *m_program;
|
||||
direct_read_data *m_direct;
|
||||
address_space *m_io;
|
||||
int m_icount;
|
||||
|
||||
// State of processor
|
||||
UINT16 m_reg_A; // Register A
|
||||
UINT16 m_reg_B; // Register B
|
||||
UINT16 m_reg_P; // Register P
|
||||
UINT16 m_reg_R; // Register R
|
||||
UINT16 m_reg_C; // Register C
|
||||
UINT16 m_reg_D; // Register D
|
||||
UINT16 m_reg_IV; // Register IV
|
||||
UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long)
|
||||
UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir)
|
||||
UINT8 m_dmapa; // DMA peripheral address (4 bits)
|
||||
UINT16 m_dmama; // DMA address
|
||||
UINT16 m_dmac; // DMA counter
|
||||
UINT16 m_reg_I; // Instruction register
|
||||
// State of processor
|
||||
UINT16 m_reg_A; // Register A
|
||||
UINT16 m_reg_B; // Register B
|
||||
UINT16 m_reg_P; // Register P
|
||||
UINT16 m_reg_R; // Register R
|
||||
UINT16 m_reg_C; // Register C
|
||||
UINT16 m_reg_D; // Register D
|
||||
UINT16 m_reg_IV; // Register IV
|
||||
UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long)
|
||||
UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir)
|
||||
UINT8 m_dmapa; // DMA peripheral address (4 bits)
|
||||
UINT16 m_dmama; // DMA address
|
||||
UINT16 m_dmac; // DMA counter
|
||||
UINT16 m_reg_I; // Instruction register
|
||||
|
||||
UINT16 get_ea(UINT16 opcode);
|
||||
void do_add(UINT16& addend1 , UINT16 addend2);
|
||||
UINT16 get_skip_addr(UINT16 opcode , bool condition) const;
|
||||
UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n);
|
||||
void do_pw(UINT16 opcode);
|
||||
UINT16 get_ea(UINT16 opcode);
|
||||
void do_add(UINT16& addend1 , UINT16 addend2);
|
||||
UINT16 get_skip_addr(UINT16 opcode , bool condition) const;
|
||||
UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n);
|
||||
void do_pw(UINT16 opcode);
|
||||
void check_for_interrupts(void);
|
||||
|
||||
UINT16 RM(UINT16 addr);
|
||||
void WM(UINT16 addr , UINT16 v);
|
||||
void WMB(UINT32 addr , UINT8 v);
|
||||
UINT16 RIO(UINT8 pa , UINT8 ic);
|
||||
void WIO(UINT8 pa , UINT8 ic , UINT16 v);
|
||||
UINT16 RM(UINT16 addr);
|
||||
void WM(UINT16 addr , UINT16 v);
|
||||
void WMB(UINT32 addr , UINT8 v);
|
||||
UINT16 RIO(UINT8 pa , UINT8 ic);
|
||||
void WIO(UINT8 pa , UINT8 ic , UINT16 v);
|
||||
};
|
||||
|
||||
class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device
|
||||
{
|
||||
public:
|
||||
hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
};
|
||||
|
||||
extern const device_type HP_5061_3011;
|
||||
|
@ -11,84 +11,84 @@
|
||||
typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode);
|
||||
|
||||
typedef struct {
|
||||
UINT16 m_op_mask;
|
||||
UINT16 m_opcode;
|
||||
const char *m_mnemonic;
|
||||
fn_dis_param m_param_fn;
|
||||
UINT32 m_dasm_flags;
|
||||
UINT16 m_op_mask;
|
||||
UINT16 m_opcode;
|
||||
const char *m_mnemonic;
|
||||
fn_dis_param m_param_fn;
|
||||
UINT32 m_dasm_flags;
|
||||
} dis_entry_t;
|
||||
|
||||
static void addr_2_str(char *buffer , UINT16 addr , bool indirect)
|
||||
{
|
||||
char *s = buffer + strlen(buffer);
|
||||
char *s = buffer + strlen(buffer);
|
||||
|
||||
s += sprintf(s , "$%04x" , addr);
|
||||
s += sprintf(s , "$%04x" , addr);
|
||||
|
||||
switch (addr) {
|
||||
case HP_REG_A_ADDR:
|
||||
strcpy(s , "(A)");
|
||||
break;
|
||||
|
||||
case HP_REG_B_ADDR:
|
||||
strcpy(s , "(B)");
|
||||
break;
|
||||
|
||||
case HP_REG_P_ADDR:
|
||||
strcpy(s , "(P)");
|
||||
break;
|
||||
|
||||
case HP_REG_R_ADDR:
|
||||
strcpy(s , "(R)");
|
||||
break;
|
||||
|
||||
case HP_REG_R4_ADDR:
|
||||
strcpy(s , "(R4)");
|
||||
break;
|
||||
|
||||
case HP_REG_R5_ADDR:
|
||||
strcpy(s , "(R5)");
|
||||
break;
|
||||
|
||||
case HP_REG_R6_ADDR:
|
||||
strcpy(s , "(R6)");
|
||||
break;
|
||||
|
||||
case HP_REG_R7_ADDR:
|
||||
strcpy(s , "(R7)");
|
||||
break;
|
||||
|
||||
case HP_REG_IV_ADDR:
|
||||
strcpy(s , "(IV)");
|
||||
break;
|
||||
|
||||
case HP_REG_PA_ADDR:
|
||||
strcpy(s , "(PA)");
|
||||
break;
|
||||
|
||||
case HP_REG_DMAPA_ADDR:
|
||||
strcpy(s , "(DMAPA)");
|
||||
break;
|
||||
|
||||
case HP_REG_DMAMA_ADDR:
|
||||
strcpy(s , "(DMAMA)");
|
||||
break;
|
||||
|
||||
case HP_REG_DMAC_ADDR:
|
||||
strcpy(s , "(DMAC)");
|
||||
break;
|
||||
|
||||
case HP_REG_C_ADDR:
|
||||
strcpy(s , "(C)");
|
||||
break;
|
||||
|
||||
case HP_REG_D_ADDR:
|
||||
strcpy(s , "(D)");
|
||||
break;
|
||||
}
|
||||
switch (addr) {
|
||||
case HP_REG_A_ADDR:
|
||||
strcpy(s , "(A)");
|
||||
break;
|
||||
|
||||
if (indirect) {
|
||||
strcat(s , ",I");
|
||||
}
|
||||
case HP_REG_B_ADDR:
|
||||
strcpy(s , "(B)");
|
||||
break;
|
||||
|
||||
case HP_REG_P_ADDR:
|
||||
strcpy(s , "(P)");
|
||||
break;
|
||||
|
||||
case HP_REG_R_ADDR:
|
||||
strcpy(s , "(R)");
|
||||
break;
|
||||
|
||||
case HP_REG_R4_ADDR:
|
||||
strcpy(s , "(R4)");
|
||||
break;
|
||||
|
||||
case HP_REG_R5_ADDR:
|
||||
strcpy(s , "(R5)");
|
||||
break;
|
||||
|
||||
case HP_REG_R6_ADDR:
|
||||
strcpy(s , "(R6)");
|
||||
break;
|
||||
|
||||
case HP_REG_R7_ADDR:
|
||||
strcpy(s , "(R7)");
|
||||
break;
|
||||
|
||||
case HP_REG_IV_ADDR:
|
||||
strcpy(s , "(IV)");
|
||||
break;
|
||||
|
||||
case HP_REG_PA_ADDR:
|
||||
strcpy(s , "(PA)");
|
||||
break;
|
||||
|
||||
case HP_REG_DMAPA_ADDR:
|
||||
strcpy(s , "(DMAPA)");
|
||||
break;
|
||||
|
||||
case HP_REG_DMAMA_ADDR:
|
||||
strcpy(s , "(DMAMA)");
|
||||
break;
|
||||
|
||||
case HP_REG_DMAC_ADDR:
|
||||
strcpy(s , "(DMAC)");
|
||||
break;
|
||||
|
||||
case HP_REG_C_ADDR:
|
||||
strcpy(s , "(C)");
|
||||
break;
|
||||
|
||||
case HP_REG_D_ADDR:
|
||||
strcpy(s , "(D)");
|
||||
break;
|
||||
}
|
||||
|
||||
if (indirect) {
|
||||
strcat(s , ",I");
|
||||
}
|
||||
}
|
||||
|
||||
static void param_none(char *buffer , offs_t pc , UINT16 opcode)
|
||||
@ -97,185 +97,185 @@ static void param_none(char *buffer , offs_t pc , UINT16 opcode)
|
||||
|
||||
static void param_loc(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
UINT16 base;
|
||||
UINT16 off;
|
||||
|
||||
if (opcode & 0x0400) {
|
||||
// Current page
|
||||
base = pc;
|
||||
} else {
|
||||
// Base page
|
||||
base = 0;
|
||||
}
|
||||
UINT16 base;
|
||||
UINT16 off;
|
||||
|
||||
off = opcode & 0x3ff;
|
||||
if (off & 0x200) {
|
||||
off -= 0x400;
|
||||
}
|
||||
if (opcode & 0x0400) {
|
||||
// Current page
|
||||
base = pc;
|
||||
} else {
|
||||
// Base page
|
||||
base = 0;
|
||||
}
|
||||
|
||||
addr_2_str(buffer , base + off , (opcode & 0x8000) != 0);
|
||||
off = opcode & 0x3ff;
|
||||
if (off & 0x200) {
|
||||
off -= 0x400;
|
||||
}
|
||||
|
||||
addr_2_str(buffer , base + off , (opcode & 0x8000) != 0);
|
||||
}
|
||||
|
||||
static void param_addr32(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0);
|
||||
addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0);
|
||||
}
|
||||
|
||||
static void param_skip(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
UINT16 off = opcode & 0x3f;
|
||||
if (off & 0x20) {
|
||||
off -= 0x40;
|
||||
}
|
||||
addr_2_str(buffer , pc + off , false);
|
||||
UINT16 off = opcode & 0x3f;
|
||||
if (off & 0x20) {
|
||||
off -= 0x40;
|
||||
}
|
||||
addr_2_str(buffer , pc + off , false);
|
||||
}
|
||||
|
||||
static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
param_skip(buffer, pc, opcode);
|
||||
|
||||
if (opcode & 0x80) {
|
||||
if (opcode & 0x40) {
|
||||
strcat(buffer , ",S");
|
||||
} else {
|
||||
strcat(buffer , ",C");
|
||||
param_skip(buffer, pc, opcode);
|
||||
|
||||
if (opcode & 0x80) {
|
||||
if (opcode & 0x40) {
|
||||
strcat(buffer , ",S");
|
||||
} else {
|
||||
strcat(buffer , ",C");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void param_ret(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
char *s = buffer + strlen(buffer);
|
||||
|
||||
int off = opcode & 0x3f;
|
||||
|
||||
if (off & 0x20) {
|
||||
off -= 0x40;
|
||||
}
|
||||
char *s = buffer + strlen(buffer);
|
||||
|
||||
s += sprintf(s , "%d" , off);
|
||||
if (opcode & 0x40) {
|
||||
strcpy(s , ",P");
|
||||
}
|
||||
int off = opcode & 0x3f;
|
||||
|
||||
if (off & 0x20) {
|
||||
off -= 0x40;
|
||||
}
|
||||
|
||||
s += sprintf(s , "%d" , off);
|
||||
if (opcode & 0x40) {
|
||||
strcpy(s , ",P");
|
||||
}
|
||||
}
|
||||
|
||||
static void param_n16(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
char *s = buffer + strlen(buffer);
|
||||
char *s = buffer + strlen(buffer);
|
||||
|
||||
sprintf(s , "%u" , (opcode & 0xf) + 1);
|
||||
sprintf(s , "%u" , (opcode & 0xf) + 1);
|
||||
}
|
||||
|
||||
static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode)
|
||||
{
|
||||
addr_2_str(buffer, opcode & 7, false);
|
||||
addr_2_str(buffer, opcode & 7, false);
|
||||
|
||||
if (opcode & 0x80) {
|
||||
strcat(buffer , ",D");
|
||||
} else {
|
||||
strcat(buffer , ",I");
|
||||
}
|
||||
if (opcode & 0x80) {
|
||||
strcat(buffer , ",D");
|
||||
} else {
|
||||
strcat(buffer , ",I");
|
||||
}
|
||||
}
|
||||
|
||||
static const dis_entry_t dis_table[] = {
|
||||
// *** BPC Instructions ***
|
||||
{0xffff , 0x0000 , "NOP" , param_none , 0 },
|
||||
{0x7800 , 0x0000 , "LDA" , param_loc , 0 },
|
||||
{0x7800 , 0x0800 , "LDB" , param_loc , 0 },
|
||||
{0x7800 , 0x1000 , "CPA" , param_loc , 0 },
|
||||
{0x7800 , 0x1800 , "CPB" , param_loc , 0 },
|
||||
{0x7800 , 0x2000 , "ADA" , param_loc , 0 },
|
||||
{0x7800 , 0x2800 , "ADB" , param_loc , 0 },
|
||||
{0x7800 , 0x3000 , "STA" , param_loc , 0 },
|
||||
{0x7800 , 0x3800 , "STB" , param_loc , 0 },
|
||||
{0x7800 , 0x4000 , "JSM" , param_loc , DASMFLAG_STEP_OVER },
|
||||
{0x7800 , 0x4800 , "ISZ" , param_loc , 0 },
|
||||
{0x7800 , 0x5000 , "AND" , param_loc , 0 },
|
||||
{0x7800 , 0x5800 , "DSZ" , param_loc , 0 },
|
||||
{0x7800 , 0x6000 , "IOR" , param_loc , 0 },
|
||||
{0x7800 , 0x6800 , "JMP" , param_loc , 0 },
|
||||
{0x7fe0 , 0x7000 , "EXE" , param_addr32 , 0 },
|
||||
{0xffc0 , 0x7400 , "RZA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7C00 , "RZB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7440 , "RIA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7C40 , "RIB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7500 , "SZA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7D00 , "SZB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7540 , "SIA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7D40 , "SIB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7480 , "SFS" , param_skip , 0 },
|
||||
{0xffc0 , 0x7580 , "SFC" , param_skip , 0 },
|
||||
{0xffc0 , 0x7c80 , "SSS" , param_skip , 0 },
|
||||
{0xffc0 , 0x7d80 , "SSC" , param_skip , 0 },
|
||||
{0xffc0 , 0x7cc0 , "SHS" , param_skip , 0 },
|
||||
{0xffc0 , 0x7dc0 , "SHC" , param_skip , 0 },
|
||||
{0xff00 , 0x7600 , "SLA" , param_skip_sc , 0 },
|
||||
{0xff00 , 0x7e00 , "SLB" , param_skip_sc , 0 },
|
||||
{0xff00 , 0x7700 , "RLA" , param_skip_sc , 0 },
|
||||
{0xff00 , 0x7f00 , "RLB" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf400 , "SAP" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xfc00 , "SBP" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf500 , "SAM" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xfd00 , "SBM" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf600 , "SOC" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf700 , "SOS" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xfe00 , "SEC" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xff00 , "SES" , param_skip_sc , 0 },
|
||||
{0xffff , 0xf020 , "TCA" , param_none , 0 },
|
||||
{0xffff , 0xf820 , "TCB" , param_none , 0 },
|
||||
{0xffff , 0xf060 , "CMA" , param_none , 0 },
|
||||
{0xffff , 0xf860 , "CMB" , param_none , 0 },
|
||||
{0xff80 , 0xf080 , "RET" , param_ret , DASMFLAG_STEP_OUT },
|
||||
{0xfff0 , 0xf100 , "AAR" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf900 , "ABR" , param_n16 , 0 },
|
||||
{0xffff , 0xf14f , "CLA" , param_none , 0 },
|
||||
{0xfff0 , 0xf140 , "SAR" , param_n16 , 0 },
|
||||
{0xffff , 0xf94f , "CLB" , param_none , 0 },
|
||||
{0xfff0 , 0xf940 , "SBR" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf180 , "SAL" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf980 , "SBL" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf1c0 , "RAR" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf9c0 , "RBR" , param_n16 , 0 },
|
||||
// *** IOC Instructions ***
|
||||
{0xffff , 0x7100 , "SDO" , param_none , 0 },
|
||||
{0xffff , 0x7108 , "SDI" , param_none , 0 },
|
||||
{0xffff , 0x7110 , "EIR" , param_none , 0 },
|
||||
{0xffff , 0x7118 , "DIR" , param_none , 0 },
|
||||
{0xffff , 0x7120 , "DMA" , param_none , 0 },
|
||||
{0xffff , 0x7128 , "PCM" , param_none , 0 },
|
||||
{0xffff , 0x7138 , "DDR" , param_none , 0 },
|
||||
{0xffff , 0x7140 , "DBL" , param_none , 0 },
|
||||
{0xffff , 0x7148 , "CBL" , param_none , 0 },
|
||||
{0xffff , 0x7150 , "DBU" , param_none , 0 },
|
||||
{0xffff , 0x7158 , "CBU" , param_none , 0 },
|
||||
{0xff78 , 0x7160 , "PWC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7168 , "PWD" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7960 , "PBC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7968 , "PBD" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7170 , "WWC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7178 , "WWD" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7970 , "WBC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7978 , "WBD" , param_reg_id , 0 },
|
||||
// *** END ***
|
||||
{0 , 0 , NULL , NULL , 0 }
|
||||
// *** BPC Instructions ***
|
||||
{0xffff , 0x0000 , "NOP" , param_none , 0 },
|
||||
{0x7800 , 0x0000 , "LDA" , param_loc , 0 },
|
||||
{0x7800 , 0x0800 , "LDB" , param_loc , 0 },
|
||||
{0x7800 , 0x1000 , "CPA" , param_loc , 0 },
|
||||
{0x7800 , 0x1800 , "CPB" , param_loc , 0 },
|
||||
{0x7800 , 0x2000 , "ADA" , param_loc , 0 },
|
||||
{0x7800 , 0x2800 , "ADB" , param_loc , 0 },
|
||||
{0x7800 , 0x3000 , "STA" , param_loc , 0 },
|
||||
{0x7800 , 0x3800 , "STB" , param_loc , 0 },
|
||||
{0x7800 , 0x4000 , "JSM" , param_loc , DASMFLAG_STEP_OVER },
|
||||
{0x7800 , 0x4800 , "ISZ" , param_loc , 0 },
|
||||
{0x7800 , 0x5000 , "AND" , param_loc , 0 },
|
||||
{0x7800 , 0x5800 , "DSZ" , param_loc , 0 },
|
||||
{0x7800 , 0x6000 , "IOR" , param_loc , 0 },
|
||||
{0x7800 , 0x6800 , "JMP" , param_loc , 0 },
|
||||
{0x7fe0 , 0x7000 , "EXE" , param_addr32 , 0 },
|
||||
{0xffc0 , 0x7400 , "RZA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7C00 , "RZB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7440 , "RIA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7C40 , "RIB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7500 , "SZA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7D00 , "SZB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7540 , "SIA" , param_skip , 0 },
|
||||
{0xffc0 , 0x7D40 , "SIB" , param_skip , 0 },
|
||||
{0xffc0 , 0x7480 , "SFS" , param_skip , 0 },
|
||||
{0xffc0 , 0x7580 , "SFC" , param_skip , 0 },
|
||||
{0xffc0 , 0x7c80 , "SSS" , param_skip , 0 },
|
||||
{0xffc0 , 0x7d80 , "SSC" , param_skip , 0 },
|
||||
{0xffc0 , 0x7cc0 , "SHS" , param_skip , 0 },
|
||||
{0xffc0 , 0x7dc0 , "SHC" , param_skip , 0 },
|
||||
{0xff00 , 0x7600 , "SLA" , param_skip_sc , 0 },
|
||||
{0xff00 , 0x7e00 , "SLB" , param_skip_sc , 0 },
|
||||
{0xff00 , 0x7700 , "RLA" , param_skip_sc , 0 },
|
||||
{0xff00 , 0x7f00 , "RLB" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf400 , "SAP" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xfc00 , "SBP" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf500 , "SAM" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xfd00 , "SBM" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf600 , "SOC" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xf700 , "SOS" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xfe00 , "SEC" , param_skip_sc , 0 },
|
||||
{0xff00 , 0xff00 , "SES" , param_skip_sc , 0 },
|
||||
{0xffff , 0xf020 , "TCA" , param_none , 0 },
|
||||
{0xffff , 0xf820 , "TCB" , param_none , 0 },
|
||||
{0xffff , 0xf060 , "CMA" , param_none , 0 },
|
||||
{0xffff , 0xf860 , "CMB" , param_none , 0 },
|
||||
{0xff80 , 0xf080 , "RET" , param_ret , DASMFLAG_STEP_OUT },
|
||||
{0xfff0 , 0xf100 , "AAR" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf900 , "ABR" , param_n16 , 0 },
|
||||
{0xffff , 0xf14f , "CLA" , param_none , 0 },
|
||||
{0xfff0 , 0xf140 , "SAR" , param_n16 , 0 },
|
||||
{0xffff , 0xf94f , "CLB" , param_none , 0 },
|
||||
{0xfff0 , 0xf940 , "SBR" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf180 , "SAL" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf980 , "SBL" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf1c0 , "RAR" , param_n16 , 0 },
|
||||
{0xfff0 , 0xf9c0 , "RBR" , param_n16 , 0 },
|
||||
// *** IOC Instructions ***
|
||||
{0xffff , 0x7100 , "SDO" , param_none , 0 },
|
||||
{0xffff , 0x7108 , "SDI" , param_none , 0 },
|
||||
{0xffff , 0x7110 , "EIR" , param_none , 0 },
|
||||
{0xffff , 0x7118 , "DIR" , param_none , 0 },
|
||||
{0xffff , 0x7120 , "DMA" , param_none , 0 },
|
||||
{0xffff , 0x7128 , "PCM" , param_none , 0 },
|
||||
{0xffff , 0x7138 , "DDR" , param_none , 0 },
|
||||
{0xffff , 0x7140 , "DBL" , param_none , 0 },
|
||||
{0xffff , 0x7148 , "CBL" , param_none , 0 },
|
||||
{0xffff , 0x7150 , "DBU" , param_none , 0 },
|
||||
{0xffff , 0x7158 , "CBU" , param_none , 0 },
|
||||
{0xff78 , 0x7160 , "PWC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7168 , "PWD" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7960 , "PBC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7968 , "PBD" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7170 , "WWC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7178 , "WWD" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7970 , "WBC" , param_reg_id , 0 },
|
||||
{0xff78 , 0x7978 , "WBD" , param_reg_id , 0 },
|
||||
// *** END ***
|
||||
{0 , 0 , NULL , NULL , 0 }
|
||||
};
|
||||
|
||||
CPU_DISASSEMBLE(hp_hybrid)
|
||||
{
|
||||
UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ];
|
||||
const dis_entry_t *p;
|
||||
UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ];
|
||||
const dis_entry_t *p;
|
||||
|
||||
for (p = dis_table; p->m_op_mask; p++) {
|
||||
if ((opcode & p->m_op_mask) == p->m_opcode) {
|
||||
strcpy(buffer , p->m_mnemonic);
|
||||
strcat(buffer , " ");
|
||||
p->m_param_fn(buffer , pc , opcode);
|
||||
return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED;
|
||||
for (p = dis_table; p->m_op_mask; p++) {
|
||||
if ((opcode & p->m_op_mask) == p->m_opcode) {
|
||||
strcpy(buffer , p->m_mnemonic);
|
||||
strcat(buffer , " ");
|
||||
p->m_param_fn(buffer , pc , opcode);
|
||||
return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Unknown opcode
|
||||
strcpy(buffer , "???");
|
||||
// Unknown opcode
|
||||
strcpy(buffer , "???");
|
||||
|
||||
return 1 | DASMFLAG_SUPPORTED;
|
||||
return 1 | DASMFLAG_SUPPORTED;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user