You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <wchar.h>
// Change to wide character buffer
wchar_t sym_buf[sym_length_max];
wchar_t *sym_ptr;
// Example function update for reading wide characters
wchar_t read_wchar() {
wchar_t wc;
if (fgetwc(mmo_file, &wc) != 1) {
fprintf(stderr, "Unexpected end of file after %d characters!\n", count);
exit(-3);
}
return wc;
}
// Update the print function
void print_stab() {
register int m = read_byte();
register wchar_t c;
if (m & 0x40) print_stab();
if (m & 0x2f) {
c = read_wchar();
*sym_ptr++ = c;
if (sym_ptr == &sym_buf[sym_length_max]) {
fwprintf(stderr, L"Oops, the symbol is too long!\n");
exit(-7);
}
if (m & 0xf) {
// Update printing logic for wide characters
*sym_ptr = L'\0';
fwprintf(stdout, L" %ls (%d)\n", sym_buf, m & 0xf);
}
if (m & 0x20) print_stab();
sym_ptr--;
}
if (m & 0x10) print_stab();
}
At various places in the MMIX sources, Don Knuth asks the interested reader to make significant changes for advanced system features:
MMIXAL
-style expressions for interactive debugging (MMIX-SIM§24)Time permitting, I'll try to look up the relevant sections in the codes.
The text was updated successfully, but these errors were encountered: