Files
Work/as68hc11/MODE.CPP
2024-08-07 09:12:07 -04:00

21 lines
725 B
C++

#include <as68hc11/mode.hpp>
#include <common/stdio.hpp>
AddressMode::operator String(void)
{
String strString;
String strAttribute;
if(Inherent==attribute())strAttribute="Inherent ";
else if(Immediate==attribute())strAttribute="Immediate";
else if(Direct==attribute())strAttribute="Direct ";
else if(Extended==attribute())strAttribute="Extended ";
else if(Indexed==attribute())strAttribute="Indexed ";
else if(Relative==attribute())strAttribute="Relative ";
else strAttribute="Unknown";
if(prebyte())::sprintf(strString,"\topcode:0x%02lx prebyte:0x%02lx",int(opcode()),int(prebyte()));
else ::sprintf(strString,"\topcode:0x%02lx",int(opcode()));
strAttribute+=String(" ")+strString;
return strAttribute;
}