/*
 *      Interactive disassembler (IDA).
 *      Version 3.05
 *      Copyright (c) 1990-95 by Ilfak Guilfanov.
 *      ALL RIGHTS RESERVED.
 *                              FIDO:   2:5020/209
 *                              E-mail: ig@estar.msk.su
 *
 */

#ifndef _NEC78K0S_HPP
#define _NEC78K0S_HPP

#include "../idaidp.hpp"
#include "ins.hpp"

#define UAS_NOSPA        0x0001         // no space after comma
//#define UAS_ZVBIT        0x0002         // '*' prefixes name in bit command
//#define UAS_AREAS        0x0004         // '.area' segment directive
//#define UAS_CCR          0x0008         // "ccr" register is named "cc"
//                                        // "dpr" register is named "dp"
//                                        // "pcr" register is named "pc"
//#define UAS_ORA          0x0010         // ORAA is named ORA
//                                        // ORAB is named ORB
//#define UAS_CODE         0x0020         // "code", "data", "bss" directives
//#define UAS_AUTOPC       0x0040         // Automatic relative addressing by PC
//                                        // (no need to substract PC value)
//#define UAS_ALL          0x0080         // "all" keyword is recognized as
//                                        // a synonim for all registers
//#define UAS_OS9          0x0100         // has OS9 directive

//----------------------------------------------------------------------
// Redefine temporary names
//
#define FTR_SCOBKI   0x1
#define FTR_PLUS     0x2
#define FTR_VALUE    0x4
#define FTR_REGISTR  0x8

#define TBO_SADDR    0x1
#define TBO_SFR      0x2
#define TBO_A        0x4
#define TBO_PSW      0x8
#define TBO_HL       0x10

//„«ï call
#define           Form       specflag1

//bit operand
#define         TypeOperand   specflag1
#define         Registr       specflag2
#define         Prepost       specflag3


#define         o_bit       o_idpspec0
//------------------------------------------------------------------------
enum nec_registers { rX, rA, rC, rB, rE, rD, rL, rH, rAX, rBC, rDE, rHL,
                     rPSW, rSP, rS, rCC, rDPR, bCY,
                     Rcs, Rds };

enum bitOper { SADDR=0, SFR, A, PSW, HL, CY};
//------------------------------------------------------------------------
extern char device[];
extern char deviceparams[];

class ioport_bit_t;
const bool nec_find_ioport_bit(int port, int bit);
const ulong Get_Data_16bits();
//------------------------------------------------------------------------
void    header(void);
void    footer(void);

void    segstart(ea_t ea);

int     ana(void);
int     emu(void);
void    out(void);
bool    outop(op_t &op);


#endif

