File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -670,6 +670,19 @@ std::string word_iso_string(Word w)
670
670
return buf.str ();
671
671
}
672
672
673
+ //
674
+ // Decode word as 8 characters in TEXT format.
675
+ //
676
+ std::string word_text_string (Word w)
677
+ {
678
+ std::ostringstream buf;
679
+ for (int shift = 42 ; shift >= 0 ; shift -= 6 ) {
680
+ unsigned ch = text_to_unicode (w >> shift);
681
+ utf8_putc (ch, buf);
682
+ }
683
+ return buf.str ();
684
+ }
685
+
673
686
//
674
687
// Decode word as filename in ISO format.
675
688
// Remove trailing spaces, convert to lowercase.
Original file line number Diff line number Diff line change @@ -339,6 +339,11 @@ std::string tape_name_string(Word w);
339
339
//
340
340
std::string word_iso_string (Word w);
341
341
342
+ //
343
+ // Decode word as string in TEXT format.
344
+ //
345
+ std::string word_text_string (Word w);
346
+
342
347
//
343
348
// Decode word as filename in ISO format.
344
349
// Remove trailing spaces, convert to lowercase.
Original file line number Diff line number Diff line change 34
34
#include < vector>
35
35
36
36
#include " machine.h"
37
- #include " encoding.h"
38
37
39
38
//
40
39
// Internal implementation of the simulation session, hidden from user.
@@ -266,14 +265,7 @@ class Session::Hidden {
266
265
}
267
266
Word location = machine.mem_load (BASE + addr + 1 );
268
267
269
- out << (char )std::tolower (text_to_unicode (name >> 42 ))
270
- << (char )std::tolower (text_to_unicode (name >> 36 ))
271
- << (char )std::tolower (text_to_unicode (name >> 30 ))
272
- << (char )std::tolower (text_to_unicode (name >> 24 ))
273
- << (char )std::tolower (text_to_unicode (name >> 18 ))
274
- << (char )std::tolower (text_to_unicode (name >> 12 ))
275
- << (char )std::tolower (text_to_unicode (name >> 6 ))
276
- << (char )std::tolower (text_to_unicode (name)) << " " ;
268
+ out << word_text_string (name) << " " ;
277
269
besm6_print_word_octal (out, location);
278
270
out << std::endl;
279
271
}
You can’t perform that action at this time.
0 commit comments