mirror of
https://github.com/ksherlock/wdc-utils.git
synced 2024-12-12 04:29:05 +00:00
process -> code.
This commit is contained in:
parent
fbd4fad488
commit
a2bc0d353c
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ CC=c++ -std=c++11 -g
|
||||
CXX=c++ -std=c++11 -g
|
||||
OBJS = dumpobj.o disasm.o
|
||||
|
||||
dumpobj : dumpobj.o disasm.o disassembler.o
|
||||
dumpobj : dumpobj.o disassembler.o
|
||||
|
||||
disassembler.o : disassembler.cpp disassembler.h
|
||||
dumpobj.o : dumpobj.cpp disassembler.h
|
||||
|
@ -364,7 +364,7 @@ void disassembler::dump(const std::string &expr, unsigned size) {
|
||||
reset();
|
||||
}
|
||||
|
||||
void disassembler::process(const std::string &expr, unsigned size) {
|
||||
void disassembler::code(const std::string &expr, unsigned size) {
|
||||
if (_st != 1 || size != _size) {
|
||||
dump(expr, size);
|
||||
return;
|
||||
@ -377,7 +377,7 @@ void disassembler::flush() {
|
||||
if (_st) dump();
|
||||
}
|
||||
|
||||
void disassembler::process(uint8_t byte) {
|
||||
void disassembler::code(uint8_t byte) {
|
||||
_bytes[_st++] = byte;
|
||||
if (_st == 1) {
|
||||
_op = byte;
|
||||
|
@ -9,14 +9,14 @@ class disassembler {
|
||||
public:
|
||||
disassembler() = default;
|
||||
|
||||
void process(uint8_t byte);
|
||||
void process(const std::string &expr, unsigned size);
|
||||
void code(uint8_t byte);
|
||||
void code(const std::string &expr, unsigned size);
|
||||
|
||||
template<class Iter>
|
||||
void process(Iter begin, Iter end) { while (begin != end) process(*begin++); }
|
||||
void code(Iter begin, Iter end) { while (begin != end) code(*begin++); }
|
||||
|
||||
template<class T>
|
||||
void process(const T &t) { process(std::begin(t), std::end(t)); }
|
||||
void code(const T &t) { code(std::begin(t), std::end(t)); }
|
||||
|
||||
bool m() const { return _flags & 0x20; }
|
||||
bool x() const { return _flags & 0x10; }
|
||||
|
@ -278,7 +278,7 @@ void dump_obj(const char *name, int fd)
|
||||
if (op < 0xf0) {
|
||||
auto end = iter + op;
|
||||
while (iter != end) {
|
||||
d.process(*iter++);
|
||||
d.code(*iter++);
|
||||
place_labels(labels, d.pc());
|
||||
}
|
||||
continue;
|
||||
@ -357,7 +357,7 @@ void dump_obj(const char *name, int fd)
|
||||
}
|
||||
}
|
||||
if (stack.size() != 1) errx(EX_DATAERR, "%s stack overflow error.", name);
|
||||
d.process(stack.front(), bytes);
|
||||
d.code(stack.front(), bytes);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user