2012.5.12
前へ
次へ
ホームページトップへ戻る

復活!CP/M ワンボードマイコンでCP/Mを!
CP/MがTK−80互換のワンボードマイコンの上で復活します
ND80ZVとMYCPU80の上でCP/Mが走ります

[第118回]


●CP/M互換オリジナルDOS

やっとCP/Mファンクションコールの動作テストが完了しましたので、いよいよ懸案のCP/M互換オリジナルDOSの作成にとりかかりました。

で。
約1週間ぐらいを費やしまして、とりあえず書き上げてしまいました。
ええ。
CCPもBDOSもオリジナルで。
どちらも最初から一気に書いてしまいましたよ。

一度にお見せしようとしますとページが大きくなってしまいますので、今回は、まずCCP(Console Command Processer)プログラムをご覧いただきます。

2012/5/12  21:53  ZCCP1A.TXT
END=C0F0
              ;ZCCP for ND80Z3
              ;CP/M2.2 compatible
              ;2012/5/7 5/9 5/10 5/11 5/12
              ;
                ORG $BC00
              ;
                B_BOOT=$D200
                B_WBOOT=$D203
                B_CONST=$D206
                B_CONIN=$D209
                B_CONOUT=$D20C
                B_LIST=$D20F
                B_PUNCH=$D212
                B_READER=$D215
                B_HOME=$D218
                B_SELDSK=$D21B
                B_SETTRK=$D21E
                B_SETSEC=$D221
                B_SETDMA=$D224
                B_READ=$D227
                B_WRITE=$D22A
                B_PRSTAT=$D22D
                SECTRN=$D230
                ZREENT=$D236
              ;
                IOBYTE=$8003
                FCB=$805C
                FCB2=$806C
                DMABF=$8080
                TRNS0=$8100
              ;
                CURDRVVCT=$D000
                ROVCT=$D002
                CURDRV=$D004
                CDRV_DIRWK=$D005
                DMABFADRS=$D006
                DIRTRK=$D008
                DIRSCT=$D009
                FNPOS=$D00A;in DIR all
                FNPOSS=$D00B;in SECTOR
                SAVECNTR=$D00C;-D00D
                DIRCNTR=$D00E
                DRVCHR=$D00F
              ;
                DPARAM=$D010;to $D02E
                CSVTOP=$D01C
                ALVTOP=$D01E
                SEC=$D020;SECTORS PER TRACK/DISK PARAMETER TOP
                BLKSFT=$D022
                BLKMSK=$D023
              ;
                BLKMAX=$D025
                DIRMAX=$D027
                DIRALC=$D029
              ;
                SYSFCB=$D03C
                SYSFCBEX=$D048
                SYSFCBRC=$D04B
                SYSFCBALC=$D04C;=SYSFCB2
                SYSFCBCR=$D05C
              ;
                CONINBF=$D07E;-D0FF
                DIRBF=$D100
                RECBF=$D180
              ;         
                BDOS=$C406
                SYSRES=$C409;00
                CONIN=$C40C;01
                CONOUT=$C40F;02
                RDRIN=$C412;03
                PUNOUT=$C415;04
                LSTOUT=$C418;05
                CONINOT=$C41B;06
                IOBYTERD=$C41E;07
                IOBYTESET=$C421;08
                DEOUT=$C424;09
                CONBFIN=$C427;0A
                CONCHK=$C42A;0B
                VERRD=$C42D;0C
                DISKRES=$C430;0D
                DRVNOSET=$C433;0E
                OPEN=$C436;0F
                CLOSE=$C439;10
                SRCHFST=$C43C;11
                SRCHNXT=$C43F;12
                DELETE=$C442;13
                SEQRD=$C445;14
                SEQWR=$C448;15
                NEWOPEN=$C44B;16
                RENAME=$C44E;17
                CURDRVVCTRD=$C451;18
                CURDRVNORD=$C454;19
                DMAADRSSET=$C457;1A
                ALVADRSRD=$C45A;1B
                WPSET=$C46D;1C
                ROVRD=$C460;1D
                ATTRSET=$C463;1E
                DPARAMRD=$C466;1F
                RNDMRD=$C469;21
                RNDMWR=$C46C;22
                FSIZERD=$C46F;23
                RNDMNOSET=$C472;24
                DRVVCTRES=$C475;25
                RNDMWR0=$C478;28
              ;
BC00 1E00       LD E,00
BC02 217ED0     LD HL,CONINBF
BC05 3680       LD (HL),80
BC07 AF         XOR A
BC08 3204D0     LD (CURDRV),A
BC0B CD30C4   CCPENTRY0:CALL DISKRES
              ;
BC0E CDE7C0   CCPENTRY:CALL CRLF
BC11 3A04D0     LD A,(CURDRV)
BC14 5F         LD E,A
BC15 CD33C4     CALL DRVNOSET
BC18 3A04D0     LD A,(CURDRV)
BC1B C641       ADD A,41
BC1D 4F         LD C,A
BC1E CD0CD2     CALL B_CONOUT
BC21 0E3E       LD C,3E;>
BC23 CD0CD2     CALL B_CONOUT
BC26 117ED0     LD DE,CONINBF
BC29 CD27C4     CALL CONBFIN
BC2C C236D2     JP NZ,ZREENT;ctrl+D
BC2F 7E         LD A,(HL)
BC30 47         LD B,A
BC31 4F         LD C,A
BC32 23         INC HL
BC33 E5         PUSH HL
BC34 7E       CCPENTRY1:LD A,(HL)
BC35 FE61       CP 61;'a'
BC37 DA41BC     JP C,CCPENTRY12
BC3A FE7B       CP 7B;'Z'+1
BC3C D241BC     JP NC,CCPENTRY12
BC3F E6DF       AND DF;bit5=0,'a' to 'A'
BC41 77       CCPENTRY12:LD (HL),A
BC42 23         INC HL
BC43 0D         DEC C
BC44 C234BC     JP NZ,CCPENTRY1
BC47 E1       CCPENTRY2:POP HL
BC48 78         LD A,B
BC49 FE02       CP 02
BC4B C25FBC     JP NZ,CMDCK
BC4E 23         INC HL
BC4F 7E         LD A,(HL)
BC50 FE3A       CP 3A; ':'
BC52 2B         DEC HL
BC53 C24BBF     JP NZ,USRCMD
              ;
              ;DISK CHANGE
              ;
BC56 7E         LD A,(HL)
BC57 D641       SUB 41;'A' to 00
BC59 3204D0     LD (CURDRV),A
BC5C C30EBC     JP CCPENTRY
              ;
BC5F 11A2BC   CMDCK:LD DE,CMDTBL
BC62 0E00       LD C,00
BC64 E5       CMDCK1:PUSH HL
BC65 C5         PUSH BC
BC66 1A       CMDCK2:LD A,(DE)
BC67 BE         CP (HL)
BC68 C27CBC     JP NZ,CMDCK3
BC6B FE20       CP 20
BC6D CA91BC     JP Z,CMDCKEND
BC70 23         INC HL
BC71 13         INC DE
BC72 05         DEC B
BC73 C266BC     JP NZ,CMDCK2
BC76 1A         LD A,(DE)
BC77 FE20       CP 20
BC79 CA91BC     JP Z,CMDCKEND
BC7C 79       CMDCK3:LD A,C
BC7D C1         POP BC
BC7E E1         POP HL
BC7F 4F         LD C,A
BC80 13       CMDCK4:INC DE
BC81 1A         LD A,(DE)
BC82 FE20       CP 20
BC84 C280BC     JP NZ,CMDCK4
BC87 13         INC DE
BC88 1A         LD A,(DE)
BC89 B7         OR A
BC8A CA4BBF     JP Z,USRCMD
BC8D 0C         INC C
BC8E C364BC     JP CMDCK1
BC91 59       CMDCKEND:LD E,C
BC92 78         LD A,B
BC93 C1         POP BC
BC94 C1         POP BC;dummy
BC95 EB         EX DE,HL
BC96 2600       LD H,00
BC98 29         ADD HL,HL
BC99 01B9BC     LD BC,CMDJMPTBL
BC9C 09         ADD HL,BC
BC9D 4E         LD C,(HL)
BC9E 23         INC HL
BC9F 66         LD H,(HL)
BCA0 69         LD L,C
BCA1 E9         JP (HL)
              ;
              ;command table
BCA2 44495220 CMDTBL:"DIR "
BCA6 45524120   "ERA "
BCAA 54595045   "TYPE"
BCAE 20         " "
BCAF 53415645   "SAVE"
BCB3 20         " "
BCB4 52454E20   "REN "
BCB8 00         DB 00
              ;
BCB9 C3BC     CMDJMPTBL:DW DIR
BCBB AEBD       DW ERA
BCBD C9BD       DW TYPE
BCBF 2DBE       DW SAVE
BCC1 EFBE       DW REN
              ;
              ;*** DIR ***
              ;
BCC3 47       DIR:LD B,A
BCC4 EB         EX DE,HL
BCC5 B7         OR A
BCC6 CACBBC     JP Z,DIR2
BCC9 23         INC HL;pass '20'
BCCA 05         DEC B
BCCB 113CD0   DIR2:LD DE,SYSFCB
BCCE CD34C0     CALL USRPRMSET
BCD1 213CD0     LD HL,SYSFCB
BCD4 23         INC HL
BCD5 7E         LD A,(HL)
BCD6 FE20       CP 20
BCD8 C2E4BC     JP NZ,DIR4
BCDB 0E0B       LD C,0B;=11
BCDD 363F     DIR3:LD (HL),3F
BCDF 23         INC HL
BCE0 0D         DEC C
BCE1 C2DDBC     JP NZ,DIR3
              ;
BCE4 113CD0   DIR4:LD DE,SYSFCB
BCE7 1A         LD A,(DE)
BCE8 B7         OR A
BCE9 F5         PUSH AF
BCEA CAFBBC     JP Z,DIR41
BCED 47         LD B,A
BCEE 3A04D0     LD A,(CURDRV)
BCF1 3205D0     LD (CDRV_DIRWK),A
BCF4 05         DEC B
BCF5 D5         PUSH DE
BCF6 58         LD E,B
BCF7 CD33C4     CALL DRVNOSET
BCFA D1         POP DE
BCFB CD3CC4   DIR41:CALL SRCHFST
BCFE 3C         INC A
BCFF CA44BD     JP Z,DIR_NOFILE
BD02 3A04D0     LD A,(CURDRV)
BD05 C641     DIR42:ADD A,41;00 to 'A'
BD07 320FD0     LD (DRVCHR),A
BD0A 3E04       LD A,04
BD0C 320ED0     LD (DIRCNTR),A
BD0F 0603     DIR422:LD B,03
BD11 C5         PUSH BC
BD12 CD55BD     CALL DIRDPS
BD15 113CD0   DIR43:LD DE,SYSFCB
BD18 CD3FC4     CALL SRCHNXT
BD1B 3C         INC A
BD1C CA36BD     JP Z,DIREND
BD1F CD55BD     CALL DIRDPS
BD22 C1       DIR44:POP BC
BD23 05         DEC B
BD24 C5         PUSH BC
BD25 C215BD     JP NZ,DIR43
BD28 113CD0     LD DE,SYSFCB
BD2B CD3FC4     CALL SRCHNXT
BD2E 3C         INC A
BD2F CA36BD     JP Z,DIREND
BD32 C1         POP BC
BD33 C30FBD     JP DIR422
BD36 C1       DIREND:POP BC
BD37 F1       DIREND2:POP AF            
BD38 CA0EBC     JP Z,CCPENTRY
BD3B 3A05D0     LD A,(CDRV_DIRWK)
BD3E 3204D0     LD (CURDRV),A
BD41 C30EBC     JP CCPENTRY
              ;
BD44 114DBD   DIR_NOFILE:LD DE,NOFILE
BD47 CD24C4     CALL DEOUT
BD4A C337BD     JP DIREND2
              ;
BD4D 6E6F2066 NOFILE:"no f"
BD51 696C6524   "ile$"
              ;
BD55 E5       DIRDPS:PUSH HL
BD56 010A00     LD BC,$000A
BD59 09         ADD HL,BC
BD5A 7E         LD A,(HL)
BD5B B7         OR A
BD5C E1         POP HL
BD5D F8         RET M;sys file
BD5E E5         PUSH HL
BD5F 010C00     LD BC,$000C
BD62 09         ADD HL,BC
BD63 7E         LD A,(HL)
BD64 B7         OR A
BD65 E1         POP HL
BD66 C0         RET NZ;extent no.
BD67 3A0ED0     LD A,(DIRCNTR)
BD6A FE04       CP 04
BD6C C279BD     JP NZ,DIRDPS12
BD6F 3A0FD0     LD A,(DRVCHR)
BD72 4F         LD C,A
BD73 CD0CD2     CALL B_CONOUT
BD76 C37CBD     JP DIRDPS13
BD79 CDE2C0   DIRDPS12:CALL SPDP
BD7C 0E3A     DIRDPS13:LD C,3A;':'
BD7E CD0CD2     CALL B_CONOUT
BD81 CDE2C0     CALL SPDP
BD84 0608       LD B,08
BD86 23         INC HL
BD87 4E       DIRDPS2:LD C,(HL)
BD88 CD0CD2     CALL B_CONOUT
BD8B 23         INC HL
BD8C 05         DEC B
BD8D C287BD     JP NZ,DIRDPS2
BD90 CDE2C0     CALL SPDP
BD93 0603       LD B,03
BD95 4E       DIRDPS3:LD C,(HL)
BD96 CD0CD2     CALL B_CONOUT
BD99 23         INC HL
BD9A 05         DEC B
BD9B C295BD     JP NZ,DIRDPS3
BD9E 3A0ED0     LD A,(DIRCNTR)
BDA1 3D         DEC A
BDA2 C2AABD     JP NZ,DIRDPS4
BDA5 CDE7C0     CALL CRLF
BDA8 3E04       LD A,04
BDAA 320ED0   DIRDPS4:LD (DIRCNTR),A
BDAD C9         RET
              ;
              ;*** ERA ***
              ;
BDAE 47       ERA:LD B,A
BDAF EB         EX DE,HL
BDB0 B7         OR A
BDB1 CAD5C0     JP Z,ERRDP
BDB4 23         INC HL;pass '20'
BDB5 05         DEC B
BDB6 113CD0     LD DE,SYSFCB
BDB9 CD34C0     CALL USRPRMSET
BDBC 113CD0     LD DE,SYSFCB
BDBF CD42C4     CALL DELETE
BDC2 3C         INC A
BDC3 CAD5C0     JP Z,ERRDP
BDC6 C30EBC     JP CCPENTRY
              ;
              ;*** TYPE ***
              ;
BDC9 47       TYPE:LD B,A
BDCA EB         EX DE,HL
BDCB B7         OR A
BDCC CAD5C0     JP Z,ERRDP
BDCF 23         INC HL;pass '20'
BDD0 05         DEC B
BDD1 113CD0     LD DE,SYSFCB
BDD4 CD34C0     CALL USRPRMSET
BDD7 213CD0     LD HL,SYSFCB
BDDA 23         INC HL
BDDB 060B       LD B,0B;=11
BDDD 7E       TYPE2:LD A,(HL)
BDDE FE3F       CP 3F;'?'
BDE0 CAD5C0     JP Z,ERRDP
BDE3 23         INC HL
BDE4 05         DEC B
BDE5 C2DDBD     JP NZ,TYPE2
BDE8 113CD0     LD DE,SYSFCB
BDEB CD36C4     CALL OPEN
BDEE 3C         INC A
BDEF CAD5C0     JP Z,ERRDP
BDF2 3A4BD0     LD A,(SYSFCBRC)
BDF5 B7         OR A
BDF6 CA0EBC     JP Z,CCPENTRY;no record
BDF9 47         LD B,A
BDFA AF         XOR A
BDFB 325CD0     LD (SYSFCBCR),A
BDFE C5       TYPE31:PUSH BC
BDFF 113CD0     LD DE,SYSFCB
BE02 CD45C4     CALL SEQRD
BE05 B7         OR A
BE06 C229BE     JP NZ,TYPEERR
BE09 218080     LD HL,DMABF
BE0C 0680       LD B,80
BE0E 7E       TYPE32:LD A,(HL)
BE0F FE1A       CP 1A;eof
BE11 CA25BE     JP Z,TYPEEND
BE14 4F         LD C,A
BE15 CD0CD2     CALL B_CONOUT
BE18 23         INC HL
BE19 05         DEC B
BE1A C20EBE     JP NZ,TYPE32
BE1D C1         POP BC
BE1E 05         DEC B
BE1F CA0EBC     JP Z,CCPENTRY
BE22 C3FEBD     JP TYPE31
              ;
BE25 C1       TYPEEND:POP BC
BE26 C30EBC     JP CCPENTRY
BE29 C1       TYPEERR:POP BC
BE2A C3D5C0     JP ERRDP
              ;
              ;*** SAVE ***
              ;
BE2D 47       SAVE:LD B,A
BE2E EB         EX DE,HL
BE2F B7         OR A
BE30 CAD5C0     JP Z,ERRDP
BE33 23         INC HL;pass '20'
BE34 05         DEC B
BE35 CDD0BE     CALL DECIN
BE38 7C         LD A,H
BE39 B5         OR L
BE3A CAD5C0     JP Z,ERRDP
BE3D 78         LD A,B
BE3E B7         OR A
BE3F C3D5C0     JP ERRDP
BE42 220CD0     LD (SAVECNTR),HL
BE45 EB         EX DE,HL
BE46 7E         LD A,(HL)
BE47 FE20       CP 20
BE49 C2D5C0     JP NZ,ERRDP
BE4C 23         INC HL
BE4D 05         DEC B
BE4E CAD5C0     JP Z,ERRDP
BE51 113CD0     LD DE,SYSFCB
BE54 CD34C0     CALL USRPRMSET
BE57 213CD0     LD HL,SYSFCB
BE5A 23         INC HL
BE5B 060B       LD B,0B;=11
BE5D 7E       SAVE2:LD A,(HL)
BE5E FE3F       CP 3F;'?'
BE60 CAD5C0     JP Z,ERRDP
BE63 23         INC HL
BE64 05         DEC B
BE65 C25DBE     JP NZ,SAVE2
BE68 113CD0     LD DE,SYSFCB
BE6B CD3CC4     CALL SRCHFST
BE6E 3C         INC A
BE6F C278BE     JP NZ,SAVE3
              ;same filename found
              ;delete
BE72 113CD0     LD DE,SYSFCB
BE75 CD42C4     CALL DELETE
BE78 113CD0   SAVE3:LD DE,SYSFCB
BE7B CD4BC4     CALL NEWOPEN
BE7E B7         OR A
BE7F C2D5C0     JP NZ,ERRDP
              ;
BE82 210081     LD HL,TRNS0
BE85 CDC2BE   SAVE4:CALL DMACPY
BE88 E5         PUSH HL
BE89 113CD0     LD DE,SYSFCB
BE8C CD48C4     CALL SEQWR
BE8F B7         OR A
BE90 C2BEBE     JP NZ,SAVEERR
BE93 E1         POP HL
BE94 CDC2BE     CALL DMACPY
BE97 E5         PUSH HL
BE98 113CD0     LD DE,SYSFCB
BE9B CD48C4     CALL SEQWR
BE9E B7         OR A
BE9F C2BEBE     JP NZ,SAVEERR
BEA2 2A0CD0     LD HL,(SAVECNTR)
BEA5 2D         DEC L
BEA6 CAB0BE     JP Z,SAVEEND;***** H !
BEA9 220CD0     LD (SAVECNTR),HL
BEAC E1         POP HL
BEAD C385BE     JP SAVE4
              ;
BEB0 E1       SAVEEND:POP HL
BEB1 113CD0     LD DE,SYSFCB
BEB4 CD39C4     CALL CLOSE
BEB7 3C         INC A
BEB8 CABEBE     JP Z,SAVEERR
BEBB C30EBC     JP CCPENTRY
BEBE E1       SAVEERR:POP HL
BEBF C3D5C0     JP ERRDP
              ;
BEC2 118080   DMACPY:LD DE,DMABF
BEC5 0600       LD B,00
BEC7 7E       DMACPY2:LD A,(HL)
BEC8 12         LD (DE),A
BEC9 23         INC HL
BECA 13         INC DE
BECB 05         DEC B
BECC C2C7BE     JP NZ,DMACPY2
BECF C9         RET
              ;
BED0 EB       DECIN:EX DE,HL
BED1 210000     LD HL,$0000
BED4 1A       DECIN2:LD A,(DE)
BED5 FE30       CP 30
BED7 D8         RET C
BED8 FE3A       CP 3A
BEDA D0         RET NC
BEDB E60F       AND 0F
BEDD 29         ADD HL,HL;*2
BEDE D5         PUSH DE
BEDF 54         LD D,H
BEE0 5D         LD E,L
BEE1 29         ADD HL,HL;*4
BEE2 29         ADD HL,HL;*8
BEE3 19         ADD HL,DE;*10
BEE4 1600       LD D,00
BEE6 5F         LD E,A
BEE7 19         ADD HL,DE
BEE8 D1         POP DE
BEE9 13         INC DE
BEEA 05         DEC B
BEEB C2D4BE     JP NZ,DECIN2
BEEE C9         RET
              ;
              ;*** REN ***
              ;
BEEF 47       REN:LD B,A
BEF0 EB         EX DE,HL
BEF1 B7         OR A
BEF2 CAD5C0     JP Z,ERRDP
BEF5 23         INC HL;pass '20'
BEF6 05         DEC B
BEF7 113CD0     LD DE,SYSFCB
BEFA CD34C0     CALL USRPRMSET
BEFD C5         PUSH BC
BEFE E5         PUSH HL
BEFF 213CD0     LD HL,SYSFCB
BF02 23         INC HL
BF03 060B       LD B,0B;=11
BF05 7E       REN2:LD A,(HL)
BF06 FE3F       CP 3F;'?'
BF08 CA47BF     JP Z,RENERR
BF0B 23         INC HL
BF0C 05         DEC B
BF0D C205BF     JP NZ,REN2
BF10 E1         POP HL
BF11 C1         POP BC
BF12 78         LD A,B
BF13 B7         OR A
BF14 CAD5C0     JP Z,ERRDP
BF17 23         INC HL
BF18 05         DEC B;pass '20'
BF19 114CD0     LD DE,SYSFCBALC;=FCB2
BF1C CD34C0     CALL USRPRMSET
BF1F 214CD0     LD HL,SYSFCBALC
BF22 23         INC HL
BF23 060B       LD B,0B;=11
BF25 7E       REN3:LD A,(HL)
BF26 FE3F       CP 3F;'?'
BF28 CA47BF     JP Z,RENERR
BF2B 23         INC HL
BF2C 05         DEC B
BF2D C225BF     JP NZ,REN3
BF30 114CD0     LD DE,SYSFCBALC
BF33 CD3CC4     CALL SRCHFST
BF36 3C         INC A
BF37 C2D5C0     JP NZ,ERRDP;same filename found
BF3A 113CD0     LD DE,SYSFCB
BF3D CD4EC4     CALL RENAME
BF40 B7         OR A
BF41 C2D5C0     JP NZ,ERRDP
BF44 C30EBC     JP CCPENTRY
              ;
BF47 C1       RENERR:POP BC
BF48 C3D5C0     JP ERRDP
              ;
              ;*** TRANSIENT COMMAND ***
              ;
BF4B E5       USRCMD:PUSH HL
BF4C C5         PUSH BC
BF4D 213CD0     LD HL,SYSFCB
BF50 3600       LD (HL),00
BF52 23         INC HL
BF53 1608       LD D,08
BF55 3620     USRCMD2:LD (HL),20
BF57 23         INC HL
BF58 15         DEC D
BF59 C255BF     JP NZ,USRCMD2
BF5C 3643       LD (HL),43;'C'
BF5E 23         INC HL
BF5F 364F       LD (HL),4F;'O'
BF61 23         INC HL
BF62 364D       LD (HL),4D;'M'
BF64 C1         POP BC
BF65 E1         POP HL
BF66 E5         PUSH HL;for error message
BF67 C5         PUSH BC
BF68 113CD0     LD DE,SYSFCB
BF6B 78         LD A,B
BF6C FE01       CP 01
BF6E CA81BF     JP Z,USRCMD3
BF71 23         INC HL
BF72 7E         LD A,(HL)
BF73 2B         DEC HL
BF74 FE3A       CP 3A;':'
BF76 C281BF     JP NZ,USRCMD3
BF79 7E         LD A,(HL)
BF7A D640       SUB 40;'A' to 01
BF7C 12         LD (DE),A
BF7D 23         INC HL
BF7E 23         INC HL
BF7F 05         DEC B
BF80 05         DEC B
BF81 13       USRCMD3:INC DE
BF82 0E08       LD C,08
BF84 7E       USRCMD4:LD A,(HL)
BF85 FE20       CP 20
BF87 CAB1BF     JP Z,USRCMD5
BF8A 12         LD (DE),A
BF8B 23         INC HL
BF8C 13         INC DE
BF8D 05         DEC B
BF8E CAD5BF     JP Z,USRCMD6;no PARAM
BF91 0D         DEC C
BF92 C284BF     JP NZ,USRCMD4
BF95 7E         LD A,(HL)
BF96 FE20       CP 20
BF98 CAB1BF     JP Z,USRCMD5
              ;ERROR
BF9B CDE7C0     CALL CRLF
BF9E C1         POP BC
BF9F E1         POP HL
BFA0 4E       USRCMDERR:LD C,(HL)
BFA1 CD0CD2     CALL B_CONOUT
BFA4 23         INC HL
BFA5 05         DEC B
BFA6 C2A0BF     JP NZ,USRCMDERR
BFA9 0E3F       LD C,3F
BFAB CD0CD2     CALL B_CONOUT
BFAE C30EBC     JP CCPENTRY
              ;
BFB1 23       USRCMD5:INC HL
BFB2 05         DEC B
BFB3 48         LD C,B
BFB4 E5         PUSH HL
BFB5 118080     LD DE,DMABF
BFB8 EB         EX DE,HL
BFB9 71         LD (HL),C
BFBA 23         INC HL
BFBB 1A       USRCMD52:LD A,(DE)
BFBC 77         LD (HL),A
BFBD 23         INC HL
BFBE 13         INC DE
BFBF 0D         DEC C
BFC0 C2BBBF     JP NZ,USRCMD52
BFC3 E1         POP HL
BFC4 115C80     LD DE,FCB
BFC7 CD34C0     CALL USRPRMSET
BFCA EB         EX DE,HL
BFCB 78         LD A,B
BFCC B7         OR A
BFCD CADDBF     JP Z,USRCMD62
BFD0 23         INC HL
BFD1 05         DEC B
BFD2 C3DDBF     JP USRCMD62
              ;
BFD5 115C80   USRCMD6:LD DE,FCB
BFD8 0600       LD B,00
BFDA CD34C0     CALL USRPRMSET
BFDD 116C80   USRCMD62:LD DE,FCB2
BFE0 CD34C0     CALL USRPRMSET
              ;
BFE3 218080   USRCMD7:LD HL,DMABF
BFE6 2206D0     LD (DMABFADRS),HL
BFE9 44         LD B,H
BFEA 4D         LD C,L
BFEB CD24D2     CALL B_SETDMA
BFEE 113CD0     LD DE,SYSFCB
BFF1 CD36C4     CALL OPEN
BFF4 3C         INC A
BFF5 CAD5C0     JP Z,ERRDP
BFF8 AF         XOR A
BFF9 325CD0     LD (SYSFCBCR),A
BFFC 3A4BD0     LD A,(SYSFCBRC)
BFFF B7         OR A
C000 CAD5C0     JP Z,ERRDP
C003 47         LD B,A
C004 210081     LD HL,TRNS0
C007 C5       USRCMD71:PUSH BC
C008 E5         PUSH HL
C009 113CD0     LD DE,SYSFCB
C00C CD45C4     CALL SEQRD
C00F B7         OR A
C010 C2D5C0     JP NZ,ERRDP
C013 E1         POP HL
C014 118080     LD DE,DMABF
C017 0E80       LD C,80
C019 1A       USRCMD72:LD A,(DE)
C01A 77         LD (HL),A
C01B 23         INC HL
C01C 13         INC DE
C01D 0D         DEC C
C01E C219C0     JP NZ,USRCMD72
C021 C1         POP BC
C022 05         DEC B
C023 C207C0     JP NZ,USRCMD71
C026 3A04D0     LD A,(CURDRV)
C029 F5         PUSH AF
C02A CD0081     CALL TRNS0
C02D F1         POP AF
C02E 3204D0     LD (CURDRV),A
C031 C30EBC     JP CCPENTRY
              ;
              ;user parameter to FCB
C034 EB       USRPRMSET:EX DE,HL
C035 3600       LD (HL),00
C037 23         INC HL
C038 E5         PUSH HL
C039 0E0B       LD C,0B;=11
C03B 3620     USRPRMSET2:LD (HL),20
C03D 23         INC HL
C03E 0D         DEC C
C03F C23BC0     JP NZ,USRPRMSET2
C042 0E04       LD C,04
C044 3600     USRPRMSET22:LD (HL),00
C046 23         INC HL
C047 0D         DEC C
C048 C244C0     JP NZ,USRPRMSET22
C04B E1         POP HL
C04C 78         LD A,B
C04D B7         OR A
C04E C8         RET Z
C04F FE01       CP 01
C051 CA69C0     JP Z,USRPRMSET4
C054 13         INC DE
C055 1A         LD A,(DE)
C056 FE3A       CP 3A;':'
C058 1B         DEC DE
C059 C267C0     JP NZ,USRPRMSET3
C05C 1A         LD A,(DE)
C05D D640       SUB 40;'A' to 01
C05F 2B         DEC HL
C060 77         LD (HL),A
C061 23         INC HL
C062 13         INC DE
C063 13         INC DE
C064 05         DEC B
C065 05         DEC B
C066 C8         RET Z
C067 0E08     USRPRMSET3:LD C,08
C069 1A       USRPRMSET4:LD A,(DE)
C06A FE2E       CP 2E;'.'
C06C CAA5C0     JP Z,USRPRMSET8
C06F FE2A       CP 2A;'*'
C071 CA8FC0     JP Z,USRPRMSET7
C074 77         LD (HL),A
C075 23         INC HL
C076 13         INC DE
C077 0D         DEC C
C078 CA80C0     JP Z,USRPRMSET5
C07B 05         DEC B
C07C C8         RET Z
C07D C369C0     JP USRPRMSET4
              ;
C080 05       USRPRMSET5:DEC B
C081 C8         RET Z
C082 23         INC HL
C083 23         INC HL
C084 23         INC HL
C085 1A       USRPRMSET52:LD A,(DE)
C086 FE20       CP 20
C088 C8         RET Z
C089 13         INC DE
C08A 05         DEC B
C08B C8         RET Z
C08C C385C0     JP USRPRMSET52
              ;
C08F 363F     USRPRMSET7:LD (HL),3F;'?'
C091 23         INC HL
C092 0D         DEC C
C093 C28FC0     JP NZ,USRPRMSET7
C096 13       USRPRMSET71:INC DE
C097 05         DEC B
C098 C8         RET Z
C099 1A         LD A,(DE)
C09A FE2E       CP 2E;'.'
C09C CAA5C0     JP Z,USRPRMSET8
C09F FE20       CP 20;' '
C0A1 C296C0     JP NZ,USRPRMSET71
C0A4 C9         RET
              ;
C0A5 13       USRPRMSET8:INC DE
C0A6 05         DEC B
C0A7 C8         RET Z
C0A8 0E03       LD C,03
C0AA 1A       USRPRMSET81:LD A,(DE)
C0AB FE2A       CP 2A;'*'
C0AD CABFC0     JP Z,USRPRMSET82
C0B0 FE20       CP 20
C0B2 C8         RET Z
C0B3 77         LD (HL),A
C0B4 13         INC DE
C0B5 23         INC HL
C0B6 0D         DEC C
C0B7 CAD0C0     JP Z,USRPRMSET85
C0BA 05         DEC B
C0BB C8         RET Z
C0BC C3AAC0     JP USRPRMSET81
C0BF 363F     USRPRMSET82:LD (HL),3F;'?'
C0C1 23         INC HL
C0C2 0D         DEC C
C0C3 C2BFC0     JP NZ,USRPRMSET82
C0C6 13       USRPRMSET83:INC DE
C0C7 05         DEC B
C0C8 C8         RET Z
C0C9 1A       USRPRMSET84:LD A,(DE)
C0CA FE20       CP 20
C0CC C2C6C0     JP NZ,USRPRMSET83
C0CF C9         RET
              ;
C0D0 05       USRPRMSET85:DEC B
C0D1 C8         RET Z
C0D2 C3C9C0     JP USRPRMSET84
              ;
C0D5 11DEC0   ERRDP:LD DE,ERRT
C0D8 CD24C4     CALL DEOUT
C0DB C30EBC     JP CCPENTRY
              
C0DE 657272   ERRT:"err"
C0E1 24         DB 24
              ;
C0E2 0E20     SPDP:LD C,20
C0E4 C30CD2     JP B_CONOUT
C0E7 0E0D     CRLF:LD C,0D
C0E9 CD0CD2     CALL B_CONOUT
C0EC 0E0A       LD C,0A
C0EE C30CD2     JP B_CONOUT
              ;;
ALVADRSRD    =C45A  ALVTOP       =D01E  ATTRSET      =C463  
BDOS         =C406  BLKMAX       =D025  BLKMSK       =D023  
BLKSFT       =D022  B_BOOT       =D200  B_CONIN      =D209  
B_CONOUT     =D20C  B_CONST      =D206  B_HOME       =D218  
B_LIST       =D20F  B_PRSTAT     =D22D  B_PUNCH      =D212  
B_READ       =D227  B_READER     =D215  B_SELDSK     =D21B  
B_SETDMA     =D224  B_SETSEC     =D221  B_SETTRK     =D21E  
B_WBOOT      =D203  B_WRITE      =D22A  CCPENTRY     =BC0E  
CCPENTRY0    =BC0B  CCPENTRY1    =BC34  CCPENTRY12   =BC41  
CCPENTRY2    =BC47  CDRV_DIRWK   =D005  CLOSE        =C439  
CMDCK        =BC5F  CMDCK1       =BC64  CMDCK2       =BC66  
CMDCK3       =BC7C  CMDCK4       =BC80  CMDCKEND     =BC91  
CMDJMPTBL    =BCB9  CMDTBL       =BCA2  CONBFIN      =C427  
CONCHK       =C42A  CONIN        =C40C  CONINBF      =D07E  
CONINOT      =C41B  CONOUT       =C40F  CRLF         =C0E7  
CSVTOP       =D01C  CURDRV       =D004  CURDRVNORD   =C454  
CURDRVVCT    =D000  CURDRVVCTRD  =C451  DECIN        =BED0  
DECIN2       =BED4  DELETE       =C442  DEOUT        =C424  
DIR          =BCC3  DIR2         =BCCB  DIR3         =BCDD  
DIR4         =BCE4  DIR41        =BCFB  DIR42        =BD05  
DIR422       =BD0F  DIR43        =BD15  DIR44        =BD22  
DIRALC       =D029  DIRBF        =D100  DIRCNTR      =D00E  
DIRDPS       =BD55  DIRDPS12     =BD79  DIRDPS13     =BD7C  
DIRDPS2      =BD87  DIRDPS3      =BD95  DIRDPS4      =BDAA  
DIREND       =BD36  DIREND2      =BD37  DIRMAX       =D027  
DIRSCT       =D009  DIRTRK       =D008  DIR_NOFILE   =BD44  
DISKRES      =C430  DMAADRSSET   =C457  DMABF        =8080  
DMABFADRS    =D006  DMACPY       =BEC2  DMACPY2      =BEC7  
DPARAM       =D010  DPARAMRD     =C466  DRVCHR       =D00F  
DRVNOSET     =C433  DRVVCTRES    =C475  ERA          =BDAE  
ERRDP        =C0D5  ERRT         =C0DE  FCB          =805C  
FCB2         =806C  FNPOS        =D00A  FNPOSS       =D00B  
FSIZERD      =C46F  IOBYTE       =8003  IOBYTERD     =C41E  
IOBYTESET    =C421  LSTOUT       =C418  NEWOPEN      =C44B  
NOFILE       =BD4D  OPEN         =C436  PUNOUT       =C415  
RDRIN        =C412  RECBF        =D180  REN          =BEEF  
REN2         =BF05  REN3         =BF25  RENAME       =C44E  
RENERR       =BF47  RNDMNOSET    =C472  RNDMRD       =C469  
RNDMWR       =C46C  RNDMWR0      =C478  ROVCT        =D002  
ROVRD        =C460  SAVE         =BE2D  SAVE2        =BE5D  
SAVE3        =BE78  SAVE4        =BE85  SAVECNTR     =D00C  
SAVEEND      =BEB0  SAVEERR      =BEBE  SEC          =D020  
SECTRN       =D230  SEQRD        =C445  SEQWR        =C448  
SPDP         =C0E2  SRCHFST      =C43C  SRCHNXT      =C43F  
SYSFCB       =D03C  SYSFCBALC    =D04C  SYSFCBCR     =D05C  
SYSFCBEX     =D048  SYSFCBRC     =D04B  SYSRES       =C409  
TRNS0        =8100  TYPE         =BDC9  TYPE2        =BDDD  
TYPE31       =BDFE  TYPE32       =BE0E  TYPEEND      =BE25  
TYPEERR      =BE29  USRCMD       =BF4B  USRCMD2      =BF55  
USRCMD3      =BF81  USRCMD4      =BF84  USRCMD5      =BFB1  
USRCMD52     =BFBB  USRCMD6      =BFD5  USRCMD62     =BFDD  
USRCMD7      =BFE3  USRCMD71     =C007  USRCMD72     =C019  
USRCMDERR    =BFA0  USRPRMSET    =C034  USRPRMSET2   =C03B  
USRPRMSET22  =C044  USRPRMSET3   =C067  USRPRMSET4   =C069  
USRPRMSET5   =C080  USRPRMSET52  =C085  USRPRMSET7   =C08F  
USRPRMSET71  =C096  USRPRMSET8   =C0A5  USRPRMSET81  =C0AA  
USRPRMSET82  =C0BF  USRPRMSET83  =C0C6  USRPRMSET84  =C0C9  
USRPRMSET85  =C0D0  VERRD        =C42D  WPSET        =C46D  
ZREENT       =D236  

あ。
まだ、完成ではありません。
これからデバッグです。
昨日と今日と2日がかりで、やっとDIRだけなんとか動くようになりました。


まだ、おかしいところがあります。
FTST11.COMの表示が文字化けしています。
リードオンリー属性をつけているためビット7が1になっているところがそのまま表示されてしまいました。
それから、
B>dir a:
と入力すると
no file
になってしまいます。
明日もデバッグです。

ワンボードマイコンでCP/Mを![第118回]
2012.5.12upload

前へ
次へ
ホームページトップへ戻る