From a42ca0f2dfcdcde9e5aebccc3754e91a8206e1f9 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Thu, 1 Nov 2012 18:05:06 +0900 Subject: [PATCH] =?utf8?q?=E3=83=A1=E3=83=A2=E3=83=AA=E5=86=85=E5=AE=B9?= =?utf8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E6=99=82=E3=81=A8?= =?utf8?q?=E3=80=81SVC=201=E3=81=A7=E6=96=87=E5=AD=97=E3=82=92=E5=87=BA?= =?utf8?q?=E5=8A=9B=E3=81=99=E3=82=8B=E6=99=82=E3=80=81JIS=20X=20201?= =?utf8?q?=E7=89=87=E4=BB=AE=E5=90=8D=E3=82=92=E5=87=BA=E5=8A=9B=E3=81=99?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E4=BB=95=E6=A7=98=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CASL2仕様にそって変更したところ、UTF-8環境では正常に片仮名を表示できないので、 メモリ内容を表示するときの変更についてはブランチで保存 --- src/exec.c | 8 +++-- src/word.c | 2 +- test/system/casl2/cmd_out/0.txt | 54 ++++++++++++++++---------------- test/system/comet2/cmd_out/0.txt | 54 ++++++++++++++++---------------- 4 files changed, 61 insertions(+), 57 deletions(-) diff --git a/src/exec.c b/src/exec.c index 7e7a431..aa99076 100644 --- a/src/exec.c +++ b/src/exec.c @@ -122,9 +122,13 @@ void svcout() setcerr(209, ""); /* SVC output - memory overflow */ return; } - /* 「文字の組」の符号表に記載された文字と、改行(CR)/タブを表示 */ + /* 「JIS X 0201ラテン文字・片仮名用8ビット符号で規定する文字の符号表」 + に記載された文字と、改行(CR)/タブを表示 */ /* それ以外の文字は、「.」で表す */ - if(((w = sys->memory[sys->cpu->gr[1]+i]) >= 0x20 && w <= 0x7E) || w == 0xA || w == '\t') { + if(((w = sys->memory[sys->cpu->gr[1]+i]) >= 0x20 && w <= 0x7E) || /* JIS X 0201ラテン文字 */ + (w >= 0xA0 && w <= 0xFE) || /* JIS X 0201片仮名用8ビット符号 */ + w == 0xA || w == '\t') + { putchar((char)w); } else { putchar('.'); diff --git a/src/word.c b/src/word.c index e355a67..b3fa717 100644 --- a/src/word.c +++ b/src/word.c @@ -142,7 +142,7 @@ void print_dumpword(WORD word, bool logicalmode) } fprintf(stdout, " = #%04X = %s", word, word2bit(word)); /* 「文字の組」の符号表に記載された文字と、改行(CR)/タブを表示 */ - if(word >= 0x20 && word <= 0x7E) { + if((word >= 0x20 && word <= 0x7E) || (word >= 0xA0 && word <= 0xFE)) { fprintf(stdout, " = \'%c\'", word); } else if(word == 0xA) { fprintf(stdout, " = \'\\n\'"); diff --git a/test/system/casl2/cmd_out/0.txt b/test/system/casl2/cmd_out/0.txt index 89e9f01..3d18777 100644 --- a/test/system/casl2/cmd_out/0.txt +++ b/test/system/casl2/cmd_out/0.txt @@ -409,7 +409,7 @@ Executing machine codes #000C: Register:::: #000C: GR0: 0 = #0000 = 0000000000000000 -#000C: GR1: 176 = #00B0 = 0000000010110000 +#000C: GR1: 176 = #00B0 = 0000000010110000 = '°' #000C: GR2: 77 = #004D = 0000000001001101 = 'M' #000C: GR3: 0 = #0000 = 0000000000000000 #000C: GR4: 0 = #0000 = 0000000000000000 @@ -440,8 +440,8 @@ Executing machine codes #000E: Register:::: #000E: GR0: 0 = #0000 = 0000000000000000 -#000E: GR1: 176 = #00B0 = 0000000010110000 -#000E: GR2: 177 = #00B1 = 0000000010110001 +#000E: GR1: 176 = #00B0 = 0000000010110000 = '°' +#000E: GR2: 177 = #00B1 = 0000000010110001 = '±' #000E: GR3: 0 = #0000 = 0000000000000000 #000E: GR4: 0 = #0000 = 0000000000000000 #000E: GR5: 0 = #0000 = 0000000000000000 @@ -472,8 +472,8 @@ Executing machine codes #0010: Register:::: #0010: GR0: 0 = #0000 = 0000000000000000 -#0010: GR1: 176 = #00B0 = 0000000010110000 -#0010: GR2: 177 = #00B1 = 0000000010110001 +#0010: GR1: 176 = #00B0 = 0000000010110000 = '°' +#0010: GR2: 177 = #00B1 = 0000000010110001 = '±' #0010: GR3: 0 = #0000 = 0000000000000000 #0010: GR4: 0 = #0000 = 0000000000000000 #0010: GR5: 0 = #0000 = 0000000000000000 @@ -503,7 +503,7 @@ Executing machine codes #0011: Register:::: #0011: GR0: 0 = #0000 = 0000000000000000 -#0011: GR1: 176 = #00B0 = 0000000010110000 +#0011: GR1: 176 = #00B0 = 0000000010110000 = '°' #0011: GR2: 0 = #0000 = 0000000000000000 #0011: GR3: 0 = #0000 = 0000000000000000 #0011: GR4: 0 = #0000 = 0000000000000000 @@ -720,7 +720,7 @@ Executing machine codes #001E: Register:::: #001E: GR0: 0 = #0000 = 0000000000000000 -#001E: GR1: 178 = #00B2 = 0000000010110010 +#001E: GR1: 178 = #00B2 = 0000000010110010 = '²' #001E: GR2: 110 = #006E = 0000000001101110 = 'n' #001E: GR3: 0 = #0000 = 0000000000000000 #001E: GR4: 0 = #0000 = 0000000000000000 @@ -751,8 +751,8 @@ Executing machine codes #0020: Register:::: #0020: GR0: 0 = #0000 = 0000000000000000 -#0020: GR1: 178 = #00B2 = 0000000010110010 -#0020: GR2: 179 = #00B3 = 0000000010110011 +#0020: GR1: 178 = #00B2 = 0000000010110010 = '²' +#0020: GR2: 179 = #00B3 = 0000000010110011 = '³' #0020: GR3: 0 = #0000 = 0000000000000000 #0020: GR4: 0 = #0000 = 0000000000000000 #0020: GR5: 0 = #0000 = 0000000000000000 @@ -783,8 +783,8 @@ Executing machine codes #0022: Register:::: #0022: GR0: 0 = #0000 = 0000000000000000 -#0022: GR1: 178 = #00B2 = 0000000010110010 -#0022: GR2: 179 = #00B3 = 0000000010110011 +#0022: GR1: 178 = #00B2 = 0000000010110010 = '²' +#0022: GR2: 179 = #00B3 = 0000000010110011 = '³' #0022: GR3: 0 = #0000 = 0000000000000000 #0022: GR4: 0 = #0000 = 0000000000000000 #0022: GR5: 0 = #0000 = 0000000000000000 @@ -814,7 +814,7 @@ Executing machine codes #0023: Register:::: #0023: GR0: 0 = #0000 = 0000000000000000 -#0023: GR1: 178 = #00B2 = 0000000010110010 +#0023: GR1: 178 = #00B2 = 0000000010110010 = '²' #0023: GR2: 0 = #0000 = 0000000000000000 #0023: GR3: 0 = #0000 = 0000000000000000 #0023: GR4: 0 = #0000 = 0000000000000000 @@ -1031,7 +1031,7 @@ Executing machine codes #0030: Register:::: #0030: GR0: 0 = #0000 = 0000000000000000 -#0030: GR1: 180 = #00B4 = 0000000010110100 +#0030: GR1: 180 = #00B4 = 0000000010110100 = '´' #0030: GR2: 143 = #008F = 0000000010001111 #0030: GR3: 0 = #0000 = 0000000000000000 #0030: GR4: 0 = #0000 = 0000000000000000 @@ -1062,8 +1062,8 @@ Executing machine codes #0032: Register:::: #0032: GR0: 0 = #0000 = 0000000000000000 -#0032: GR1: 180 = #00B4 = 0000000010110100 -#0032: GR2: 181 = #00B5 = 0000000010110101 +#0032: GR1: 180 = #00B4 = 0000000010110100 = '´' +#0032: GR2: 181 = #00B5 = 0000000010110101 = 'µ' #0032: GR3: 0 = #0000 = 0000000000000000 #0032: GR4: 0 = #0000 = 0000000000000000 #0032: GR5: 0 = #0000 = 0000000000000000 @@ -1094,8 +1094,8 @@ Executing machine codes #0034: Register:::: #0034: GR0: 0 = #0000 = 0000000000000000 -#0034: GR1: 180 = #00B4 = 0000000010110100 -#0034: GR2: 181 = #00B5 = 0000000010110101 +#0034: GR1: 180 = #00B4 = 0000000010110100 = '´' +#0034: GR2: 181 = #00B5 = 0000000010110101 = 'µ' #0034: GR3: 0 = #0000 = 0000000000000000 #0034: GR4: 0 = #0000 = 0000000000000000 #0034: GR5: 0 = #0000 = 0000000000000000 @@ -1125,7 +1125,7 @@ Executing machine codes #0035: Register:::: #0035: GR0: 0 = #0000 = 0000000000000000 -#0035: GR1: 180 = #00B4 = 0000000010110100 +#0035: GR1: 180 = #00B4 = 0000000010110100 = '´' #0035: GR2: 0 = #0000 = 0000000000000000 #0035: GR3: 0 = #0000 = 0000000000000000 #0035: GR4: 0 = #0000 = 0000000000000000 @@ -1281,7 +1281,7 @@ Executing machine codes #003E: Register:::: #003E: GR0: 0 = #0000 = 0000000000000000 #003E: GR1: 144 = #0090 = 0000000010010000 -#003E: GR2: 175 = #00AF = 0000000010101111 +#003E: GR2: 175 = #00AF = 0000000010101111 = '¯' #003E: GR3: 0 = #0000 = 0000000000000000 #003E: GR4: 0 = #0000 = 0000000000000000 #003E: GR5: 0 = #0000 = 0000000000000000 @@ -1312,7 +1312,7 @@ Executing machine codes `abcdefghijklmnopqrstuvwxyz{|}~#0040: Register:::: #0040: GR0: 0 = #0000 = 0000000000000000 #0040: GR1: 144 = #0090 = 0000000010010000 -#0040: GR2: 175 = #00AF = 0000000010101111 +#0040: GR2: 175 = #00AF = 0000000010101111 = '¯' #0040: GR3: 0 = #0000 = 0000000000000000 #0040: GR4: 0 = #0000 = 0000000000000000 #0040: GR5: 0 = #0000 = 0000000000000000 @@ -1342,8 +1342,8 @@ Executing machine codes #0042: Register:::: #0042: GR0: 0 = #0000 = 0000000000000000 -#0042: GR1: 182 = #00B6 = 0000000010110110 -#0042: GR2: 175 = #00AF = 0000000010101111 +#0042: GR1: 182 = #00B6 = 0000000010110110 = '¶' +#0042: GR2: 175 = #00AF = 0000000010101111 = '¯' #0042: GR3: 0 = #0000 = 0000000000000000 #0042: GR4: 0 = #0000 = 0000000000000000 #0042: GR5: 0 = #0000 = 0000000000000000 @@ -1373,8 +1373,8 @@ Executing machine codes #0044: Register:::: #0044: GR0: 0 = #0000 = 0000000000000000 -#0044: GR1: 182 = #00B6 = 0000000010110110 -#0044: GR2: 183 = #00B7 = 0000000010110111 +#0044: GR1: 182 = #00B6 = 0000000010110110 = '¶' +#0044: GR2: 183 = #00B7 = 0000000010110111 = '·' #0044: GR3: 0 = #0000 = 0000000000000000 #0044: GR4: 0 = #0000 = 0000000000000000 #0044: GR5: 0 = #0000 = 0000000000000000 @@ -1405,8 +1405,8 @@ Executing machine codes #0046: Register:::: #0046: GR0: 0 = #0000 = 0000000000000000 -#0046: GR1: 182 = #00B6 = 0000000010110110 -#0046: GR2: 183 = #00B7 = 0000000010110111 +#0046: GR1: 182 = #00B6 = 0000000010110110 = '¶' +#0046: GR2: 183 = #00B7 = 0000000010110111 = '·' #0046: GR3: 0 = #0000 = 0000000000000000 #0046: GR4: 0 = #0000 = 0000000000000000 #0046: GR5: 0 = #0000 = 0000000000000000 @@ -1436,7 +1436,7 @@ Executing machine codes #0047: Register:::: #0047: GR0: 0 = #0000 = 0000000000000000 -#0047: GR1: 182 = #00B6 = 0000000010110110 +#0047: GR1: 182 = #00B6 = 0000000010110110 = '¶' #0047: GR2: 0 = #0000 = 0000000000000000 #0047: GR3: 0 = #0000 = 0000000000000000 #0047: GR4: 0 = #0000 = 0000000000000000 diff --git a/test/system/comet2/cmd_out/0.txt b/test/system/comet2/cmd_out/0.txt index dc5fb4b..b18c6d8 100644 --- a/test/system/comet2/cmd_out/0.txt +++ b/test/system/comet2/cmd_out/0.txt @@ -189,7 +189,7 @@ Executing machine codes #000C: Register:::: #000C: GR0: 0 = #0000 = 0000000000000000 -#000C: GR1: 176 = #00B0 = 0000000010110000 +#000C: GR1: 176 = #00B0 = 0000000010110000 = '°' #000C: GR2: 77 = #004D = 0000000001001101 = 'M' #000C: GR3: 0 = #0000 = 0000000000000000 #000C: GR4: 0 = #0000 = 0000000000000000 @@ -220,8 +220,8 @@ Executing machine codes #000E: Register:::: #000E: GR0: 0 = #0000 = 0000000000000000 -#000E: GR1: 176 = #00B0 = 0000000010110000 -#000E: GR2: 177 = #00B1 = 0000000010110001 +#000E: GR1: 176 = #00B0 = 0000000010110000 = '°' +#000E: GR2: 177 = #00B1 = 0000000010110001 = '±' #000E: GR3: 0 = #0000 = 0000000000000000 #000E: GR4: 0 = #0000 = 0000000000000000 #000E: GR5: 0 = #0000 = 0000000000000000 @@ -252,8 +252,8 @@ Executing machine codes #0010: Register:::: #0010: GR0: 0 = #0000 = 0000000000000000 -#0010: GR1: 176 = #00B0 = 0000000010110000 -#0010: GR2: 177 = #00B1 = 0000000010110001 +#0010: GR1: 176 = #00B0 = 0000000010110000 = '°' +#0010: GR2: 177 = #00B1 = 0000000010110001 = '±' #0010: GR3: 0 = #0000 = 0000000000000000 #0010: GR4: 0 = #0000 = 0000000000000000 #0010: GR5: 0 = #0000 = 0000000000000000 @@ -283,7 +283,7 @@ Executing machine codes #0011: Register:::: #0011: GR0: 0 = #0000 = 0000000000000000 -#0011: GR1: 176 = #00B0 = 0000000010110000 +#0011: GR1: 176 = #00B0 = 0000000010110000 = '°' #0011: GR2: 0 = #0000 = 0000000000000000 #0011: GR3: 0 = #0000 = 0000000000000000 #0011: GR4: 0 = #0000 = 0000000000000000 @@ -500,7 +500,7 @@ Executing machine codes #001E: Register:::: #001E: GR0: 0 = #0000 = 0000000000000000 -#001E: GR1: 178 = #00B2 = 0000000010110010 +#001E: GR1: 178 = #00B2 = 0000000010110010 = '²' #001E: GR2: 110 = #006E = 0000000001101110 = 'n' #001E: GR3: 0 = #0000 = 0000000000000000 #001E: GR4: 0 = #0000 = 0000000000000000 @@ -531,8 +531,8 @@ Executing machine codes #0020: Register:::: #0020: GR0: 0 = #0000 = 0000000000000000 -#0020: GR1: 178 = #00B2 = 0000000010110010 -#0020: GR2: 179 = #00B3 = 0000000010110011 +#0020: GR1: 178 = #00B2 = 0000000010110010 = '²' +#0020: GR2: 179 = #00B3 = 0000000010110011 = '³' #0020: GR3: 0 = #0000 = 0000000000000000 #0020: GR4: 0 = #0000 = 0000000000000000 #0020: GR5: 0 = #0000 = 0000000000000000 @@ -563,8 +563,8 @@ Executing machine codes #0022: Register:::: #0022: GR0: 0 = #0000 = 0000000000000000 -#0022: GR1: 178 = #00B2 = 0000000010110010 -#0022: GR2: 179 = #00B3 = 0000000010110011 +#0022: GR1: 178 = #00B2 = 0000000010110010 = '²' +#0022: GR2: 179 = #00B3 = 0000000010110011 = '³' #0022: GR3: 0 = #0000 = 0000000000000000 #0022: GR4: 0 = #0000 = 0000000000000000 #0022: GR5: 0 = #0000 = 0000000000000000 @@ -594,7 +594,7 @@ Executing machine codes #0023: Register:::: #0023: GR0: 0 = #0000 = 0000000000000000 -#0023: GR1: 178 = #00B2 = 0000000010110010 +#0023: GR1: 178 = #00B2 = 0000000010110010 = '²' #0023: GR2: 0 = #0000 = 0000000000000000 #0023: GR3: 0 = #0000 = 0000000000000000 #0023: GR4: 0 = #0000 = 0000000000000000 @@ -811,7 +811,7 @@ Executing machine codes #0030: Register:::: #0030: GR0: 0 = #0000 = 0000000000000000 -#0030: GR1: 180 = #00B4 = 0000000010110100 +#0030: GR1: 180 = #00B4 = 0000000010110100 = '´' #0030: GR2: 143 = #008F = 0000000010001111 #0030: GR3: 0 = #0000 = 0000000000000000 #0030: GR4: 0 = #0000 = 0000000000000000 @@ -842,8 +842,8 @@ Executing machine codes #0032: Register:::: #0032: GR0: 0 = #0000 = 0000000000000000 -#0032: GR1: 180 = #00B4 = 0000000010110100 -#0032: GR2: 181 = #00B5 = 0000000010110101 +#0032: GR1: 180 = #00B4 = 0000000010110100 = '´' +#0032: GR2: 181 = #00B5 = 0000000010110101 = 'µ' #0032: GR3: 0 = #0000 = 0000000000000000 #0032: GR4: 0 = #0000 = 0000000000000000 #0032: GR5: 0 = #0000 = 0000000000000000 @@ -874,8 +874,8 @@ Executing machine codes #0034: Register:::: #0034: GR0: 0 = #0000 = 0000000000000000 -#0034: GR1: 180 = #00B4 = 0000000010110100 -#0034: GR2: 181 = #00B5 = 0000000010110101 +#0034: GR1: 180 = #00B4 = 0000000010110100 = '´' +#0034: GR2: 181 = #00B5 = 0000000010110101 = 'µ' #0034: GR3: 0 = #0000 = 0000000000000000 #0034: GR4: 0 = #0000 = 0000000000000000 #0034: GR5: 0 = #0000 = 0000000000000000 @@ -905,7 +905,7 @@ Executing machine codes #0035: Register:::: #0035: GR0: 0 = #0000 = 0000000000000000 -#0035: GR1: 180 = #00B4 = 0000000010110100 +#0035: GR1: 180 = #00B4 = 0000000010110100 = '´' #0035: GR2: 0 = #0000 = 0000000000000000 #0035: GR3: 0 = #0000 = 0000000000000000 #0035: GR4: 0 = #0000 = 0000000000000000 @@ -1061,7 +1061,7 @@ Executing machine codes #003E: Register:::: #003E: GR0: 0 = #0000 = 0000000000000000 #003E: GR1: 144 = #0090 = 0000000010010000 -#003E: GR2: 175 = #00AF = 0000000010101111 +#003E: GR2: 175 = #00AF = 0000000010101111 = '¯' #003E: GR3: 0 = #0000 = 0000000000000000 #003E: GR4: 0 = #0000 = 0000000000000000 #003E: GR5: 0 = #0000 = 0000000000000000 @@ -1092,7 +1092,7 @@ Executing machine codes `abcdefghijklmnopqrstuvwxyz{|}~#0040: Register:::: #0040: GR0: 0 = #0000 = 0000000000000000 #0040: GR1: 144 = #0090 = 0000000010010000 -#0040: GR2: 175 = #00AF = 0000000010101111 +#0040: GR2: 175 = #00AF = 0000000010101111 = '¯' #0040: GR3: 0 = #0000 = 0000000000000000 #0040: GR4: 0 = #0000 = 0000000000000000 #0040: GR5: 0 = #0000 = 0000000000000000 @@ -1122,8 +1122,8 @@ Executing machine codes #0042: Register:::: #0042: GR0: 0 = #0000 = 0000000000000000 -#0042: GR1: 182 = #00B6 = 0000000010110110 -#0042: GR2: 175 = #00AF = 0000000010101111 +#0042: GR1: 182 = #00B6 = 0000000010110110 = '¶' +#0042: GR2: 175 = #00AF = 0000000010101111 = '¯' #0042: GR3: 0 = #0000 = 0000000000000000 #0042: GR4: 0 = #0000 = 0000000000000000 #0042: GR5: 0 = #0000 = 0000000000000000 @@ -1153,8 +1153,8 @@ Executing machine codes #0044: Register:::: #0044: GR0: 0 = #0000 = 0000000000000000 -#0044: GR1: 182 = #00B6 = 0000000010110110 -#0044: GR2: 183 = #00B7 = 0000000010110111 +#0044: GR1: 182 = #00B6 = 0000000010110110 = '¶' +#0044: GR2: 183 = #00B7 = 0000000010110111 = '·' #0044: GR3: 0 = #0000 = 0000000000000000 #0044: GR4: 0 = #0000 = 0000000000000000 #0044: GR5: 0 = #0000 = 0000000000000000 @@ -1185,8 +1185,8 @@ Executing machine codes #0046: Register:::: #0046: GR0: 0 = #0000 = 0000000000000000 -#0046: GR1: 182 = #00B6 = 0000000010110110 -#0046: GR2: 183 = #00B7 = 0000000010110111 +#0046: GR1: 182 = #00B6 = 0000000010110110 = '¶' +#0046: GR2: 183 = #00B7 = 0000000010110111 = '·' #0046: GR3: 0 = #0000 = 0000000000000000 #0046: GR4: 0 = #0000 = 0000000000000000 #0046: GR5: 0 = #0000 = 0000000000000000 @@ -1216,7 +1216,7 @@ Executing machine codes #0047: Register:::: #0047: GR0: 0 = #0000 = 0000000000000000 -#0047: GR1: 182 = #00B6 = 0000000010110110 +#0047: GR1: 182 = #00B6 = 0000000010110110 = '¶' #0047: GR2: 0 = #0000 = 0000000000000000 #0047: GR3: 0 = #0000 = 0000000000000000 #0047: GR4: 0 = #0000 = 0000000000000000 -- 2.18.0