復活!CP/M ワンボードマイコンでCP/Mを!
CP/MがTK−80互換のワンボードマイコンの上で復活します
ND80ZVとMYCPU80の上でCP/Mが走ります!
[第422回]
●/BAT使用例
前回は、ZB3DOS(CP/M互換DOS)では諸般の事情からSUBMIT(CP/Mのバッチ処理機能)は使えませんが、その代わりに/BATを使ってください、と書きました。
/BATはZB3DOSのバッチ処理コマンドです。
SUBMITはCP/Mのコマンドですから、当然のことながらCP/M上でしか使えません。
しかし/BATはZB3BASICのコマンドですから、ZB3BASICを起動したあとは、それ以後の全ての機能をバッチ処理することができます。
その実例は[第390回]でお見せしましたが、先日、大分県のH様がトランジェントコマンドの評価テストをバッチファイルを作成して行なわれて、その結果をメールに添付して送っていただきました。
拝見させていただきましたところ、ZB3DOSの評価テストの結果であるとともに、/BATのよい使用例であると思いましたので、H様にお願いしましてHP上で公開させていただくことをご承諾いただきました。
下がお送りいただいたログファイルです。
MBASICの動作テストです。
logfile nd80zlog\06191402.txt open ND80ZVに接続しました 0001 0000 - Z 1000 00C3 - *** nd80z3 basic **** >/BAT MBASIC.BAT >/CPM loading zbds4h.bin ...19c1(6593)bytes loaded,from CC00 to E5C0 drive D ................................ drive C ................................ drive B ................................ drive A ................................ A>DIR A: ASM COM : DDT COM : DUMP COM : ED COM A: LOAD COM : PIP COM : STAT COM : CREF80 COM A: MBASIC COM : F80 COM : L80 COM : LIB80 COM A: M80 COM : MON COM : DISKDEF LIB : FORLIB REL A: OBSLIB REL : DUMP ASM : DUMP2 PRN : DUMP2 HEX A: TBZCPM COM : DUMP2 BAK : TESTPROG PLI : TEST BAS A>ERA TEST.BAS A>DIR A: ASM COM : DDT COM : DUMP COM : ED COM A: LOAD COM : PIP COM : STAT COM : CREF80 COM A: MBASIC COM : F80 COM : L80 COM : LIB80 COM A: M80 COM : MON COM : DISKDEF LIB : FORLIB REL A: OBSLIB REL : DUMP ASM : DUMP2 PRN : DUMP2 HEX A: TBZCPM COM : DUMP2 BAK : TESTPROG PLI A>MBASIC BASIC-85 Rev. 5.29 [CP/M Version] Copyright 1985-1986 、 by Microsoft Created: 28-Jul-85 28728 Bytes free Ok 10 A=10 20 B=20 30 C=A+B 40 PRINT C LIST 10 A=10 20 B=20 30 C=A+B 40 PRINT C Ok RUN 30 Ok SAVE "TEST.BAS" Ok NEW Ok LIST Ok SYSTEM A>DIR A: ASM COM : DDT COM : DUMP COM : ED COM A: LOAD COM : PIP COM : STAT COM : CREF80 COM A: MBASIC COM : F80 COM : L80 COM : LIB80 COM A: M80 COM : MON COM : DISKDEF LIB : FORLIB REL A: OBSLIB REL : DUMP ASM : DUMP2 PRN : DUMP2 HEX A: TBZCPM COM : DUMP2 BAK : TESTPROG PLI : TEST BAS A>MBASIC BASIC-85 Rev. 5.29 [CP/M Version] Copyright 1985-1986 、 by Microsoft Created: 28-Jul-85 28728 Bytes free Ok LOAD "TEST.BAS" Ok LIST 10 A=10 20 B=20 30 C=A+B 40 PRINT C Ok RUN 30 Ok FILES ASM .COM DDT .COM DUMP .COM ED .COM LOAD .COM PIP .COM STAT .COM CREF80 .COM MBASIC .テOM F80 .COM L80 .COM LIB80 .COM M80 .COM MON .COM DISKDEF .LIB FORLIB .REL OBSLIB .REL DUMP .ASM DUMP2 .PRN DUMP2 .HEX TBZCPM .COM DUMP2 .BAK TESTPROG.PLI TEST .BAS Ok NEW Ok LIST Ok SYSTEM A>DIR A: ASM COM : DDT COM : DUMP COM : ED COM A: LOAD COM : PIP COM : STAT COM : CREF80 COM A: MBASIC COM : F80 COM : L80 COM : LIB80 COM A: M80 COM : MON COM : DISKDEF LIB : FORLIB REL A: OBSLIB REL : DUMP ASM : DUMP2 PRN : DUMP2 HEX A: TBZCPM COM : DUMP2 BAK : TESTPROG PLI : TEST BAS A>/EXIT /BAT end > 0000 00C3 - リモート接続を終了しました logfile closed at Wed Jun 19 14:03:11 2013 |
/CPM DIR ERA TEST.BAS DIR MBASIC 10 A=10 20 B=20 30 C=A+B 40 PRINT C LIST RUN SAVE "TEST.BAS" NEW LIST SYSTEM DIR MBASIC LOAD "TEST.BAS" LIST RUN FILES NEW LIST SYSTEM DIR /EXIT |
logfile nd80zlog\06191403.txt open ND80ZVに接続しました 0001 0000 - Z 1000 00C3 - *** nd80z3 basic **** >/BAT PIP.BAT >/CPM C.vfd がありません。 C.vfd を作成しました。 loading zbds4h.bin ...19c1(6593)bytes loaded,from CC00 to E5C0 drive D ................................ drive C ................................ drive B ................................ drive A ................................ A>DIR A: ASM COM : DDT COM : DUMP COM : ED COM A: LOAD COM : PIP COM : STAT COM : CREF80 COM A: MBASIC COM : F80 COM : L80 COM : LIB80 COM A: M80 COM : MON COM : DISKDEF LIB : FORLIB REL A: OBSLIB REL : DUMP ASM : DUMP2 PRN : DUMP2 HEX A: TBZCPM COM : DUMP2 BAK : TESTPROG PLI : TEST BAS A>DIR C: no file A>PIP C:=A:ASM.COM A>PIP C:=A:LOAD.COM A>PIP C:=A:STAT.COM A>PIP C:=A:TESTPROG.PLI A>PIP C:TEST.ASM=A:DUMP.ASM,TESTPROG.PLI A>TYPE C:TEST.ASM ; FILE DUMP PROGRAM, READS AN INPUT FILE AND PRINTS IN HEX ; ; COPYRIGHT (C) 1975, 1976, 1977, 1978 ; DIGITAL RESEARCH ; BOX 579, PACIFIC GROVE ; CALIFORNIA, 93950 ; ORG 100H BDOS EQU 0005H ;DOS ENTRY POINT CONS EQU 1 ;READ CONSOLE TYPEF EQU 2 ;TYPE FUNCTION PRINTF EQU 9 ;BUFFER PRINT ENTRY BRKF EQU 11 ;BREAK KEY FUNCTION (TRUE IF CHAR READY) OPENF EQU 15 ;FILE OPEN READF EQU 20 ;READ FUNCTION ; FCB EQU 5CH ;FILE CONTROL BLOCK ADDRESS BUFF EQU 80H ;INPUT DISK BUFFER ADDRESS ; ; NON GRAPHIC CHARACTERS CR EQU 0DH ;CARRIAGE RETURN LF EQU 0AH ;LINE FEED ; ; FILE CONTROL BLOCK DEFINITIONS FCBDN EQU FCB+0 ;DISK NAME FCBFN EQU FCB+1 ;FILE NAME FCBFT EQU FCB+9 ;DISK FILE TYPE (3 CHARACTERS) FCBRL EQU FCB+12 ;FILE'S CURRENT REEL NUMBER FCBRC EQU FCB+15 ;FILE'S RECORD COUNT (0 TO 128) FCBCR EQU FCB+32 ;CURRENT (NEXT) RECORD NUMBER (0 TO 127) FCBLN EQU FCB+33 ;FCB LENGTH ; ; SET UP STACK LXI H,0 DAD SP ; ENTRY STACK POINTER IN HL FROM THE CCP SHLD OLDSP ; SET SP TO LOCAL STACK AREA (RESTORED AT FINIS) LXI SP,STKTOP ; READ AND PRINT SUCCESSIVE BUFFERS CALL SETUP ;SET UP INPUT FILE CPI 255 ;255 IF FILE NOT PRESENT JNZ OPENOK ;SKIP IF OPEN IS OK ; ; FILE NOT THERE, GIVE ERROR MESSAGE AND RETURN LXI D,OPNMSG CALL ERR JMP FINIS ;TO RETURN ; OPENOK: ;OPEN OPERATION OK, SET BUFFER INDEX TO END MVI A,80H STA IBP ;SET BUFFER POINTER TO 80H ; HL CONTAINS NEXT ADDRESS TO PRINT LXI H,0 ;START WITH 0000 ; GLOOP: PUSH H ;SAVE LINE POSITION CALL GNB POP H ;RECALL LINE POSITION JC FINIS ;CARRY SET BY GNB IF END FILE MOV B,A ; PRINT HEX VALUES ; CHECK FOR LINE FOLD MOV A,L ANI 0FH ;CHECK LOW 4 BITS JNZ NONUM ; PRINT LINE NUMBER CALL CRLF ; ; CHECK FOR BREAK KEY CALL BREAK ; ACCUM LSB = 1 IF CHARACTER READY RRC ;INTO CARRY JC FINIS ;DON'T PRINT ANY MORE ; MOV A,H CALL PHEX MOV A,L CALL PHEX NONUM: INX H ;TO NEXT LINE NUMBER MVI A,' ' CALL PCHAR MOV A,B CALL PHEX JMP GLOOP ; FINIS: ; END OF DUMP, RETURN TO CCP ; (NOTE THAT A JMP TO 0000H REBOOTS) CALL CRLF LHLD OLDSP SPHL ; STACK POINTER CONTAINS CCP'S STACK LOCATION RET ;TO THE CCP ; ; ; SUBROUTINES ; BREAK: ;CHECK BREAK KEY (ACTUALLY ANY KEY WILL DO) PUSH H! PUSH D! PUSH B; ENVIRONMENT SAVED MVI C,BRKF CALL BDOS POP B! POP D! POP H; ENVIRONMENT RESTORED RET ; PCHAR: ;PRINT A CHARACTER PUSH H! PUSH D! PUSH B; SAVED MVI C,TYPEF MOV E,A CALL BDOS POP B! POP D! POP H; RESTORED RET ; CRLF: MVI A,CR CALL PCHAR MVI A,LF CALL PCHAR RET ; ; PNIB: ;PRINT NIBBLE IN REG A ANI 0FH ;LOW 4 BITS CPI 10 JNC P10 ; LESS THAN OR EQUAL TO 9 ADI '0' JMP PRN ; ; GREATER OR EQUAL TO 10 P10: ADI 'A' - 10 PRN: CALL PCHAR RET ; PHEX: ;PRINT HEX CHAR IN REG A PUSH PSW RRC RRC RRC RRC CALL PNIB ;PRINT NIBBLE POP PSW CALL PNIB RET ; ERR: ;PRINT ERROR MESSAGE ; D,E ADDRESSES MESSAGE ENDING WITH "$" MVI C,PRINTF ;PRINT BUFFER FUNCTION CALL BDOS RET ; ; GNB: ;GET NEXT BYTE LDA IBP CPI 80H JNZ G0 ; READ ANOTHER BUFFER ; ; CALL DISKR ORA A ;ZERO VALUE IF READ OK JZ G0 ;FOR ANOTHER BYTE ; END OF DATA, RETURN WITH CARRY SET FOR EOF STC RET ; G0: ;READ THE BYTE AT BUFF+REG A MOV E,A ;LS BYTE OF BUFFER INDEX MVI D,0 ;DOUBLE PRECISION INDEX TO DE INR A ;INDEX=INDEX+1 STA IBP ;BACK TO MEMORY ; POINTER IS INCREMENTED ; SAVE THE CURRENT FILE ADDRESS LXI H,BUFF DAD D ; ABSOLUTE CHARACTER ADDRESS IS IN HL MOV A,M ; BYTE IS IN THE ACCUMULATOR ORA A ;RESET CARRY BIT RET ; SETUP: ;SET UP FILE ; OPEN THE FILE FOR INPUT XRA A ;ZERO TO ACCUM STA FCBCR ;CLEAR CURRENT RECORD ; LXI D,FCB MVI C,OPENF CALL BDOS ; 255 IN ACCUM IF OPEN ERROR RET ; DISKR: ;READ DISK FILE RECORD PUSH H! PUSH D! PUSH B LXI D,FCB MVI C,READF CALL BDOS POP B! POP D! POP H RET ; ; FIXED MESSAGE AREA SIGNON: DB 'FILE DUMP VERSION 1.4$' OPNMSG: DB CR,LF,'NO INPUT FILE PRESENT ON DISK$' IBP: DS 2 OLDSP: DS 2 ; STACK AREA DS 64 ;RESERVE 32 LEVEL STACK STKTOP: ; END GGG: /* TEST PROGRAM */ PROC OPTIONS(MAIN); DCL I FIXED BIN(15); DO I=1 TO 5; PUT SKIP EDIT('I=',I,'*CP/M MACHINE*') (A(2),F(3),X(3),A(14)); END; END GGG; A>PIP CON:=C:TESTPROG.PLI GGG: /* TEST PROGRAM */ PROC OPTIONS(MAIN); DCL I FIXED BIN(15); DO I=1 TO 5; PUT SKIP EDIT('I=',I,'*CP/M MACHINE*') (A(2),F(3),X(3),A(14)); END; END GGG; A>PIP C:DUMP2.ASM=A:DUMP.ASM A>DIR C: C: ASM COM : LOAD COM : STAT COM : TESTPROG PLI C: TEST ASM : DUMP2 ASM A>STAT C:*.* Recs Bytes Ext Acc 65 10k 1 R/W C:ASM.COM 32 4k 1 R/W C:DUMP2.ASM 15 2k 1 R/W C:LOAD.COM 42 6k 1 R/W C:STAT.COM 34 6k 1 R/W C:TEST.ASM 2 2k 1 R/W C:TESTPROG.PLI Bytes Remaining On C: 2014k A>/EXIT /BAT end > 0000 00C3 - リモート接続を終了しました logfile closed at Wed Jun 19 14:06:01 2013 |
logfile nd80zlog\06191410.txt open ND80ZVに接続しました 0001 0000 - Z 1000 00C3 - *** nd80z3 basic **** >/BAT STAT.BAT >/CPM loading zbds4h.bin ...19c1(6593)bytes loaded,from CC00 to E5C0 drive D ................................ drive C ................................ drive B ................................ drive A ................................ A>STAT A: R/W, Space: 1784k A>STAT B: Bytes Remaining On B: 1600k A>STAT B:DUMP2.ASM Recs Bytes Ext Acc 32 4k 1 R/W B:DUMP2.ASM Bytes Remaining On B: 1600k A>STAT B:DUMP2.ASM $S Size Recs Bytes Ext Acc 32 32 4k 1 R/W B:DUMP2.ASM Bytes Remaining On B: 1600k A>STAT B:DUMP2.* Recs Bytes Ext Acc 32 4k 1 R/W B:DUMP2.ASM Bytes Remaining On B: 1600k A>STAT B:DUMP2.* $S Size Recs Bytes Ext Acc 32 32 4k 1 R/W B:DUMP2.ASM Bytes Remaining On B: 1600k A>STAT B:*.COM Recs Bytes Ext Acc 93 12k 1 R/W B:MAC.COM 87 12k 1 R/W B:NSWP.COM 56 8k 1 R/W B:PIP.COM 11 2k 1 R/W B:SUBMIT.COM 16 2k 1 R/W B:TBCPM.COM 17 4k 1 R/W B:TBZCPM.COM Bytes Remaining On B: 1600k A>STAT B:*.COM $S Size Recs Bytes Ext Acc 93 93 12k 1 R/W B:MAC.COM 87 87 12k 1 R/W B:NSWP.COM 56 56 8k 1 R/W B:PIP.COM 11 11 2k 1 R/W B:SUBMIT.COM 16 16 2k 1 R/W B:TBCPM.COM 17 17 4k 1 R/W B:TBZCPM.COM Bytes Remaining On B: 1600k A>STAT B:*.* Recs Bytes Ext Acc 5 2k 1 R/W B:BUTTONS.LIB 10 2k 1 R/W B:COMPARE.LIB 754 96k 6 R/W B:CPM22.ASM 126 16k 1 R/W B:CPM22.HEX 1220 154k 10 R/W B:CPM22.PRN 8 2k 1 R/W B:DISK.DOC 8 2k 1 R/W B:DOWHILE.LIB 81 12k 1 R/W B:DSTACK.LIB 32 4k 1 R/W B:DUMP2.ASM 4 2k 1 R/W B:I8085.LIB 18 4k 1 R/W B:INTER.LIB 93 12k 1 R/W B:MAC.COM 11 2k 1 R/W B:NCOMPARE.LIB 87 12k 1 R/W B:NSWP.COM 56 8k 1 R/W B:PIP.COM 1 2k 1 R/W B:READ.ME 14 2k 1 R/W B:SELECT.LIB 83 12k 1 R/W B:SEQIO.LIB 6 2k 1 R/W B:SIMPIO.LIB 10 2k 1 R/W B:STACK.LIB 11 2k 1 R/W B:SUBMIT.COM 98 14k 1 R/W B:TBCPM.ASM 16 2k 1 R/W B:TBCPM.COM 45 6k 1 R/W B:TBCPM.HEX 273 36k 3 R/W B:TBCPM.PRN 17 4k 1 R/W B:TBCPM.SYM 17 4k 1 R/W B:TBZCPM.COM 1 2k 1 R/W B:TEST.SUB 6 2k 1 R/W B:TREADLES.LIB 8 2k 1 R/W B:WHEN.LIB 71 10k 1 R/W B:Z80.DOC 78 10k 1 R/W B:Z80.LIB Bytes Remaining On B: 1600k A>STAT B:*.* $S Size Recs Bytes Ext Acc 5 5 2k 1 R/W B:BUTTONS.LIB 10 10 2k 1 R/W B:COMPARE.LIB 754 754 96k 6 R/W B:CPM22.ASM 126 126 16k 1 R/W B:CPM22.HEX 1220 1220 154k 10 R/W B:CPM22.PRN 8 8 2k 1 R/W B:DISK.DOC 8 8 2k 1 R/W B:DOWHILE.LIB 81 81 12k 1 R/W B:DSTACK.LIB 32 32 4k 1 R/W B:DUMP2.ASM 4 4 2k 1 R/W B:I8085.LIB 18 18 4k 1 R/W B:INTER.LIB 93 93 12k 1 R/W B:MAC.COM 11 11 2k 1 R/W B:NCOMPARE.LIB 87 87 12k 1 R/W B:NSWP.COM 56 56 8k 1 R/W B:PIP.COM 1 1 2k 1 R/W B:READ.ME 14 14 2k 1 R/W B:SELECT.LIB 83 83 12k 1 R/W B:SEQIO.LIB 6 6 2k 1 R/W B:SIMPIO.LIB 10 10 2k 1 R/W B:STACK.LIB 11 11 2k 1 R/W B:SUBMIT.COM 98 98 14k 1 R/W B:TBCPM.ASM 16 16 2k 1 R/W B:TBCPM.COM 45 45 6k 1 R/W B:TBCPM.HEX 273 273 36k 3 R/W B:TBCPM.PRN 17 17 4k 1 R/W B:TBCPM.SYM 17 17 4k 1 R/W B:TBZCPM.COM 1 1 2k 1 R/W B:TEST.SUB 6 6 2k 1 R/W B:TREADLES.LIB 8 8 2k 1 R/W B:WHEN.LIB 71 71 10k 1 R/W B:Z80.DOC 78 78 10k 1 R/W B:Z80.LIB Bytes Remaining On B: 1600k A>STAT DEV: CON: is TTY: RDR: is TTY: PUN: is TTY: LST: is TTY: A>STAT VAL: Temp R/O Disk: d:=R/O Set Indicator: d:filename.typ $R/O $R/W $SYS $DIR Disk Status : DSK: d:DSK: User Status : USR: Iobyte Assign: CON: = TTY: CRT: BAT: UC1: RDR: = TTY: PTR: UR1: UR2: PUN: = TTY: PTP: UP1: UP2: LST: = TTY: CRT: LPT: UL1: A>STAT USR: Active User :=5 Active Files: 0 A>STAT DSK: A: Drive Characteristics 16384: 128 Byte Record Capacity 2048: Kilobyte Drive Capacity 128: 32 Byte Directory Entries 0: Checked Directory Entries 128: Records/ Extent 16: Records/ Block 16: Sectors/ Track 0: Reserved Tracks B: Drive Characteristics 16384: 128 Byte Record Capacity 2048: Kilobyte Drive Capacity 128: 32 Byte Directory Entries 0: Checked Directory Entries 128: Records/ Extent 16: Records/ Block 16: Sectors/ Track 0: Reserved Tracks A>STAT D:DSK: D: Drive Characteristics 16384: 128 Byte Record Capacity 2048: Kilobyte Drive Capacity 128: 32 Byte Directory Entries 0: Checked Directory Entries 128: Records/ Extent 16: Records/ Block 16: Sectors/ Track 0: Reserved Tracks A>STAT D:=R/O A>STAT B:DUMP2.* Recs Bytes Ext Acc 32 4k 1 R/W B:DUMP2.ASM Bytes Remaining On B: 1600k A>DIR B:DUMP2.* B: DUMP2 ASM A>STAT B:DUMP2.ASM $R/O DUMP2.ASM set to R/O A>STAT B:DUMP2.HEX $SYS File Not Found A>DIR B:DUMP2.* B: DUMP2 ASM A>STAT B:DUMP2.* $S Size Recs Bytes Ext Acc 32 32 4k 1 R/O B:DUMP2.ASM Bytes Remaining On B: 1600k A>STAT B:DUMP2.ASM $R/W DUMP2.ASM set to R/W A>STAT B:DUMP2.HEX $DIR File Not Found A>STAT B:DUMP2.* $S Size Recs Bytes Ext Acc 32 32 4k 1 R/W B:DUMP2.ASM Bytes Remaining On B: 1600k A>/EXIT /BAT end > 0000 00C3 - リモート接続を終了しました logfile closed at Wed Jun 19 14:13:06 2013 |