-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBreakpoint.cpp
More file actions
57 lines (46 loc) · 1.08 KB
/
Breakpoint.cpp
File metadata and controls
57 lines (46 loc) · 1.08 KB
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
//
// Breakpoint.cpp
// Copyright © 2003 William Sheldon Simms III
//
#include "Breakpoint.h"
Breakpoint::Breakpoint ()
{
flags = 0;
}
Breakpoint::Breakpoint (unsigned short addr)
{
this->wval = addr;
this->flags = bp_PC | bp_equal;
this->enabled = true;
}
Breakpoint::Breakpoint (unsigned short addr, unsigned char byte)
{
this->wval = addr;
this->flags = bp_mem | bp_equal;
this->enabled = true;
}
Breakpoint::Breakpoint (bpflags_t flags, unsigned char byte)
{
this->bval = byte;
this->flags = flags;
this->enabled = true;
}
Breakpoint::Breakpoint (bpflags_t flags, unsigned short addr, unsigned char byte)
{
this->wval = addr;
this->flags = flags;
this->enabled = true;
}
bool Breakpoint::Equals (bpflags_t flags, unsigned short addr, unsigned char byte)
{
if ((this->flags & bp_PC) && (flags & bp_PC))
if (this->wval == addr)
return true;
if ((this->flags & bp_mem) && (flags & bp_mem))
if (this->wval == addr && this->bval == byte)
return true;
if ((this->flags == flags) && this->bval == byte)
return true;
return false;
}
// end