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

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

[第153回]


●前回の記事につきまして

前回は、CP/M互換DOS、仮RAMディスク版プロトタイプの堂々の完成を記念しまして、金麦で乾杯。
と書いたのでありますが。
実は。
それはもう1週間以上も前の6月8日のことなのでした。

当連載記事は、私の製作ノート、備忘録を兼ねているのですけれど、少なからぬ読者様にもご理解いただくためには、どうしても補足的に説明などをしなければなりません。
自分では理解していることでも、それを他人に伝えようとしますと、それはなかなかに手間のかかることでありまして、どうしても現実の進行よりも記事のほうが遅れてしまいます。

このところ作業のほうはがんばってかなりいい調子で進みまして、記事のほうもそれに合わせて、梗概といいましょうか、概要をメモする形で書き溜めていったものを、毎日整理しながらUPしてきました。

そういうことですので、前回の記事は昨日の日付ではありますけれど、CP/M互換DOS、仮RAMディスク版プロトタイプは、もう1週間以上も前に出来上がっていたのであります。
あ。
それはそれとしまして、せっかく記事に書きましたことでもありますから、昨晩も「金麦で乾杯」、はちゃんと実行いたしました。

それならば、それからこっちの約1週間はなにをしておったのか?と申しますと、そりゃあもちろん、CP/M互換DOSの完成に向けて、最終段階の作業にかかっていたのであります。
ええ。
64KBフルRAMと仮想FDDシステムの構築です。

当初CP/M2.2をND80ZVに組み込んでその評価をすることからスタートしまして、現行のND80ZVを改造しないで、そのままの構成で、さらにND80ZVのRAM上に仮RAMディスクを構築する形で、CP/M互換DOSを作成するところまではなんとか出来上がりました。

しかし、その先、64KBフルRAMと仮想フロッピーディスクシステムに対応するCP/M互換DOSプログラムの構築、ということになりますと。
そりゃあ、大変なことだろう。
大丈夫か?
この先いったいどうなるのだろう?

ご心配いただく向きもあろうかと思われますが、ご心配はご無用なのであります。
ええ。
実は。

●大体のところは、出来ているのです

おおまかなところは、この1週間ほどで大体は出来上がってしまいましたのです。

しかし。
64KBフルRAMと仮想フロッピーディスクシステムということになりますと、その評価やデバッグを進めるために、いろいろなツールが必要になります。
今後はそのようなツールも作りながら、検証作業を進めていきます。
記事につきましては、あともう少し、CP/M互換DOS、仮RAMディスク版プロトタイプについてのまとめの記事を書きましたあとで、いよいよ最終版、CP/M互換DOS仮想FDDバージョンの製作記事をUPしていくことにいたします。
乞う。ご期待。
であります。

●CP/M互換DOS(仮RAMディスク版)CCPプログラムのソースリスト

出来あがりましたCP/M互換DOS(仮RAMディスク版)CCPプログラムのソースリストです。

;ZCCP for ND80Z3
;CP/M2.2 compatible
;2012/5/7 5/9 5/10 5/11 5/12 5/13 5/14 5/15 5/16
;5/17 5/20 5/21 5/28 5/29 5/30 5/31 6/1
;
        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
;
        IOBYTE=$8003
        FCB=$805C
        FCB2=$806C
        DMABF=$8080
        TRNS0=$8100
;
        CURDRVVCT=$D000
        ROVCT=$D002
        CURDRV=$D004
        CDRV_DIRWK=$D005;also used in USRCMD
        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
        DIRADRS=$D018
        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
        ;D05D-D05F reserved
        INDATA=$D060
        CURROMK=$D061
        DIRBFADRS=$D062
        CURSOR=$D064;-D065;D065 is dummy
        CONBFINWK=$D066;-D067
;
        CONINBF=$D07E;-D0FF
;               
        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
        ALVSET=$C47B
;
CCPENTRY0:LD HL,(DIRADRS)
        LD (DIRBFADRS),HL
        LD A,01;B:
CCPENTRY_01:LD (CURDRV),A
        LD E,A
        CALL DRVNOSET
        CALL ALVSET
        LD A,(CURDRV)
        DEC A
        JP P,CCPENTRY_01
        XOR A
        LD (INDATA),A
        LD H,A
        LD L,A
        LD (CURDRVVCT),HL
        LD (ROVCT),HL
        CALL DISKRES
;
CCPENTRY:LD HL,DMABF
        LD (DMABFADRS),HL
        CALL CRLF
        LD A,(CURDRV)
        LD E,A
        CALL DRVNOSET
        JP Z,CCPENTRY_1
        CALL BADDRVDP
        JP CCPENTRY0
CCPENTRY_1:LD HL,(DIRADRS)
        LD (DIRBFADRS),HL
        LD HL,$00FF
        LD (CONINBF),HL
CCPENTRY01:LD A,(CURDRV)
        ADD A,41
        LD E,A
        CALL CONOUT
        LD E,3E;>
        CALL CONOUT
        LD DE,CONINBF
        CALL CONBFIN
        CALL CRLF
        LD A,(HL)
        OR A
        JP Z,CCPENTRY01
        LD B,A
        LD C,A
        INC HL
        PUSH HL
CCPENTRY1:LD A,(HL)
        CP 61;'a'
        JP C,CCPENTRY12
        CP 7B;'Z'+1
        JP NC,CCPENTRY12
        AND DF;bit5=0,'a' to 'A'
CCPENTRY12:LD (HL),A
        INC HL
        DEC C
        JP NZ,CCPENTRY1
CCPENTRY2:POP HL
        LD A,B
        CP 02
        JP NZ,CMDCK
        INC HL
        LD A,(HL)
        CP 3A; ':'
        DEC HL
        JP NZ,USRCMD
;
;DISK CHANGE
;
        LD A,(HL)
        SUB 41;'A' to 00
        LD E,A
        PUSH AF
        CALL DRVNOSET
        JP NZ,DSKCHGER
        POP AF
        LD (CURDRV),A
        JP CCPENTRY_1
DSKCHGER:CALL BADDRVDP
        POP AF
        JP CCPENTRY
;
CMDCK:LD DE,CMDTBL
        LD C,00
CMDCK1:PUSH HL
        PUSH BC
CMDCK2:LD A,(DE)
        CP (HL)
        JP NZ,CMDCK3
        CP 20
        JP Z,CMDCKEND
        INC HL
        INC DE
        DEC B
        JP NZ,CMDCK2
        LD A,(DE)
        CP 20
        JP Z,CMDCKEND
CMDCK3:LD A,C
        POP BC
        POP HL
        LD C,A
CMDCK4:INC DE
        LD A,(DE)
        CP 20
        JP NZ,CMDCK4
        INC DE
        LD A,(DE)
        OR A
        JP Z,USRCMD
        INC C
        JP CMDCK1
CMDCKEND:LD E,C
        LD A,B
        POP BC
        POP BC;dummy
        EX DE,HL
        LD H,00
        ADD HL,HL
        LD BC,CMDJMPTBL
        ADD HL,BC
        LD C,(HL)
        INC HL
        LD H,(HL)
        LD L,C
        JP (HL)
;
;command table
CMDTBL:"DIR "
        "ERA "
        "TYPE"
        " "
        "SAVE"
        " "
        "REN "
        DB 00
;
CMDJMPTBL:DW DIR
        DW ERA
        DW TYPE
        DW SAVE
        DW REN
;
;*** DIR ***
;
DIR:LD B,A
        EX DE,HL
        OR A
        JP Z,DIR2
        INC HL;pass '20'
        DEC B
DIR2:LD DE,SYSFCB
        CALL USRPRMSET
        LD HL,SYSFCB
        INC HL
        LD A,(HL)
        CP 20
        JP NZ,DIR4
        LD C,0B;=11
DIR3:LD (HL),3F
        INC HL
        DEC C
        JP NZ,DIR3
;
DIR4:LD DE,SYSFCB
        LD A,(DE)
        OR A
        PUSH AF
        JP Z,DIR41
        LD B,A
        LD A,(CURDRV)
        LD (CDRV_DIRWK),A
        DEC B
        PUSH DE
        LD E,B
        CALL DRVNOSET
        JP Z,DIR40
        CALL BADDRVDP
        LD A,(CDRV_DIRWK)
        LD (CURDRV),A
        POP DE
        POP AF
        JP CCPENTRY
DIR40:POP DE
DIR41:CALL SRCHFST
        INC A
        JP Z,DIR_NOFILE
        LD A,(CURDRV)
DIR42:ADD A,41;00 to 'A'
        LD (DRVCHR),A
        LD A,04
        LD (DIRCNTR),A
DIR422:LD B,03
        PUSH BC
        CALL DIRDPS
DIR43:LD DE,SYSFCB
        CALL SRCHNXT
        INC A
        JP Z,DIREND
        CALL DIRDPS
DIR44:POP BC
        DEC B
        PUSH BC
        JP NZ,DIR43
        LD DE,SYSFCB
        CALL SRCHNXT
        INC A
        JP Z,DIREND
        POP BC
        JP DIR422
DIREND:POP BC
DIREND2:POP AF          
        JP Z,CCPENTRY
        LD A,(CDRV_DIRWK)
        LD (CURDRV),A
        JP CCPENTRY
;
DIR_NOFILE:LD DE,NOFILE
        CALL DEOUT
        JP DIREND2
;
NOFILE:"no f"
        "ile$"
;
DIRDPS:PUSH HL
        LD BC,$000A
        ADD HL,BC
        LD A,(HL)
        OR A
        POP HL
        RET M;sys file
        PUSH HL
        LD BC,$000C
        ADD HL,BC
        LD A,(HL)
        OR A
        POP HL
        RET NZ;extent no.
        LD A,(DIRCNTR)
        CP 04
        JP NZ,DIRDPS12
        LD A,(DRVCHR)
        LD E,A
        CALL CONOUT
        JP DIRDPS13
DIRDPS12:CALL SPDP
DIRDPS13:LD E,3A;':'
        CALL CONOUT
        CALL SPDP
        LD B,08
        INC HL
DIRDPS2:LD E,(HL)
        CALL CONOUT
        INC HL
        DEC B
        JP NZ,DIRDPS2
        CALL SPDP
        LD B,03
DIRDPS3:LD A,(HL)
        AND 7F
        LD E,A
        CALL CONOUT
        INC HL
        DEC B
        JP NZ,DIRDPS3
        LD A,(DIRCNTR)
        DEC A
        JP NZ,DIRDPS4
        CALL CRLF
        LD A,04
DIRDPS4:LD (DIRCNTR),A
        RET
;
;*** ERA ***
;
ERA:LD B,A
        EX DE,HL
        OR A
        JP Z,ERRDP
        INC HL;pass '20'
        DEC B
        LD DE,SYSFCB
        CALL USRPRMSET
        LD DE,SYSFCB
        CALL DELETE
        INC A
        JP Z,ERRDP
        JP CCPENTRY
;
;*** TYPE ***
;
TYPE:LD B,A
        EX DE,HL
        OR A
        JP Z,ERRDP
        INC HL;pass '20'
        DEC B
        LD DE,SYSFCB
        CALL USRPRMSET
        LD HL,SYSFCB
        INC HL
        LD B,0B;=11
TYPE2:LD A,(HL)
        CP 3F;'?'
        JP Z,ERRDP
        INC HL
        DEC B
        JP NZ,TYPE2
        LD DE,SYSFCB
        CALL OPEN
        INC A
        JP Z,ERRDP
        LD A,(SYSFCBRC)
        OR A
        JP Z,CCPENTRY;no record
        LD B,A
        XOR A
        LD (SYSFCBCR),A
TYPE31:PUSH BC
        LD DE,SYSFCB
        CALL SEQRD
        OR A
        JP NZ,TYPEERR
        LD HL,(DMABFADRS)
        LD B,80
TYPE32:LD A,(HL)
        CP 1A;eof
        JP Z,TYPEEND
        LD E,A
        CALL CONOUT
        INC HL
        DEC B
        JP NZ,TYPE32
        POP BC
        DEC B
        JP Z,CCPENTRY
        JP TYPE31
;
TYPEEND:POP BC
        JP CCPENTRY
TYPEERR:POP BC
        JP ERRDP
;
;*** SAVE ***
;
SAVE:LD B,A
        EX DE,HL
        OR A
        JP Z,ERRDP
        INC HL;pass '20'
        DEC B
        CALL DECIN
        LD A,H
        OR L
        JP Z,ERRDP
        LD A,B
        OR A
        JP Z,ERRDP
        LD (SAVECNTR),HL
        EX DE,HL
        LD A,(HL)
        CP 20
        JP NZ,ERRDP
        INC HL
        DEC B
        JP Z,ERRDP
        LD DE,SYSFCB
        CALL USRPRMSET
        LD HL,SYSFCB
        INC HL
        LD B,0B;=11
SAVE2:LD A,(HL)
        CP 3F;'?'
        JP Z,ERRDP
        INC HL
        DEC B
        JP NZ,SAVE2
        LD DE,SYSFCB
        CALL SRCHFST
        INC A
        JP Z,SAVE3
;same filename found
;delete
        LD DE,SYSFCB
        CALL DELETE
SAVE3:LD DE,SYSFCB
        CALL NEWOPEN
        CP FF
        JP Z,ERRDP;dir full
;
        LD HL,$0020
        LD DE,SYSFCB
        ADD HL,DE
        LD (HL),00;first rec no.
        LD HL,TRNS0
SAVE4:CALL DMACPY
        PUSH HL
        LD DE,SYSFCB
        CALL SEQWR
        OR A
        JP NZ,SAVEERR
        POP HL
        CALL DMACPY
        PUSH HL
        LD DE,SYSFCB
        CALL SEQWR
        OR A
        JP NZ,SAVEERR
        LD HL,(SAVECNTR)
        DEC L
        JP Z,SAVEEND;***** H !
        LD (SAVECNTR),HL
        POP HL
        JP SAVE4
;
SAVEEND:POP HL
        LD DE,SYSFCB
        CALL CLOSE
        INC A
        JP Z,SAVEERR
        JP CCPENTRY
SAVEERR:POP HL
        JP ERRDP
;
DMACPY:EX DE,HL
        LD HL,(DMABFADRS)
        EX DE,HL
        LD B,80
DMACPY2:LD A,(HL)
        LD (DE),A
        INC HL
        INC DE
        DEC B
        JP NZ,DMACPY2
        RET
;
DECIN:EX DE,HL
        LD HL,$0000
DECIN2:LD A,(DE)
        CP 30
        RET C
        CP 3A
        RET NC
        AND 0F
        ADD HL,HL;*2
        PUSH DE
        LD D,H
        LD E,L
        ADD HL,HL;*4
        ADD HL,HL;*8
        ADD HL,DE;*10
        LD D,00
        LD E,A
        ADD HL,DE
        POP DE
        INC DE
        DEC B
        JP NZ,DECIN2
        RET
;
;*** REN ***
;
REN:LD B,A
        EX DE,HL
        OR A
        JP Z,ERRDP
        INC HL;pass '20'
        DEC B
        LD DE,SYSFCB
        CALL USRPRMSET
        EX DE,HL;need this !
        PUSH BC
        PUSH HL
        LD HL,SYSFCB
        INC HL
        LD B,0B;=11
REN2:LD A,(HL)
        CP 3F;'?'
        JP Z,RENERR
        INC HL
        DEC B
        JP NZ,REN2
        POP HL
        POP BC
        LD A,B
        OR A
        JP Z,ERRDP
        INC HL
        DEC B;pass '20'
        LD DE,SYSFCBALC;=FCB2
        CALL USRPRMSET
        LD HL,SYSFCBALC
        INC HL
        LD B,0B;=11
REN3:LD A,(HL)
        CP 3F;'?'
        JP Z,ERRDP
        INC HL
        DEC B
        JP NZ,REN3
        LD DE,SYSFCBALC
        CALL SRCHFST
        INC A
        JP NZ,ERRDP;same filename found
        LD DE,SYSFCB
        CALL RENAME
        OR A
        JP NZ,ERRDP
        JP CCPENTRY
;
RENERR:POP HL
        POP BC
        JP ERRDP
;
;*** TRANSIENT COMMAND ***
;
USRCMD:LD A,(CURDRV)
        LD (CDRV_DIRWK),A
        PUSH HL
        PUSH BC
        LD HL,SYSFCB
        LD (HL),00
        INC HL
        LD D,08
USRCMD2:LD (HL),20
        INC HL
        DEC D
        JP NZ,USRCMD2
        LD (HL),43;'C'
        INC HL
        LD (HL),4F;'O'
        INC HL
        LD (HL),4D;'M'
        POP BC
        POP HL
        PUSH HL;for error message
        PUSH BC
        LD DE,SYSFCB
        LD A,B
        CP 01
        JP Z,USRCMD3
        INC HL
        LD A,(HL)
        DEC HL
        CP 3A;':'
        JP NZ,USRCMD3
        LD A,(HL)
        SUB 40;'A' to 01
        LD (DE),A
        INC HL
        INC HL
        DEC B
        DEC B
USRCMD3:INC DE
        LD C,08
USRCMD4:LD A,(HL)
        CP 20
        JP Z,USRCMD5
        LD (DE),A
        INC HL
        INC DE
        DEC B
        JP Z,USRCMD6;no PARAM
        DEC C
        JP NZ,USRCMD4
        LD A,(HL)
        CP 20
        JP NZ,USRCMDERR
;
USRCMD5:INC HL
        DEC B
        LD C,B
        PUSH HL
        EX DE,HL
        LD HL,(DMABFADRS)
        LD (HL),C
        INC HL
USRCMD52:LD A,(DE)
        LD (HL),A
        INC HL
        INC DE
        DEC C
        JP NZ,USRCMD52
        POP HL
        LD DE,FCB
        CALL USRPRMSET
        EX DE,HL;need this !
        LD A,B
        OR A
        JP Z,USRCMD62
        INC HL
        DEC B
        JP USRCMD62
;
USRCMD6:LD DE,FCB
        LD B,00
        CALL USRPRMSET
USRCMD62:LD DE,FCB2
        CALL USRPRMSET
;
USRCMD7:LD HL,SYSFCB
        LD A,(HL)
        OR A
        JP Z,USRCMD70
        DEC A
        LD E,A
        CALL DRVNOSET
        JP Z,USRCMD70
        CALL BADDRVDP
        POP BC
        POP HL
        LD A,(CDRV_DIRWK)
        LD (CURDRV),A
        JP CCPENTRY
USRCMD70:LD DE,SYSFCB
        CALL OPEN
        INC A
        JP Z,USRCMDERR
        XOR A
        LD (SYSFCBCR),A
        LD A,(SYSFCBRC)
        OR A
        JP Z,USRCMDERR2
        LD B,A
        LD HL,TRNS0
USRCMD71:PUSH BC
        PUSH HL
        LD DE,SYSFCB
        CALL SEQRD
        OR A
        JP NZ,USRCMDERR3
        POP HL
        EX DE,HL
        LD HL,(DMABFADRS)
        EX DE,HL
        LD C,80
USRCMD72:LD A,(DE)
        LD (HL),A
        INC HL
        INC DE
        DEC C
        JP NZ,USRCMD72
        POP BC
        DEC B
        JP NZ,USRCMD71
        LD HL,(DMABFADRS)
        LD (DIRBFADRS),HL
        LD A,(CDRV_DIRWK)
        LD HL,CURDRV
        CP (HL)
        JP Z,USRCMD722
        LD E,A
        CALL DRVNOSET
USRCMD722:CALL TRNS0
USRCMD73:LD A,(CDRV_DIRWK)
        LD (CURDRV),A
        JP CCPENTRY
;
USRCMDERR:POP BC
        POP HL
USRCMDERR1:LD E,(HL)
        CALL CONOUT
        INC HL
        DEC B
        JP NZ,USRCMDERR1
        LD E,3F
        CALL CONOUT
        JP USRCMD73
;
USRCMDERR2:POP BC
        POP HL
        LD DE,NODATA
        CALL DEOUT
        JP USRCMD73
;
USRCMDERR3:POP HL
        POP BC
        POP BC
        POP HL
        LD DE,READERR
        CALL DEOUT
        JP USRCMD73
;
NODATA:"no d"
        "ata$"
;
READERR:"read"
        " err"
        "er$"
;
;user parameter to FCB
;return with HL to DE changed!
;need EX DE,HL after this routine.
USRPRMSET:EX DE,HL
        LD (HL),00
        INC HL
        PUSH HL
        LD C,0B;=11
USRPRMSET2:LD (HL),20
        INC HL
        DEC C
        JP NZ,USRPRMSET2
        LD C,04
USRPRMSET22:LD (HL),00
        INC HL
        DEC C
        JP NZ,USRPRMSET22
        POP HL
        LD A,B
        OR A
        RET Z
        CP 01
        JP Z,USRPRMSET4
        INC DE
        LD A,(DE)
        CP 3A;':'
        DEC DE
        JP NZ,USRPRMSET3
        LD A,(DE)
        SUB 40;'A' to 01
        DEC HL
        LD (HL),A
        INC HL
        INC DE
        INC DE
        DEC B
        DEC B
        RET Z
USRPRMSET3:LD C,08
USRPRMSET4:LD A,(DE)
        CP 2E;'.'
        JP Z,USRPRMSET8
        CP 2A;'*'
        JP Z,USRPRMSET7
        LD (HL),A
        INC HL
        INC DE
        DEC C
        JP Z,USRPRMSET5
        DEC B
        RET Z
        JP USRPRMSET4
;
USRPRMSET5:DEC B
        RET Z
        LD A,(DE)
        CP 2E;'.'
        JP Z,USRPRMSET8
        INC HL
        INC HL
        INC HL
USRPRMSET52:LD A,(DE)
        CP 20
        RET Z
        INC DE
        DEC B
        RET Z
        JP USRPRMSET52
;
USRPRMSET7:LD (HL),3F;'?'
        INC HL
        DEC C
        JP NZ,USRPRMSET7
USRPRMSET71:INC DE
        DEC B
        RET Z
        LD A,(DE)
        CP 2E;'.'
        JP Z,USRPRMSET8
        JP USRPRMSET52
;
USRPRMSET8:INC DE
        DEC B
        RET Z
        LD A,C
        OR A
        JP Z,USRPRMSET80
USRPRMSET8M:INC HL
        DEC C
        JP NZ,USRPRMSET8M
USRPRMSET80:LD C,03
USRPRMSET81:LD A,(DE)
        CP 2A;'*'
        JP Z,USRPRMSET82
        CP 20
        RET Z
        LD (HL),A
        INC DE
        INC HL
        DEC C
        JP Z,USRPRMSET85
        DEC B
        RET Z
        JP USRPRMSET81
USRPRMSET82:LD (HL),3F;'?'
        INC HL
        DEC C
        JP NZ,USRPRMSET82
USRPRMSET83:INC DE
        DEC B
        RET Z
USRPRMSET84:LD A,(DE)
        CP 20
        JP NZ,USRPRMSET83
        RET
;
USRPRMSET85:DEC B
        RET Z
        JP USRPRMSET84
;
BADDRVDP:LD DE,BADDRV
        JP DEOUT
;
ERRDP:LD DE,ERRT
ERRDP2:CALL DEOUT
        JP CCPENTRY
;
BADDRV:"bad "
        "driv"
        "e$"
ERRT:"err"
        DB 24
;
SPDP:LD E,20
        JP CONOUT
CRLF:LD E,0D
        CALL CONOUT
        LD E,0A
        JP CONOUT

●CP/M互換DOS(仮RAMディスク版)CCPプログラムのアセンブルリスト

こちらはアセンブルリストです。
[第118回]に比べて少し長くなっています。

2012/6/1  20:20  ZCCP1I.TXT
END=C1CD
              ;ZCCP for ND80Z3
              ;CP/M2.2 compatible
              ;2012/5/7 5/9 5/10 5/11 5/12 5/13 5/14 5/15 5/16
              ;5/17 5/20 5/21 5/28 5/29 5/30 5/31 6/1
              ;
                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
              ;
                IOBYTE=$8003
                FCB=$805C
                FCB2=$806C
                DMABF=$8080
                TRNS0=$8100
              ;
                CURDRVVCT=$D000
                ROVCT=$D002
                CURDRV=$D004
                CDRV_DIRWK=$D005;also used in USRCMD
                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
                DIRADRS=$D018
                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
                ;D05D-D05F reserved
                INDATA=$D060
                CURROMK=$D061
                DIRBFADRS=$D062
                CURSOR=$D064;-D065;D065 is dummy
                CONBFINWK=$D066;-D067
              ;
                CONINBF=$D07E;-D0FF
              ;         
                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
                ALVSET=$C47B
              ;
BC00 2A18D0   CCPENTRY0:LD HL,(DIRADRS)
BC03 2262D0     LD (DIRBFADRS),HL
BC06 3E01       LD A,01;B:
BC08 3204D0   CCPENTRY_01:LD (CURDRV),A
BC0B 5F         LD E,A
BC0C CD33C4     CALL DRVNOSET
BC0F CD7BC4     CALL ALVSET
BC12 3A04D0     LD A,(CURDRV)
BC15 3D         DEC A
BC16 F208BC     JP P,CCPENTRY_01
BC19 AF         XOR A
BC1A 3260D0     LD (INDATA),A
BC1D 67         LD H,A
BC1E 6F         LD L,A
BC1F 2200D0     LD (CURDRVVCT),HL
BC22 2202D0     LD (ROVCT),HL
BC25 CD30C4     CALL DISKRES
              ;
BC28 218080   CCPENTRY:LD HL,DMABF
BC2B 2206D0     LD (DMABFADRS),HL
BC2E CDC4C1     CALL CRLF
BC31 3A04D0     LD A,(CURDRV)
BC34 5F         LD E,A
BC35 CD33C4     CALL DRVNOSET
BC38 CA41BC     JP Z,CCPENTRY_1
BC3B CDA2C1     CALL BADDRVDP
BC3E C300BC     JP CCPENTRY0
BC41 2A18D0   CCPENTRY_1:LD HL,(DIRADRS)
BC44 2262D0     LD (DIRBFADRS),HL
BC47 21FF00     LD HL,$00FF
BC4A 227ED0     LD (CONINBF),HL
BC4D 3A04D0   CCPENTRY01:LD A,(CURDRV)
BC50 C641       ADD A,41
BC52 5F         LD E,A
BC53 CD0FC4     CALL CONOUT
BC56 1E3E       LD E,3E;>
BC58 CD0FC4     CALL CONOUT
BC5B 117ED0     LD DE,CONINBF
BC5E CD27C4     CALL CONBFIN
BC61 CDC4C1     CALL CRLF
BC64 7E         LD A,(HL)
BC65 B7         OR A
BC66 CA4DBC     JP Z,CCPENTRY01
BC69 47         LD B,A
BC6A 4F         LD C,A
BC6B 23         INC HL
BC6C E5         PUSH HL
BC6D 7E       CCPENTRY1:LD A,(HL)
BC6E FE61       CP 61;'a'
BC70 DA7ABC     JP C,CCPENTRY12
BC73 FE7B       CP 7B;'Z'+1
BC75 D27ABC     JP NC,CCPENTRY12
BC78 E6DF       AND DF;bit5=0,'a' to 'A'
BC7A 77       CCPENTRY12:LD (HL),A
BC7B 23         INC HL
BC7C 0D         DEC C
BC7D C26DBC     JP NZ,CCPENTRY1
BC80 E1       CCPENTRY2:POP HL
BC81 78         LD A,B
BC82 FE02       CP 02
BC84 C2A8BC     JP NZ,CMDCK
BC87 23         INC HL
BC88 7E         LD A,(HL)
BC89 FE3A       CP 3A; ':'
BC8B 2B         DEC HL
BC8C C2B6BF     JP NZ,USRCMD
              ;
              ;DISK CHANGE
              ;
BC8F 7E         LD A,(HL)
BC90 D641       SUB 41;'A' to 00
BC92 5F         LD E,A
BC93 F5         PUSH AF
BC94 CD33C4     CALL DRVNOSET
BC97 C2A1BC     JP NZ,DSKCHGER
BC9A F1         POP AF
BC9B 3204D0     LD (CURDRV),A
BC9E C341BC     JP CCPENTRY_1
BCA1 CDA2C1   DSKCHGER:CALL BADDRVDP
BCA4 F1         POP AF
BCA5 C328BC     JP CCPENTRY
              ;
BCA8 11EBBC   CMDCK:LD DE,CMDTBL
BCAB 0E00       LD C,00
BCAD E5       CMDCK1:PUSH HL
BCAE C5         PUSH BC
BCAF 1A       CMDCK2:LD A,(DE)
BCB0 BE         CP (HL)
BCB1 C2C5BC     JP NZ,CMDCK3
BCB4 FE20       CP 20
BCB6 CADABC     JP Z,CMDCKEND
BCB9 23         INC HL
BCBA 13         INC DE
BCBB 05         DEC B
BCBC C2AFBC     JP NZ,CMDCK2
BCBF 1A         LD A,(DE)
BCC0 FE20       CP 20
BCC2 CADABC     JP Z,CMDCKEND
BCC5 79       CMDCK3:LD A,C
BCC6 C1         POP BC
BCC7 E1         POP HL
BCC8 4F         LD C,A
BCC9 13       CMDCK4:INC DE
BCCA 1A         LD A,(DE)
BCCB FE20       CP 20
BCCD C2C9BC     JP NZ,CMDCK4
BCD0 13         INC DE
BCD1 1A         LD A,(DE)
BCD2 B7         OR A
BCD3 CAB6BF     JP Z,USRCMD
BCD6 0C         INC C
BCD7 C3ADBC     JP CMDCK1
BCDA 59       CMDCKEND:LD E,C
BCDB 78         LD A,B
BCDC C1         POP BC
BCDD C1         POP BC;dummy
BCDE EB         EX DE,HL
BCDF 2600       LD H,00
BCE1 29         ADD HL,HL
BCE2 0102BD     LD BC,CMDJMPTBL
BCE5 09         ADD HL,BC
BCE6 4E         LD C,(HL)
BCE7 23         INC HL
BCE8 66         LD H,(HL)
BCE9 69         LD L,C
BCEA E9         JP (HL)
              ;
              ;command table
BCEB 44495220 CMDTBL:"DIR "
BCEF 45524120   "ERA "
BCF3 54595045   "TYPE"
BCF7 20         " "
BCF8 53415645   "SAVE"
BCFC 20         " "
BCFD 52454E20   "REN "
BD01 00         DB 00
              ;
BD02 0CBD     CMDJMPTBL:DW DIR
BD04 0BBE       DW ERA
BD06 26BE       DW TYPE
BD08 8ABE       DW SAVE
BD0A 58BF       DW REN
              ;
              ;*** DIR ***
              ;
BD0C 47       DIR:LD B,A
BD0D EB         EX DE,HL
BD0E B7         OR A
BD0F CA14BD     JP Z,DIR2
BD12 23         INC HL;pass '20'
BD13 05         DEC B
BD14 113CD0   DIR2:LD DE,SYSFCB
BD17 CDF4C0     CALL USRPRMSET
BD1A 213CD0     LD HL,SYSFCB
BD1D 23         INC HL
BD1E 7E         LD A,(HL)
BD1F FE20       CP 20
BD21 C22DBD     JP NZ,DIR4
BD24 0E0B       LD C,0B;=11
BD26 363F     DIR3:LD (HL),3F
BD28 23         INC HL
BD29 0D         DEC C
BD2A C226BD     JP NZ,DIR3
              ;
BD2D 113CD0   DIR4:LD DE,SYSFCB
BD30 1A         LD A,(DE)
BD31 B7         OR A
BD32 F5         PUSH AF
BD33 CA55BD     JP Z,DIR41
BD36 47         LD B,A
BD37 3A04D0     LD A,(CURDRV)
BD3A 3205D0     LD (CDRV_DIRWK),A
BD3D 05         DEC B
BD3E D5         PUSH DE
BD3F 58         LD E,B
BD40 CD33C4     CALL DRVNOSET
BD43 CA54BD     JP Z,DIR40
BD46 CDA2C1     CALL BADDRVDP
BD49 3A05D0     LD A,(CDRV_DIRWK)
BD4C 3204D0     LD (CURDRV),A
BD4F D1         POP DE
BD50 F1         POP AF
BD51 C328BC     JP CCPENTRY
BD54 D1       DIR40:POP DE
BD55 CD3CC4   DIR41:CALL SRCHFST
BD58 3C         INC A
BD59 CA9EBD     JP Z,DIR_NOFILE
BD5C 3A04D0     LD A,(CURDRV)
BD5F C641     DIR42:ADD A,41;00 to 'A'
BD61 320FD0     LD (DRVCHR),A
BD64 3E04       LD A,04
BD66 320ED0     LD (DIRCNTR),A
BD69 0603     DIR422:LD B,03
BD6B C5         PUSH BC
BD6C CDAFBD     CALL DIRDPS
BD6F 113CD0   DIR43:LD DE,SYSFCB
BD72 CD3FC4     CALL SRCHNXT
BD75 3C         INC A
BD76 CA90BD     JP Z,DIREND
BD79 CDAFBD     CALL DIRDPS
BD7C C1       DIR44:POP BC
BD7D 05         DEC B
BD7E C5         PUSH BC
BD7F C26FBD     JP NZ,DIR43
BD82 113CD0     LD DE,SYSFCB
BD85 CD3FC4     CALL SRCHNXT
BD88 3C         INC A
BD89 CA90BD     JP Z,DIREND
BD8C C1         POP BC
BD8D C369BD     JP DIR422
BD90 C1       DIREND:POP BC
BD91 F1       DIREND2:POP AF            
BD92 CA28BC     JP Z,CCPENTRY
BD95 3A05D0     LD A,(CDRV_DIRWK)
BD98 3204D0     LD (CURDRV),A
BD9B C328BC     JP CCPENTRY
              ;
BD9E 11A7BD   DIR_NOFILE:LD DE,NOFILE
BDA1 CD24C4     CALL DEOUT
BDA4 C391BD     JP DIREND2
              ;
BDA7 6E6F2066 NOFILE:"no f"
BDAB 696C6524   "ile$"
              ;
BDAF E5       DIRDPS:PUSH HL
BDB0 010A00     LD BC,$000A
BDB3 09         ADD HL,BC
BDB4 7E         LD A,(HL)
BDB5 B7         OR A
BDB6 E1         POP HL
BDB7 F8         RET M;sys file
BDB8 E5         PUSH HL
BDB9 010C00     LD BC,$000C
BDBC 09         ADD HL,BC
BDBD 7E         LD A,(HL)
BDBE B7         OR A
BDBF E1         POP HL
BDC0 C0         RET NZ;extent no.
BDC1 3A0ED0     LD A,(DIRCNTR)
BDC4 FE04       CP 04
BDC6 C2D3BD     JP NZ,DIRDPS12
BDC9 3A0FD0     LD A,(DRVCHR)
BDCC 5F         LD E,A
BDCD CD0FC4     CALL CONOUT
BDD0 C3D6BD     JP DIRDPS13
BDD3 CDBFC1   DIRDPS12:CALL SPDP
BDD6 1E3A     DIRDPS13:LD E,3A;':'
BDD8 CD0FC4     CALL CONOUT
BDDB CDBFC1     CALL SPDP
BDDE 0608       LD B,08
BDE0 23         INC HL
BDE1 5E       DIRDPS2:LD E,(HL)
BDE2 CD0FC4     CALL CONOUT
BDE5 23         INC HL
BDE6 05         DEC B
BDE7 C2E1BD     JP NZ,DIRDPS2
BDEA CDBFC1     CALL SPDP
BDED 0603       LD B,03
BDEF 7E       DIRDPS3:LD A,(HL)
BDF0 E67F       AND 7F
BDF2 5F         LD E,A
BDF3 CD0FC4     CALL CONOUT
BDF6 23         INC HL
BDF7 05         DEC B
BDF8 C2EFBD     JP NZ,DIRDPS3
BDFB 3A0ED0     LD A,(DIRCNTR)
BDFE 3D         DEC A
BDFF C207BE     JP NZ,DIRDPS4
BE02 CDC4C1     CALL CRLF
BE05 3E04       LD A,04
BE07 320ED0   DIRDPS4:LD (DIRCNTR),A
BE0A C9         RET
              ;
              ;*** ERA ***
              ;
BE0B 47       ERA:LD B,A
BE0C EB         EX DE,HL
BE0D B7         OR A
BE0E CAA8C1     JP Z,ERRDP
BE11 23         INC HL;pass '20'
BE12 05         DEC B
BE13 113CD0     LD DE,SYSFCB
BE16 CDF4C0     CALL USRPRMSET
BE19 113CD0     LD DE,SYSFCB
BE1C CD42C4     CALL DELETE
BE1F 3C         INC A
BE20 CAA8C1     JP Z,ERRDP
BE23 C328BC     JP CCPENTRY
              ;
              ;*** TYPE ***
              ;
BE26 47       TYPE:LD B,A
BE27 EB         EX DE,HL
BE28 B7         OR A
BE29 CAA8C1     JP Z,ERRDP
BE2C 23         INC HL;pass '20'
BE2D 05         DEC B
BE2E 113CD0     LD DE,SYSFCB
BE31 CDF4C0     CALL USRPRMSET
BE34 213CD0     LD HL,SYSFCB
BE37 23         INC HL
BE38 060B       LD B,0B;=11
BE3A 7E       TYPE2:LD A,(HL)
BE3B FE3F       CP 3F;'?'
BE3D CAA8C1     JP Z,ERRDP
BE40 23         INC HL
BE41 05         DEC B
BE42 C23ABE     JP NZ,TYPE2
BE45 113CD0     LD DE,SYSFCB
BE48 CD36C4     CALL OPEN
BE4B 3C         INC A
BE4C CAA8C1     JP Z,ERRDP
BE4F 3A4BD0     LD A,(SYSFCBRC)
BE52 B7         OR A
BE53 CA28BC     JP Z,CCPENTRY;no record
BE56 47         LD B,A
BE57 AF         XOR A
BE58 325CD0     LD (SYSFCBCR),A
BE5B C5       TYPE31:PUSH BC
BE5C 113CD0     LD DE,SYSFCB
BE5F CD45C4     CALL SEQRD
BE62 B7         OR A
BE63 C286BE     JP NZ,TYPEERR
BE66 2A06D0     LD HL,(DMABFADRS)
BE69 0680       LD B,80
BE6B 7E       TYPE32:LD A,(HL)
BE6C FE1A       CP 1A;eof
BE6E CA82BE     JP Z,TYPEEND
BE71 5F         LD E,A
BE72 CD0FC4     CALL CONOUT
BE75 23         INC HL
BE76 05         DEC B
BE77 C26BBE     JP NZ,TYPE32
BE7A C1         POP BC
BE7B 05         DEC B
BE7C CA28BC     JP Z,CCPENTRY
BE7F C35BBE     JP TYPE31
              ;
BE82 C1       TYPEEND:POP BC
BE83 C328BC     JP CCPENTRY
BE86 C1       TYPEERR:POP BC
BE87 C3A8C1     JP ERRDP
              ;
              ;*** SAVE ***
              ;
BE8A 47       SAVE:LD B,A
BE8B EB         EX DE,HL
BE8C B7         OR A
BE8D CAA8C1     JP Z,ERRDP
BE90 23         INC HL;pass '20'
BE91 05         DEC B
BE92 CD39BF     CALL DECIN
BE95 7C         LD A,H
BE96 B5         OR L
BE97 CAA8C1     JP Z,ERRDP
BE9A 78         LD A,B
BE9B B7         OR A
BE9C CAA8C1     JP Z,ERRDP
BE9F 220CD0     LD (SAVECNTR),HL
BEA2 EB         EX DE,HL
BEA3 7E         LD A,(HL)
BEA4 FE20       CP 20
BEA6 C2A8C1     JP NZ,ERRDP
BEA9 23         INC HL
BEAA 05         DEC B
BEAB CAA8C1     JP Z,ERRDP
BEAE 113CD0     LD DE,SYSFCB
BEB1 CDF4C0     CALL USRPRMSET
BEB4 213CD0     LD HL,SYSFCB
BEB7 23         INC HL
BEB8 060B       LD B,0B;=11
BEBA 7E       SAVE2:LD A,(HL)
BEBB FE3F       CP 3F;'?'
BEBD CAA8C1     JP Z,ERRDP
BEC0 23         INC HL
BEC1 05         DEC B
BEC2 C2BABE     JP NZ,SAVE2
BEC5 113CD0     LD DE,SYSFCB
BEC8 CD3CC4     CALL SRCHFST
BECB 3C         INC A
BECC CAD5BE     JP Z,SAVE3
              ;same filename found
              ;delete
BECF 113CD0     LD DE,SYSFCB
BED2 CD42C4     CALL DELETE
BED5 113CD0   SAVE3:LD DE,SYSFCB
BED8 CD4BC4     CALL NEWOPEN
BEDB FEFF       CP FF
BEDD CAA8C1     JP Z,ERRDP;dir full
              ;
BEE0 212000     LD HL,$0020
BEE3 113CD0     LD DE,SYSFCB
BEE6 19         ADD HL,DE
BEE7 3600       LD (HL),00;first rec no.
BEE9 210081     LD HL,TRNS0
BEEC CD29BF   SAVE4:CALL DMACPY
BEEF E5         PUSH HL
BEF0 113CD0     LD DE,SYSFCB
BEF3 CD48C4     CALL SEQWR
BEF6 B7         OR A
BEF7 C225BF     JP NZ,SAVEERR
BEFA E1         POP HL
BEFB CD29BF     CALL DMACPY
BEFE E5         PUSH HL
BEFF 113CD0     LD DE,SYSFCB
BF02 CD48C4     CALL SEQWR
BF05 B7         OR A
BF06 C225BF     JP NZ,SAVEERR
BF09 2A0CD0     LD HL,(SAVECNTR)
BF0C 2D         DEC L
BF0D CA17BF     JP Z,SAVEEND;***** H !
BF10 220CD0     LD (SAVECNTR),HL
BF13 E1         POP HL
BF14 C3ECBE     JP SAVE4
              ;
BF17 E1       SAVEEND:POP HL
BF18 113CD0     LD DE,SYSFCB
BF1B CD39C4     CALL CLOSE
BF1E 3C         INC A
BF1F CA25BF     JP Z,SAVEERR
BF22 C328BC     JP CCPENTRY
BF25 E1       SAVEERR:POP HL
BF26 C3A8C1     JP ERRDP
              ;
BF29 EB       DMACPY:EX DE,HL
BF2A 2A06D0     LD HL,(DMABFADRS)
BF2D EB         EX DE,HL
BF2E 0680       LD B,80
BF30 7E       DMACPY2:LD A,(HL)
BF31 12         LD (DE),A
BF32 23         INC HL
BF33 13         INC DE
BF34 05         DEC B
BF35 C230BF     JP NZ,DMACPY2
BF38 C9         RET
              ;
BF39 EB       DECIN:EX DE,HL
BF3A 210000     LD HL,$0000
BF3D 1A       DECIN2:LD A,(DE)
BF3E FE30       CP 30
BF40 D8         RET C
BF41 FE3A       CP 3A
BF43 D0         RET NC
BF44 E60F       AND 0F
BF46 29         ADD HL,HL;*2
BF47 D5         PUSH DE
BF48 54         LD D,H
BF49 5D         LD E,L
BF4A 29         ADD HL,HL;*4
BF4B 29         ADD HL,HL;*8
BF4C 19         ADD HL,DE;*10
BF4D 1600       LD D,00
BF4F 5F         LD E,A
BF50 19         ADD HL,DE
BF51 D1         POP DE
BF52 13         INC DE
BF53 05         DEC B
BF54 C23DBF     JP NZ,DECIN2
BF57 C9         RET
              ;
              ;*** REN ***
              ;
BF58 47       REN:LD B,A
BF59 EB         EX DE,HL
BF5A B7         OR A
BF5B CAA8C1     JP Z,ERRDP
BF5E 23         INC HL;pass '20'
BF5F 05         DEC B
BF60 113CD0     LD DE,SYSFCB
BF63 CDF4C0     CALL USRPRMSET
BF66 EB         EX DE,HL;need this !
BF67 C5         PUSH BC
BF68 E5         PUSH HL
BF69 213CD0     LD HL,SYSFCB
BF6C 23         INC HL
BF6D 060B       LD B,0B;=11
BF6F 7E       REN2:LD A,(HL)
BF70 FE3F       CP 3F;'?'
BF72 CAB1BF     JP Z,RENERR
BF75 23         INC HL
BF76 05         DEC B
BF77 C26FBF     JP NZ,REN2
BF7A E1         POP HL
BF7B C1         POP BC
BF7C 78         LD A,B
BF7D B7         OR A
BF7E CAA8C1     JP Z,ERRDP
BF81 23         INC HL
BF82 05         DEC B;pass '20'
BF83 114CD0     LD DE,SYSFCBALC;=FCB2
BF86 CDF4C0     CALL USRPRMSET
BF89 214CD0     LD HL,SYSFCBALC
BF8C 23         INC HL
BF8D 060B       LD B,0B;=11
BF8F 7E       REN3:LD A,(HL)
BF90 FE3F       CP 3F;'?'
BF92 CAA8C1     JP Z,ERRDP
BF95 23         INC HL
BF96 05         DEC B
BF97 C28FBF     JP NZ,REN3
BF9A 114CD0     LD DE,SYSFCBALC
BF9D CD3CC4     CALL SRCHFST
BFA0 3C         INC A
BFA1 C2A8C1     JP NZ,ERRDP;same filename found
BFA4 113CD0     LD DE,SYSFCB
BFA7 CD4EC4     CALL RENAME
BFAA B7         OR A
BFAB C2A8C1     JP NZ,ERRDP
BFAE C328BC     JP CCPENTRY
              ;
BFB1 E1       RENERR:POP HL
BFB2 C1         POP BC
BFB3 C3A8C1     JP ERRDP
              ;
              ;*** TRANSIENT COMMAND ***
              ;
BFB6 3A04D0   USRCMD:LD A,(CURDRV)
BFB9 3205D0     LD (CDRV_DIRWK),A
BFBC E5         PUSH HL
BFBD C5         PUSH BC
BFBE 213CD0     LD HL,SYSFCB
BFC1 3600       LD (HL),00
BFC3 23         INC HL
BFC4 1608       LD D,08
BFC6 3620     USRCMD2:LD (HL),20
BFC8 23         INC HL
BFC9 15         DEC D
BFCA C2C6BF     JP NZ,USRCMD2
BFCD 3643       LD (HL),43;'C'
BFCF 23         INC HL
BFD0 364F       LD (HL),4F;'O'
BFD2 23         INC HL
BFD3 364D       LD (HL),4D;'M'
BFD5 C1         POP BC
BFD6 E1         POP HL
BFD7 E5         PUSH HL;for error message
BFD8 C5         PUSH BC
BFD9 113CD0     LD DE,SYSFCB
BFDC 78         LD A,B
BFDD FE01       CP 01
BFDF CAF2BF     JP Z,USRCMD3
BFE2 23         INC HL
BFE3 7E         LD A,(HL)
BFE4 2B         DEC HL
BFE5 FE3A       CP 3A;':'
BFE7 C2F2BF     JP NZ,USRCMD3
BFEA 7E         LD A,(HL)
BFEB D640       SUB 40;'A' to 01
BFED 12         LD (DE),A
BFEE 23         INC HL
BFEF 23         INC HL
BFF0 05         DEC B
BFF1 05         DEC B
BFF2 13       USRCMD3:INC DE
BFF3 0E08       LD C,08
BFF5 7E       USRCMD4:LD A,(HL)
BFF6 FE20       CP 20
BFF8 CA0CC0     JP Z,USRCMD5
BFFB 12         LD (DE),A
BFFC 23         INC HL
BFFD 13         INC DE
BFFE 05         DEC B
BFFF CA30C0     JP Z,USRCMD6;no PARAM
C002 0D         DEC C
C003 C2F5BF     JP NZ,USRCMD4
C006 7E         LD A,(HL)
C007 FE20       CP 20
C009 C2B6C0     JP NZ,USRCMDERR
              ;
C00C 23       USRCMD5:INC HL
C00D 05         DEC B
C00E 48         LD C,B
C00F E5         PUSH HL
C010 EB         EX DE,HL
C011 2A06D0     LD HL,(DMABFADRS)
C014 71         LD (HL),C
C015 23         INC HL
C016 1A       USRCMD52:LD A,(DE)
C017 77         LD (HL),A
C018 23         INC HL
C019 13         INC DE
C01A 0D         DEC C
C01B C216C0     JP NZ,USRCMD52
C01E E1         POP HL
C01F 115C80     LD DE,FCB
C022 CDF4C0     CALL USRPRMSET
C025 EB         EX DE,HL;need this !
C026 78         LD A,B
C027 B7         OR A
C028 CA38C0     JP Z,USRCMD62
C02B 23         INC HL
C02C 05         DEC B
C02D C338C0     JP USRCMD62
              ;
C030 115C80   USRCMD6:LD DE,FCB
C033 0600       LD B,00
C035 CDF4C0     CALL USRPRMSET
C038 116C80   USRCMD62:LD DE,FCB2
C03B CDF4C0     CALL USRPRMSET
              ;
C03E 213CD0   USRCMD7:LD HL,SYSFCB
C041 7E         LD A,(HL)
C042 B7         OR A
C043 CA5CC0     JP Z,USRCMD70
C046 3D         DEC A
C047 5F         LD E,A
C048 CD33C4     CALL DRVNOSET
C04B CA5CC0     JP Z,USRCMD70
C04E CDA2C1     CALL BADDRVDP
C051 C1         POP BC
C052 E1         POP HL
C053 3A05D0     LD A,(CDRV_DIRWK)
C056 3204D0     LD (CURDRV),A
C059 C328BC     JP CCPENTRY
C05C 113CD0   USRCMD70:LD DE,SYSFCB
C05F CD36C4     CALL OPEN
C062 3C         INC A
C063 CAB6C0     JP Z,USRCMDERR
C066 AF         XOR A
C067 325CD0     LD (SYSFCBCR),A
C06A 3A4BD0     LD A,(SYSFCBRC)
C06D B7         OR A
C06E CAC9C0     JP Z,USRCMDERR2
C071 47         LD B,A
C072 210081     LD HL,TRNS0
C075 C5       USRCMD71:PUSH BC
C076 E5         PUSH HL
C077 113CD0     LD DE,SYSFCB
C07A CD45C4     CALL SEQRD
C07D B7         OR A
C07E C2D4C0     JP NZ,USRCMDERR3
C081 E1         POP HL
C082 EB         EX DE,HL
C083 2A06D0     LD HL,(DMABFADRS)
C086 EB         EX DE,HL
C087 0E80       LD C,80
C089 1A       USRCMD72:LD A,(DE)
C08A 77         LD (HL),A
C08B 23         INC HL
C08C 13         INC DE
C08D 0D         DEC C
C08E C289C0     JP NZ,USRCMD72
C091 C1         POP BC
C092 05         DEC B
C093 C275C0     JP NZ,USRCMD71
C096 2A06D0     LD HL,(DMABFADRS)
C099 2262D0     LD (DIRBFADRS),HL
C09C 3A05D0     LD A,(CDRV_DIRWK)
C09F 2104D0     LD HL,CURDRV
C0A2 BE         CP (HL)
C0A3 CAAAC0     JP Z,USRCMD722
C0A6 5F         LD E,A
C0A7 CD33C4     CALL DRVNOSET
C0AA CD0081   USRCMD722:CALL TRNS0
C0AD 3A05D0   USRCMD73:LD A,(CDRV_DIRWK)
C0B0 3204D0     LD (CURDRV),A
C0B3 C328BC     JP CCPENTRY
              ;
C0B6 C1       USRCMDERR:POP BC
C0B7 E1         POP HL
C0B8 5E       USRCMDERR1:LD E,(HL)
C0B9 CD0FC4     CALL CONOUT
C0BC 23         INC HL
C0BD 05         DEC B
C0BE C2B8C0     JP NZ,USRCMDERR1
C0C1 1E3F       LD E,3F
C0C3 CD0FC4     CALL CONOUT
C0C6 C3ADC0     JP USRCMD73
              ;
C0C9 C1       USRCMDERR2:POP BC
C0CA E1         POP HL
C0CB 11E1C0     LD DE,NODATA
C0CE CD24C4     CALL DEOUT
C0D1 C3ADC0     JP USRCMD73
              ;
C0D4 E1       USRCMDERR3:POP HL
C0D5 C1         POP BC
C0D6 C1         POP BC
C0D7 E1         POP HL
C0D8 11E9C0     LD DE,READERR
C0DB CD24C4     CALL DEOUT
C0DE C3ADC0     JP USRCMD73
              ;
C0E1 6E6F2064 NODATA:"no d"
C0E5 61746124   "ata$"
              ;
C0E9 72656164 READERR:"read"
C0ED 20657272   " err"
C0F1 657224     "er$"
              ;
              ;user parameter to FCB
              ;return with HL to DE changed!
              ;need EX DE,HL after this routine.
C0F4 EB       USRPRMSET:EX DE,HL
C0F5 3600       LD (HL),00
C0F7 23         INC HL
C0F8 E5         PUSH HL
C0F9 0E0B       LD C,0B;=11
C0FB 3620     USRPRMSET2:LD (HL),20
C0FD 23         INC HL
C0FE 0D         DEC C
C0FF C2FBC0     JP NZ,USRPRMSET2
C102 0E04       LD C,04
C104 3600     USRPRMSET22:LD (HL),00
C106 23         INC HL
C107 0D         DEC C
C108 C204C1     JP NZ,USRPRMSET22
C10B E1         POP HL
C10C 78         LD A,B
C10D B7         OR A
C10E C8         RET Z
C10F FE01       CP 01
C111 CA29C1     JP Z,USRPRMSET4
C114 13         INC DE
C115 1A         LD A,(DE)
C116 FE3A       CP 3A;':'
C118 1B         DEC DE
C119 C227C1     JP NZ,USRPRMSET3
C11C 1A         LD A,(DE)
C11D D640       SUB 40;'A' to 01
C11F 2B         DEC HL
C120 77         LD (HL),A
C121 23         INC HL
C122 13         INC DE
C123 13         INC DE
C124 05         DEC B
C125 05         DEC B
C126 C8         RET Z
C127 0E08     USRPRMSET3:LD C,08
C129 1A       USRPRMSET4:LD A,(DE)
C12A FE2E       CP 2E;'.'
C12C CA68C1     JP Z,USRPRMSET8
C12F FE2A       CP 2A;'*'
C131 CA55C1     JP Z,USRPRMSET7
C134 77         LD (HL),A
C135 23         INC HL
C136 13         INC DE
C137 0D         DEC C
C138 CA40C1     JP Z,USRPRMSET5
C13B 05         DEC B
C13C C8         RET Z
C13D C329C1     JP USRPRMSET4
              ;
C140 05       USRPRMSET5:DEC B
C141 C8         RET Z
C142 1A         LD A,(DE)
C143 FE2E       CP 2E;'.'
C145 CA68C1     JP Z,USRPRMSET8
C148 23         INC HL
C149 23         INC HL
C14A 23         INC HL
C14B 1A       USRPRMSET52:LD A,(DE)
C14C FE20       CP 20
C14E C8         RET Z
C14F 13         INC DE
C150 05         DEC B
C151 C8         RET Z
C152 C34BC1     JP USRPRMSET52
              ;
C155 363F     USRPRMSET7:LD (HL),3F;'?'
C157 23         INC HL
C158 0D         DEC C
C159 C255C1     JP NZ,USRPRMSET7
C15C 13       USRPRMSET71:INC DE
C15D 05         DEC B
C15E C8         RET Z
C15F 1A         LD A,(DE)
C160 FE2E       CP 2E;'.'
C162 CA68C1     JP Z,USRPRMSET8
C165 C34BC1     JP USRPRMSET52
              ;
C168 13       USRPRMSET8:INC DE
C169 05         DEC B
C16A C8         RET Z
C16B 79         LD A,C
C16C B7         OR A
C16D CA75C1     JP Z,USRPRMSET80
C170 23       USRPRMSET8M:INC HL
C171 0D         DEC C
C172 C270C1     JP NZ,USRPRMSET8M
C175 0E03     USRPRMSET80:LD C,03
C177 1A       USRPRMSET81:LD A,(DE)
C178 FE2A       CP 2A;'*'
C17A CA8CC1     JP Z,USRPRMSET82
C17D FE20       CP 20
C17F C8         RET Z
C180 77         LD (HL),A
C181 13         INC DE
C182 23         INC HL
C183 0D         DEC C
C184 CA9DC1     JP Z,USRPRMSET85
C187 05         DEC B
C188 C8         RET Z
C189 C377C1     JP USRPRMSET81
C18C 363F     USRPRMSET82:LD (HL),3F;'?'
C18E 23         INC HL
C18F 0D         DEC C
C190 C28CC1     JP NZ,USRPRMSET82
C193 13       USRPRMSET83:INC DE
C194 05         DEC B
C195 C8         RET Z
C196 1A       USRPRMSET84:LD A,(DE)
C197 FE20       CP 20
C199 C293C1     JP NZ,USRPRMSET83
C19C C9         RET
              ;
C19D 05       USRPRMSET85:DEC B
C19E C8         RET Z
C19F C396C1     JP USRPRMSET84
              ;
C1A2 11B1C1   BADDRVDP:LD DE,BADDRV
C1A5 C324C4     JP DEOUT
              ;
C1A8 11BBC1   ERRDP:LD DE,ERRT
C1AB CD24C4   ERRDP2:CALL DEOUT
C1AE C328BC     JP CCPENTRY
              ;
C1B1 62616420 BADDRV:"bad "
C1B5 64726976   "driv"
C1B9 6524       "e$"
C1BB 657272   ERRT:"err"
C1BE 24         DB 24
              ;
C1BF 1E20     SPDP:LD E,20
C1C1 C30FC4     JP CONOUT
C1C4 1E0D     CRLF:LD E,0D
C1C6 CD0FC4     CALL CONOUT
C1C9 1E0A       LD E,0A
C1CB C30FC4     JP CONOUT
              ;U
ALVADRSRD    =C45A  ALVSET       =C47B  ALVTOP       =D01E  
ATTRSET      =C463  BADDRV       =C1B1  BADDRVDP     =C1A2  
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     =BC28  
CCPENTRY0    =BC00  CCPENTRY01   =BC4D  CCPENTRY1    =BC6D  
CCPENTRY12   =BC7A  CCPENTRY2    =BC80  CCPENTRY_01  =BC08  
CCPENTRY_1   =BC41  CDRV_DIRWK   =D005  CLOSE        =C439  
CMDCK        =BCA8  CMDCK1       =BCAD  CMDCK2       =BCAF  
CMDCK3       =BCC5  CMDCK4       =BCC9  CMDCKEND     =BCDA  
CMDJMPTBL    =BD02  CMDTBL       =BCEB  CONBFIN      =C427  
CONBFINWK    =D066  CONCHK       =C42A  CONIN        =C40C  
CONINBF      =D07E  CONINOT      =C41B  CONOUT       =C40F  
CRLF         =C1C4  CSVTOP       =D01C  CURDRV       =D004  
CURDRVNORD   =C454  CURDRVVCT    =D000  CURDRVVCTRD  =C451  
CURROMK      =D061  CURSOR       =D064  DECIN        =BF39  
DECIN2       =BF3D  DELETE       =C442  DEOUT        =C424  
DIR          =BD0C  DIR2         =BD14  DIR3         =BD26  
DIR4         =BD2D  DIR40        =BD54  DIR41        =BD55  
DIR42        =BD5F  DIR422       =BD69  DIR43        =BD6F  
DIR44        =BD7C  DIRADRS      =D018  DIRALC       =D029  
DIRBFADRS    =D062  DIRCNTR      =D00E  DIRDPS       =BDAF  
DIRDPS12     =BDD3  DIRDPS13     =BDD6  DIRDPS2      =BDE1  
DIRDPS3      =BDEF  DIRDPS4      =BE07  DIREND       =BD90  
DIREND2      =BD91  DIRMAX       =D027  DIRSCT       =D009  
DIRTRK       =D008  DIR_NOFILE   =BD9E  DISKRES      =C430  
DMAADRSSET   =C457  DMABF        =8080  DMABFADRS    =D006  
DMACPY       =BF29  DMACPY2      =BF30  DPARAM       =D010  
DPARAMRD     =C466  DRVCHR       =D00F  DRVNOSET     =C433  
DRVVCTRES    =C475  DSKCHGER     =BCA1  ERA          =BE0B  
ERRDP        =C1A8  ERRDP2       =C1AB  ERRT         =C1BB  
FCB          =805C  FCB2         =806C  FNPOS        =D00A  
FNPOSS       =D00B  FSIZERD      =C46F  INDATA       =D060  
IOBYTE       =8003  IOBYTERD     =C41E  IOBYTESET    =C421  
LSTOUT       =C418  NEWOPEN      =C44B  NODATA       =C0E1  
NOFILE       =BDA7  OPEN         =C436  PUNOUT       =C415  
RDRIN        =C412  READERR      =C0E9  REN          =BF58  
REN2         =BF6F  REN3         =BF8F  RENAME       =C44E  
RENERR       =BFB1  RNDMNOSET    =C472  RNDMRD       =C469  
RNDMWR       =C46C  RNDMWR0      =C478  ROVCT        =D002  
ROVRD        =C460  SAVE         =BE8A  SAVE2        =BEBA  
SAVE3        =BED5  SAVE4        =BEEC  SAVECNTR     =D00C  
SAVEEND      =BF17  SAVEERR      =BF25  SEC          =D020  
SECTRN       =D230  SEQRD        =C445  SEQWR        =C448  
SPDP         =C1BF  SRCHFST      =C43C  SRCHNXT      =C43F  
SYSFCB       =D03C  SYSFCBALC    =D04C  SYSFCBCR     =D05C  
SYSFCBEX     =D048  SYSFCBRC     =D04B  SYSRES       =C409  
TRNS0        =8100  TYPE         =BE26  TYPE2        =BE3A  
TYPE31       =BE5B  TYPE32       =BE6B  TYPEEND      =BE82  
TYPEERR      =BE86  USRCMD       =BFB6  USRCMD2      =BFC6  
USRCMD3      =BFF2  USRCMD4      =BFF5  USRCMD5      =C00C  
USRCMD52     =C016  USRCMD6      =C030  USRCMD62     =C038  
USRCMD7      =C03E  USRCMD70     =C05C  USRCMD71     =C075  
USRCMD72     =C089  USRCMD722    =C0AA  USRCMD73     =C0AD  
USRCMDERR    =C0B6  USRCMDERR1   =C0B8  USRCMDERR2   =C0C9  
USRCMDERR3   =C0D4  USRPRMSET    =C0F4  USRPRMSET2   =C0FB  
USRPRMSET22  =C104  USRPRMSET3   =C127  USRPRMSET4   =C129  
USRPRMSET5   =C140  USRPRMSET52  =C14B  USRPRMSET7   =C155  
USRPRMSET71  =C15C  USRPRMSET8   =C168  USRPRMSET80  =C175  
USRPRMSET81  =C177  USRPRMSET82  =C18C  USRPRMSET83  =C193  
USRPRMSET84  =C196  USRPRMSET85  =C19D  USRPRMSET8M  =C170  
VERRD        =C42D  WPSET        =C46D  

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

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