MYCPU80でCP/Mを!
超巨大基板の8080互換HCMOS・CPUでCP/Mを走らせてしまおうという、なんとも狂気なプロジェクトです!
[第130回]
●エスケープシーケンス
エスケープシーケンスについてはまだテストをしていなかったことに気が付きました。
エスケープシーケンスは「ワンボードマイコンでCP/Mを!」[第426回]でテストをしています。
そこではZB3BASICとCP/M互換DOSの両方でテストをしました。
CP/M互換DOSのテストプログラムはESCT3CPMです。
いつものようにESCT3CPMのソースプログラムをインテルニーモニックに書き直してMESCT3Cを作りました。
●テストプログラムMESCT3C
MESCT3Cのソースプログラムです。
; ESC[2J clear screen test ;ESC[xm color disp test ;2013/6/23 6/26 ; ORG $0100 FCALL=$0005 ; LXI D,LIST1 MVI C,09 CALL FCALL MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,LIST2 MVI C,09 CALL FCALL LXI D,LIST3 MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGBLUE MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BLACK MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGWHITE MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,RED MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,GREEN MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGMAGENTA MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,YELLOW MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGGREEN MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BLUE MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGCYAN MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,MAGENTA MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGYELLOW MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,CYAN MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,WHITE MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,STNDRD MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGRED MVI C,09 CALL FCALL ; MVI E,1B;ESC MVI C,02 CALL FCALL LXI D,BGSTNDRD MVI C,09 CALL FCALL RET ; LIST1:"*** " "ESC " "clea" "r sc" "reen" " tes" "t **" "*$" LIST2:"[2J$" LIST3:"*** " "ESC[" "2J " "clea" "r sc" "reen" " tes" "t en" "d **" "*" DB 0D DB 0A DB 24 ; BLACK:"[30m" "COLO" "R" DB 3D;= "BLAC" "K $" RED:"[31m" "COLO" "R" DB 3D;= "RED" " $" GREEN:"[32m" "COLO" "R" DB 3D;= "GRE" "EN " "$" YELLOW:"[33m" "COLO" "R" DB 3D;= "YEL" "LOW " " $" BLUE:"[34m" "COLO" "R" DB 3D;= "BLU" "E $" MAGENTA:"[35m" "COLO" "R" DB 3D;= "MAG" "ENTA" " $" CYAN:"[36m" "COLO" "R" DB 3D;= "CYA" "N $" WHITE:"[37m" "COLO" "R" DB 3D;= "WHIT" "E $" STNDRD:"[39m" "COLO" "R" DB 3D;= "STAN" "DARD" " $" BGBLACK:"[40m" "BGCO" "LOR" DB 3D;= "BLAC" "K $" BGRED:"[41m" "BGCO" "LOR" DB 3D;= "RED" " $" BGGREEN:"[42m" "BGCO" "LOR" DB 3D;= "GRE" "EN " "$" BGYELLOW:"[43m" "BGCO" "LOR" DB 3D;= "YEL" "LOW " " $" BGBLUE:"[44m" "BGCO" "LOR" DB 3D;= "BLU" "E $" BGMAGENTA:"[45m" "BGCO" "LOR" DB 3D;= "MAG" "ENTA" " $" BGCYAN:"[46m" "BGCO" "LOR" DB 3D;= "CYA" "N $" BGWHITE:"[47m" "BGCO" "LOR" DB 3D;= "WHIT" "E $" BGSTNDRD:"[49m" "BGCO" "LOR" DB 3D;= "STAN" "DARD" " $" ; |
2015/2/3 18:37 mesct3c.txt END=03C1 ; ESC[2J clear screen test ;ESC[xm color disp test ;2013/6/23 6/26 ; ORG $0100 FCALL=$0005 ; 0100 111F02 LXI D,LIST1 0103 0E09 MVI C,09 0105 CD0500 CALL FCALL 0108 1E1B MVI E,1B;ESC 010A 0E02 MVI C,02 010C CD0500 CALL FCALL 010F 113D02 LXI D,LIST2 0112 0E09 MVI C,09 0114 CD0500 CALL FCALL 0117 114102 LXI D,LIST3 011A 0E09 MVI C,09 011C CD0500 CALL FCALL ; 011F 1E1B MVI E,1B;ESC 0121 0E02 MVI C,02 0123 CD0500 CALL FCALL 0126 115B03 LXI D,BGBLUE 0129 0E09 MVI C,09 012B CD0500 CALL FCALL ; 012E 1E1B MVI E,1B;ESC 0130 0E02 MVI C,02 0132 CD0500 CALL FCALL 0135 116802 LXI D,BLACK 0138 0E09 MVI C,09 013A CD0500 CALL FCALL ; 013D 1E1B MVI E,1B;ESC 013F 0E02 MVI C,02 0141 CD0500 CALL FCALL 0144 119703 LXI D,BGWHITE 0147 0E09 MVI C,09 0149 CD0500 CALL FCALL ; 014C 1E1B MVI E,1B;ESC 014E 0E02 MVI C,02 0150 CD0500 CALL FCALL 0153 117A02 LXI D,RED 0156 0E09 MVI C,09 0158 CD0500 CALL FCALL ; 015B 1E1B MVI E,1B;ESC 015D 0E02 MVI C,02 015F CD0500 CALL FCALL 0162 118A02 LXI D,GREEN 0165 0E09 MVI C,09 0167 CD0500 CALL FCALL ; 016A 1E1B MVI E,1B;ESC 016C 0E02 MVI C,02 016E CD0500 CALL FCALL 0171 116E03 LXI D,BGMAGENTA 0174 0E09 MVI C,09 0176 CD0500 CALL FCALL ; 0179 1E1B MVI E,1B;ESC 017B 0E02 MVI C,02 017D CD0500 CALL FCALL 0180 119C02 LXI D,YELLOW 0183 0E09 MVI C,09 0185 CD0500 CALL FCALL ; 0188 1E1B MVI E,1B;ESC 018A 0E02 MVI C,02 018C CD0500 CALL FCALL 018F 113203 LXI D,BGGREEN 0192 0E09 MVI C,09 0194 CD0500 CALL FCALL ; 0197 1E1B MVI E,1B;ESC 0199 0E02 MVI C,02 019B CD0500 CALL FCALL 019E 11AF02 LXI D,BLUE 01A1 0E09 MVI C,09 01A3 CD0500 CALL FCALL ; 01A6 1E1B MVI E,1B;ESC 01A8 0E02 MVI C,02 01AA CD0500 CALL FCALL 01AD 118403 LXI D,BGCYAN 01B0 0E09 MVI C,09 01B2 CD0500 CALL FCALL ; 01B5 1E1B MVI E,1B;ESC 01B7 0E02 MVI C,02 01B9 CD0500 CALL FCALL 01BC 11C002 LXI D,MAGENTA 01BF 0E09 MVI C,09 01C1 CD0500 CALL FCALL ; 01C4 1E1B MVI E,1B;ESC 01C6 0E02 MVI C,02 01C8 CD0500 CALL FCALL 01CB 114603 LXI D,BGYELLOW 01CE 0E09 MVI C,09 01D0 CD0500 CALL FCALL ; 01D3 1E1B MVI E,1B;ESC 01D5 0E02 MVI C,02 01D7 CD0500 CALL FCALL 01DA 11D402 LXI D,CYAN 01DD 0E09 MVI C,09 01DF CD0500 CALL FCALL ; 01E2 1E1B MVI E,1B;ESC 01E4 0E02 MVI C,02 01E6 CD0500 CALL FCALL 01E9 11E502 LXI D,WHITE 01EC 0E09 MVI C,09 01EE CD0500 CALL FCALL ; 01F1 1E1B MVI E,1B;ESC 01F3 0E02 MVI C,02 01F5 CD0500 CALL FCALL 01F8 11F702 LXI D,STNDRD 01FB 0E09 MVI C,09 01FD CD0500 CALL FCALL ; 0200 1E1B MVI E,1B;ESC 0202 0E02 MVI C,02 0204 CD0500 CALL FCALL 0207 112003 LXI D,BGRED 020A 0E09 MVI C,09 020C CD0500 CALL FCALL ; 020F 1E1B MVI E,1B;ESC 0211 0E02 MVI C,02 0213 CD0500 CALL FCALL 0216 11AB03 LXI D,BGSTNDRD 0219 0E09 MVI C,09 021B CD0500 CALL FCALL 021E C9 RET ; 021F 2A2A2A20 LIST1:"*** " 0223 45534320 "ESC " 0227 636C6561 "clea" 022B 72207363 "r sc" 022F 7265656E "reen" 0233 20746573 " tes" 0237 74202A2A "t **" 023B 2A24 "*$" 023D 5B324A24 LIST2:"[2J$" 0241 2A2A2A20 LIST3:"*** " 0245 4553435B "ESC[" 0249 324A20 "2J " 024C 636C6561 "clea" 0250 72207363 "r sc" 0254 7265656E "reen" 0258 20746573 " tes" 025C 7420656E "t en" 0260 64202A2A "d **" 0264 2A "*" 0265 0D DB 0D 0266 0A DB 0A 0267 24 DB 24 ; 0268 5B33306D BLACK:"[30m" 026C 434F4C4F "COLO" 0270 52 "R" 0271 3D DB 3D;= 0272 424C4143 "BLAC" 0276 4B202024 "K $" 027A 5B33316D RED:"[31m" 027E 434F4C4F "COLO" 0282 52 "R" 0283 3D DB 3D;= 0284 524544 "RED" 0287 202024 " $" 028A 5B33326D GREEN:"[32m" 028E 434F4C4F "COLO" 0292 52 "R" 0293 3D DB 3D;= 0294 475245 "GRE" 0297 454E2020 "EN " 029B 24 "$" 029C 5B33336D YELLOW:"[33m" 02A0 434F4C4F "COLO" 02A4 52 "R" 02A5 3D DB 3D;= 02A6 59454C "YEL" 02A9 4C4F5720 "LOW " 02AD 2024 " $" 02AF 5B33346D BLUE:"[34m" 02B3 434F4C4F "COLO" 02B7 52 "R" 02B8 3D DB 3D;= 02B9 424C55 "BLU" 02BC 45202024 "E $" 02C0 5B33356D MAGENTA:"[35m" 02C4 434F4C4F "COLO" 02C8 52 "R" 02C9 3D DB 3D;= 02CA 4D4147 "MAG" 02CD 454E5441 "ENTA" 02D1 202024 " $" 02D4 5B33366D CYAN:"[36m" 02D8 434F4C4F "COLO" 02DC 52 "R" 02DD 3D DB 3D;= 02DE 435941 "CYA" 02E1 4E202024 "N $" 02E5 5B33376D WHITE:"[37m" 02E9 434F4C4F "COLO" 02ED 52 "R" 02EE 3D DB 3D;= 02EF 57484954 "WHIT" 02F3 45202024 "E $" 02F7 5B33396D STNDRD:"[39m" 02FB 434F4C4F "COLO" 02FF 52 "R" 0300 3D DB 3D;= 0301 5354414E "STAN" 0305 44415244 "DARD" 0309 202024 " $" 030C 5B34306D BGBLACK:"[40m" 0310 4247434F "BGCO" 0314 4C4F52 "LOR" 0317 3D DB 3D;= 0318 424C4143 "BLAC" 031C 4B202024 "K $" 0320 5B34316D BGRED:"[41m" 0324 4247434F "BGCO" 0328 4C4F52 "LOR" 032B 3D DB 3D;= 032C 524544 "RED" 032F 202024 " $" 0332 5B34326D BGGREEN:"[42m" 0336 4247434F "BGCO" 033A 4C4F52 "LOR" 033D 3D DB 3D;= 033E 475245 "GRE" 0341 454E2020 "EN " 0345 24 "$" 0346 5B34336D BGYELLOW:"[43m" 034A 4247434F "BGCO" 034E 4C4F52 "LOR" 0351 3D DB 3D;= 0352 59454C "YEL" 0355 4C4F5720 "LOW " 0359 2024 " $" 035B 5B34346D BGBLUE:"[44m" 035F 4247434F "BGCO" 0363 4C4F52 "LOR" 0366 3D DB 3D;= 0367 424C55 "BLU" 036A 45202024 "E $" 036E 5B34356D BGMAGENTA:"[45m" 0372 4247434F "BGCO" 0376 4C4F52 "LOR" 0379 3D DB 3D;= 037A 4D4147 "MAG" 037D 454E5441 "ENTA" 0381 202024 " $" 0384 5B34366D BGCYAN:"[46m" 0388 4247434F "BGCO" 038C 4C4F52 "LOR" 038F 3D DB 3D;= 0390 435941 "CYA" 0393 4E202024 "N $" 0397 5B34376D BGWHITE:"[47m" 039B 4247434F "BGCO" 039F 4C4F52 "LOR" 03A2 3D DB 3D;= 03A3 57484954 "WHIT" 03A7 45202024 "E $" 03AB 5B34396D BGSTNDRD:"[49m" 03AF 4247434F "BGCO" 03B3 4C4F52 "LOR" 03B6 3D DB 3D;= 03B7 5354414E "STAN" 03BB 44415244 "DARD" 03BF 202024 " $" ; BGBLACK =030C BGBLUE =035B BGCYAN =0384 BGGREEN =0332 BGMAGENTA =036E BGRED =0320 BGSTNDRD =03AB BGWHITE =0397 BGYELLOW =0346 BLACK =0268 BLUE =02AF CYAN =02D4 FCALL =0005 GREEN =028A LIST1 =021F LIST2 =023D LIST3 =0241 MAGENTA =02C0 RED =027A STNDRD =02F7 WHITE =02E5 YELLOW =029C |
10 A=0 20 PRINT "*** ESC clear screen test ***" 30 PRINT CHR$($1B);"[2J"; 40 PRINT "*** ESC[2J clear screen test end ***" 50 PRINT "** ESC[nm color test ***" 60 PRINT CHR$($1B);"[44m"; 70 PRINT "BACKGROUNDCOLOR=BLUE "; 80 PRINT CHR$($1B);"[30m"; 90 PRINT "COLOR=BLACK "; 100 PRINT CHR$($1B);"[47m"; 110 PRINT "BACKGROUNDCOLOR=WHITE "; 120 PRINT CHR$($1B);"[31m"; 130 PRINT "COLOR=RED "; 140 PRINT CHR$($1B);"[32m"; 150 PRINT "COLOR=GREEN "; 160 PRINT CHR$($1B);"[45m"; 170 PRINT "BACKGROUNDCOLOR=MAGENTA "; 180 PRINT CHR$($1B);"[33m"; 190 PRINT "COLOR=YELLOW "; 200 PRINT CHR$($1B);"[42m"; 210 PRINT "BACKGROUNDCOLOR=GREEN "; 220 PRINT CHR$($1B);"[34m"; 230 PRINT "COLOR=BLUE "; 240 PRINT CHR$($1B);"[46m"; 250 PRINT "BACKGROUNDCOLOR=CYAN "; 260 PRINT CHR$($1B);"[35m"; 270 PRINT "COLOR=MAGENTA "; 280 PRINT CHR$($1B);"[43m"; 290 PRINT "BACKGROUNDCOLOR=YELLOW "; 300 PRINT CHR$($1B);"[36m"; 310 PRINT "COLOR=CYAN "; 320 PRINT CHR$($1B);"[37m"; 330 PRINT "COLOR=WHITE "; 340 PRINT CHR$($1B);"[39m"; 350 PRINT "COLOR=STANDARD "; 360 PRINT CHR$($1B);"[41m"; 370 PRINT "BACKGROUNDCOLOR=RED "; 380 PRINT CHR$($1B);"[49m"; 390 PRINT "BACKGROUNDCOLOR=STANDARD "; |