13namespace vc64::peddle {
20struct Ins { u8 raw; };
23struct Imm { u8 raw; };
25struct Zpx { u8 raw; };
26struct Zpy { u8 raw; };
27struct Abs { u16 raw; };
28struct Absx { u16 raw; };
29struct Absy { u16 raw; };
30struct Ind { u16 raw; };
31struct Indx { u8 raw; };
32struct Indy { u8 raw; };
33struct Rel { u16 raw; };
34struct Dir { u16 raw; };
50 const DasmStyle &style;
54 StrWriter(
char *p,
const DasmStyle &style) : style(style) {
59 isize length() {
return isize(ptr - base); }
60 void fill(isize tab) {
while (ptr < base + tab) *ptr++ =
' '; }
64 isize decDigits(u64 value) {
return value ? 1 + (isize)log10(value) : 1; }
65 isize binDigits(u64 value) {
return value ? 1 + (isize)log2(value) : 1; }
66 isize hexDigits(u64 value) {
return (binDigits(value) + 3) / 4; }
68 void sprintd(
char *&s, u64 value, isize digits);
69 void sprintd(
char *&s, u64 value);
70 void sprintx(
char *&s, u64 value, isize digits);
71 void sprintx(
char *&s, u64 value);
75 StrWriter& operator<<(
char);
76 StrWriter& operator<<(
const char *);
77 StrWriter& operator<<(u8);
78 StrWriter& operator<<(u16);
80 StrWriter& operator<<(Ins);
81 StrWriter& operator<<(Imm);
82 StrWriter& operator<<(Zp);
83 StrWriter& operator<<(Zpx);
84 StrWriter& operator<<(Zpy);
85 StrWriter& operator<<(Abs);
86 StrWriter& operator<<(Absx);
87 StrWriter& operator<<(Absy);
88 StrWriter& operator<<(Ind);
89 StrWriter& operator<<(Indx);
90 StrWriter& operator<<(Indy);
91 StrWriter& operator<<(Rel);
92 StrWriter& operator<<(Dir);
94 StrWriter& operator<<(Tab);
95 StrWriter& operator<<(Sep);
97 StrWriter& operator<<(Fin);