add a basic structure for disassembler + executor
Instructions added Branch and Exchange (BX) Branch and Link (B) Multiply and Accumulate (MUL, MLA) Multiply Long and Accumulate (SMULL, SMLAL, UMULL, UMLAL) Single data swap (SWP) [WIP] Halfword Transfer (STRH, LDRH) Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
34
src/cpu/utility.cc
Normal file
34
src/cpu/utility.cc
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "utility.hh"
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const Condition cond) {
|
||||
|
||||
#define CASE(cond) \
|
||||
case Condition::cond: \
|
||||
os << #cond; \
|
||||
break;
|
||||
|
||||
switch (cond) {
|
||||
CASE(EQ)
|
||||
CASE(NE)
|
||||
CASE(CS)
|
||||
CASE(CC)
|
||||
CASE(MI)
|
||||
CASE(PL)
|
||||
CASE(VS)
|
||||
CASE(VC)
|
||||
CASE(HI)
|
||||
CASE(LS)
|
||||
CASE(GE)
|
||||
CASE(LT)
|
||||
CASE(GT)
|
||||
CASE(LE)
|
||||
case Condition::AL: {
|
||||
// empty
|
||||
}
|
||||
}
|
||||
|
||||
#undef CASE
|
||||
|
||||
return os;
|
||||
}
|
Reference in New Issue
Block a user