diff options
Diffstat (limited to 'tools/preproc/preproc.cpp')
-rw-r--r-- | tools/preproc/preproc.cpp | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/tools/preproc/preproc.cpp b/tools/preproc/preproc.cpp index 1dd6808c3..38ae762ea 100644 --- a/tools/preproc/preproc.cpp +++ b/tools/preproc/preproc.cpp @@ -27,6 +27,22 @@ Charmap* g_charmap; +void PrintAsmBytes(unsigned char *s, int length) +{ + if (length > 0) + { + printf("\t.byte "); + for (int i = 0; i < length; i++) + { + printf("0x%02X", s[i]); + + if (i < length - 1) + printf(", "); + } + putchar('\n'); + } +} + void PreprocAsmFile(std::string filename) { std::stack<AsmFile> stack; @@ -57,19 +73,14 @@ void PreprocAsmFile(std::string filename) { unsigned char s[kMaxStringLength]; int length = stack.top().ReadString(s); - - if (length > 0) - { - printf("\t.byte "); - for (int i = 0; i < length; i++) - { - printf("0x%02X", s[i]); - - if (i < length - 1) - printf(", "); - } - putchar('\n'); - } + PrintAsmBytes(s, length); + break; + } + case Directive::Braille: + { + unsigned char s[kMaxStringLength]; + int length = stack.top().ReadBraille(s); + PrintAsmBytes(s, length); break; } case Directive::Unknown: |