forked from spc476/mc6809
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmc6809dis.h
77 lines (63 loc) · 2.92 KB
/
mc6809dis.h
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
/********************************************
*
* Copyright 2012 by Sean Conner. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Comments, questions and criticisms can be sent to: sean@conman.org
*
*********************************************/
#ifndef MC6809DIS_H
#define MC6809DIS_H
#include "mc6809.h"
#define MC6809_DIS_DONE MC6809_FAULT_user
/************************************************************************/
typedef struct mc6809dis
{
char addr [ 5];
char opcode [ 5];
char operand [ 7];
char topcode [ 6];
char toperand[19];
char data [32];
struct
{
char h;
char n;
char z;
char v;
char c;
} cc;
mc6809addr__t pc;
mc6809addr__t next;
jmp_buf err;
void *user;
mc6809byte__t (*read) (struct mc6809dis *,mc6809addr__t);
void (*fault)(struct mc6809dis *,mc6809fault__t);
} mc6809dis__t;
/************************************************************************/
extern int mc6809dis_format (mc6809dis__t *,char *,size_t) __attribute__((nonnull));
extern int mc6809dis_registers(mc6809__t *,char *,size_t) __attribute__((nonnull));
extern int mc6809dis_run (mc6809dis__t *,mc6809__t *) __attribute__((nonnull(1)));
extern int mc6809dis_step (mc6809dis__t *,mc6809__t *) __attribute__((nonnull(1)));
extern void mc6809dis_indexed (mc6809dis__t *,mc6809__t *,char const *restrict,char const *restrict,bool) __attribute__((nonnull(1,3,4)));
extern void mc6809dis_immediate(mc6809dis__t *, char const *restrict,char const *restrict,bool) __attribute__((nonnull));
extern void mc6809dis_direct (mc6809dis__t *,mc6809__t *,char const *restrict,char const *restrict,bool) __attribute__((nonnull(1,3,4)));
extern void mc6809dis_extended (mc6809dis__t *,mc6809__t *,char const *restrict,char const *restrict,bool) __attribute__((nonnull(1,3,4)));
extern void mc6809dis_relative (mc6809dis__t *, char const *restrict,char const *restrict) __attribute__((nonnull));
extern void mc6809dis_lrelative(mc6809dis__t *, char const *restrict,char const *restrict) __attribute__((nonnull));
extern void mc6809dis_pshregs (char *,size_t,mc6809byte__t,bool);
extern void mc6809dis_pulregs (char *,size_t,mc6809byte__t,bool);
extern void mc6809dis_cc (char *,size_t,mc6809byte__t);
#endif