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

[第154回]に戻る

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


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

出来あがりましたCP/M互換DOS(仮RAMディスク版)ZBDOSプログラムのアセンブルリストです。

2012/6/8  8:19  ZBDOS1Y.TXT
END=CD92
              ;bdos for nd80z3
              ;CP/M2.2 compatible
              ;2012/5/6 5/7 5/8 5/9 5/11 5/12 5/13 5/14 5/15 5/16
              ;5/17 5/19 5/20 5/21 5/22 5/23 5/25 5/28 5/29 5/31
              ;6/1 6/2 6/7 6/8
              ;
                ORG $C406
              ;
                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
              ;
                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
                DIRADRS=$D018
                DPTOP=$D01A
                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
                CURSORWK=$D068
                RWSW=$D069
              ;
                CONINBF=$D0FE;-D1FE
              ;         
              ;BDOS ENTRY
              ;
C406 C37EC4     JP BDOS
              ;jump table
C409 C3DDC4     JP SYSRES;00
C40C C3DEC4     JP CONIN;01
C40F C3F7C4     JP CONOUT;02
C412 C35DC5     JP RDRIN;03
C415 C360C5     JP PUNOUT;04
C418 C364C5     JP LSTOUT;05
C41B C365C5     JP CONINOT;06
C41E C375C5     JP IOBYTERD;07
C421 C379C5     JP IOBYTESET;08
C424 C37EC5     JP DEOUT;09
C427 C38CC5     JP CONBFIN;0A
C42A C3FCC6     JP CONCHK;0B
C42D C325C7     JP VERRD;0C
C430 C329C7     JP DISKRES;0D
C433 C330C7     JP DRVNOSET;0E
C436 C388C7     JP OPEN;0F
C439 C3C1C7     JP CLOSE;10
C43C C3F6C7     JP SRCHFST;11
C43F C36FC8     JP SRCHNXT;12
C442 C392C8     JP DELETE;13
C445 C3C9C8     JP SEQRD;14
C448 C31AC9     JP SEQWR;15
C44B C3A5C9     JP NEWOPEN;16
C44E C31DCA     JP RENAME;17
C451 C347CA     JP CURDRVVCTRD;18
C454 C34BCA     JP CURDRVNORD;19
C457 C34FCA     JP DMAADRSSET;1A
C45A C355CA     JP ALVADRSRD;1B
C45D C359CA     JP WPSET;1C
C460 C376CA     JP ROVRD;1D
C463 C37ACA     JP ATTRSET;1E
C466 C3B6CA     JP DPARAMRD;1F
C469 C3BBCA     JP RNDMRD;21
C46C C394CB     JP RNDMWR;22
C46F C3A7CB     JP FSIZERD;23
C472 C3E7CB     JP RNDMNOSET;24
C475 C31FCC     JP DRVVCTRES;25
C478 C340CC     JP RNDMWR0;28
              ;
C47B C392CC     JP ALVSET
              ;
C47E 69       BDOS:LD L,C
C47F 2600       LD H,00
C481 29         ADD HL,HL
C482 018BC4     LD BC,FNCTBL
C485 09         ADD HL,BC
C486 7E         LD A,(HL)
C487 23         INC HL
C488 66         LD H,(HL)
C489 6F         LD L,A
C48A E9         JP (HL)
              ;
C48B DDC4     FNCTBL:DW SYSRES;00
C48D DEC4       DW CONIN;01
C48F F7C4       DW CONOUT;02
C491 5DC5       DW RDRIN;03
C493 60C5       DW PUNOUT;04
C495 64C5       DW LSTOUT;05
C497 65C5       DW CONINOT;06
C499 75C5       DW IOBYTERD;07
C49B 79C5       DW IOBYTESET;08
C49D 7EC5       DW DEOUT;09
C49F 8CC5       DW CONBFIN;0A
C4A1 FCC6       DW CONCHK;0B
C4A3 25C7       DW VERRD;0C
C4A5 29C7       DW DISKRES;0D
C4A7 30C7       DW DRVNOSET;0E
C4A9 88C7       DW OPEN;0F
C4AB C1C7       DW CLOSE;10
C4AD F6C7       DW SRCHFST;11
C4AF 6FC8       DW SRCHNXT;12
C4B1 92C8       DW DELETE;13
C4B3 C9C8       DW SEQRD;14
C4B5 1AC9       DW SEQWR;15
C4B7 A5C9       DW NEWOPEN;16
C4B9 1DCA       DW RENAME;17
C4BB 47CA       DW CURDRVVCTRD;18
C4BD 4BCA       DW CURDRVNORD;19
C4BF 4FCA       DW DMAADRSSET;1A
C4C1 55CA       DW ALVADRSRD;1B
C4C3 59CA       DW WPSET;1C
C4C5 76CA       DW ROVRD;1D
C4C7 7ACA       DW ATTRSET;1E
C4C9 B6CA       DW DPARAMRD;1F
C4CB BACA       DW UNDEFINE;20
C4CD BBCA       DW RNDMRD;21
C4CF 94CB       DW RNDMWR;22
C4D1 A7CB       DW FSIZERD;23
C4D3 E7CB       DW RNDMNOSET;24
C4D5 1FCC       DW DRVVCTRES;25
C4D7 BACA       DW UNDEFINE;26
C4D9 BACA       DW UNDEFINE;27
C4DB 40CC       DW RNDMWR0;28
              ;
              ;SYSTEM RESET FCALL 00
              ;
C4DD C9       SYSRES:RET
              ;
              ;CONSOLE INPUT FCALL 01
              ;
C4DE CDEAC4   CONIN:CALL CONINSB
C4E1 D5         PUSH DE
C4E2 F5         PUSH AF
C4E3 5F         LD E,A
C4E4 CDF7C4     CALL CONOUT
C4E7 F1         POP AF
C4E8 D1         POP DE
C4E9 C9         RET
              ;
C4EA E5       CONINSB:PUSH HL
C4EB 2160D0     LD HL,INDATA
C4EE 7E         LD A,(HL)
C4EF B7         OR A
C4F0 3600       LD (HL),00
C4F2 E1         POP HL
C4F3 C0         RET NZ
C4F4 C309D2     JP B_CONIN
              ;
              ;CONSOLE OUTPUT FCALL 02
              ;
C4F7 E5       CONOUT:PUSH HL
C4F8 C5         PUSH BC
C4F9 2A64D0     LD HL,(CURSOR)
C4FC 7B         LD A,E
C4FD FE08       CP 08;BS
C4FF CA24C5     JP Z,CONOUT2
C502 FE09       CP 09;TAB
C504 CA32C5     JP Z,CONOUT3
C507 FE0D       CP 0D;CR
C509 CA4EC5     JP Z,CONOUT4
C50C FE0A       CP 0A;LF
C50E CA4EC5     JP Z,CONOUT4
C511 FE1B       CP 1B
C513 DA57C5     JP C,CONOUT44;ctrl+
C516 4B       CONOUT12:LD C,E
C517 CD0CD2     CALL B_CONOUT
C51A 2C         INC L
C51B 7D         LD A,L
C51C FE50       CP 50
C51E CA52C5     JP Z,CONOUT42
C521 C354C5     JP CONOUT43
              ;BS
C524 7D       CONOUT2:LD A,L
C525 B7         OR A
C526 CA57C5     JP Z,CONOUT44
C529 4B         LD C,E;BS
C52A CD0CD2     CALL B_CONOUT
C52D 2D         DEC L
C52E 7D         LD A,L
C52F C354C5     JP CONOUT43
              ;TAB
C532 CD38C5   CONOUT3:CALL TABOUT
C535 C354C5     JP CONOUT43
              ;
C538 7D       TABOUT:LD A,L
C539 2F         CPL
C53A E607       AND 07
C53C 3C         INC A
C53D 47         LD B,A
C53E 0E20       LD C,20
C540 CD0CD2   TABOUT1:CALL B_CONOUT
C543 2C         INC L
C544 05         DEC B
C545 C240C5     JP NZ,TABOUT1
C548 7D         LD A,L
C549 FE50       CP 50
C54B C0         RET NZ
C54C AF         XOR A
C54D C9         RET
              ;
              ;CR,LF
C54E 4B       CONOUT4:LD C,E
C54F CD0CD2     CALL B_CONOUT
C552 3E00     CONOUT42:LD A,00
C554 3264D0   CONOUT43:LD (CURSOR),A
C557 CDFCC6   CONOUT44:CALL CONCHK
C55A C1         POP BC
C55B E1         POP HL
C55C C9         RET
              ;
              ;READER INPUT FCALL 03
              ;
C55D C315D2   RDRIN:JP B_READER
              ;
              ;PUNCHER OUTPUT FCALL 04
              ;
C560 4B       PUNOUT:LD C,E
C561 C312D2     JP B_PUNCH
              ;
              ;PRINTER OUTPUT FCALL 05
              ;
C564 C9       LSTOUT:RET
              ;
              ;CONSOLE INPUT/OUTPUT FCALL 06
              ;
C565 7B       CONINOT:LD A,E
C566 3C         INC A;if FF
C567 CA6EC5     JP Z,CONIO_IN
C56A 4B         LD C,E
C56B C30CD2     JP B_CONOUT
C56E CD06D2   CONIO_IN:CALL B_CONST
C571 C8         RET Z
C572 C309D2     JP B_CONIN
              ;
              ;IOBYTE READ FCALL 07
              ;
C575 3A0380   IOBYTERD:LD A,(IOBYTE)
C578 C9         RET
              ;
              ;IOBYTE SET FCALL 08
              ;
C579 7B       IOBYTESET:LD A,E
C57A 320380     LD (IOBYTE),A
C57D C9         RET
              ;
              ;CHARACTER OUT FROM (DE) TO $ / FCALL 09
              ;
C57E 62       DEOUT:LD H,D
C57F 6B         LD L,E
C580 7E       DEOUT2:LD A,(HL)
C581 FE24       CP 24;$
C583 C8         RET Z
C584 5F         LD E,A
C585 CDF7C4     CALL CONOUT
C588 23         INC HL
C589 C380C5     JP DEOUT2
              ;
              ;CONSOLE BUFFER INPUT FCALL 0A
              ;if ctrl+D then BREAK
              ;
C58C 2A64D0   CONBFIN:LD HL,(CURSOR)
C58F 7D         LD A,L
C590 3268D0     LD (CURSORWK),A
C593 62         LD H,D
C594 6B         LD L,E
C595 E5       CONBFIN1:PUSH HL
C596 4E         LD C,(HL)
C597 0600       LD B,00
C599 23         INC HL
C59A E5         PUSH HL
C59B 23         INC HL
C59C 2266D0     LD (CONBFINWK),HL
C59F CDEAC4   CONBFIN2:CALL CONINSB
C5A2 E67F       AND 7F
C5A4 FE04       CP 04;ctrl+D
C5A6 C2B0C5     JP NZ,CONBFIN22
C5A9 5F         LD E,A
C5AA 78         LD A,B
C5AB B7         OR A
C5AC CA36D2     JP Z,ZREENT
C5AF 7B         LD A,E
C5B0 FE0D     CONBFIN22:CP 0D;CR
C5B2 CAE3C5     JP Z,CONBFIN4
C5B5 FE0A       CP 0A;LF
C5B7 CAE3C5     JP Z,CONBFIN4
C5BA FE09       CP 09;TAB
C5BC CAFCC5     JP Z,CONBFIN3
C5BF FE08       CP 08;BS
C5C1 CA1EC6     JP Z,CONBFIN5
C5C4 FE12       CP 12;^R
C5C6 CA5CC6     JP Z,CONBFIN6
C5C9 FE15       CP 15;^U
C5CB CAB1C6     JP Z,CONBFIN7
C5CE FE18       CP 18;^X
C5D0 CAD0C6     JP Z,CONBFIN8
C5D3 FE1B       CP 1B
C5D5 DAE6C6     JP C,CONBFIN9
C5D8 77       CONBFIN23:LD (HL),A
C5D9 5F         LD E,A
C5DA CDF7C4     CALL CONOUT
C5DD 23       CONBFIN24:INC HL
C5DE 04         INC B
C5DF 0D         DEC C
C5E0 C29FC5     JP NZ,CONBFIN2
              ;CR,LF
C5E3 E1       CONBFIN4:POP HL
C5E4 70         LD (HL),B
C5E5 54         LD D,H
C5E6 5D         LD E,L
C5E7 EB         EX DE,HL
C5E8 78         LD A,B
C5E9 B7         OR A
C5EA CAF9C5     JP Z,CONBFIN43
C5ED 23       CONBFIN41:INC HL
C5EE 7E         LD A,(HL)
C5EF B7         OR A
C5F0 F2F5C5     JP P,CONBFIN42
C5F3 3609       LD (HL),09;TAB
C5F5 05       CONBFIN42:DEC B
C5F6 C2EDC5     JP NZ,CONBFIN41
C5F9 EB       CONBFIN43:EX DE,HL
C5FA D1         POP DE;dummy
C5FB C9         RET
              ;
              ;TAB
C5FC E5       CONBFIN3:PUSH HL
C5FD C5         PUSH BC
C5FE 2A64D0     LD HL,(CURSOR)
C601 7D         LD A,L
C602 2F         CPL
C603 E607       AND 07
C605 47         LD B,A
C606 3C         INC A
C607 4F         LD C,A
C608 1E20       LD E,20
C60A CDF7C4   CONINBF31:CALL CONOUT
C60D 0D         DEC C
C60E C20AC6     JP NZ,CONINBF31
C611 78         LD A,B
C612 07         RLCA
C613 07         RLCA
C614 07         RLCA
C615 07         RLCA
C616 F689       OR 89;TAB
C618 C1         POP BC
C619 E1         POP HL
C61A 77         LD (HL),A
C61B C3DDC5     JP CONBFIN24
              ;
              ;BS
C61E 78       CONBFIN5:LD A,B
C61F B7         OR A
C620 CA9FC5     JP Z,CONBFIN2
C623 2B         DEC HL
C624 7E         LD A,(HL)
C625 B7         OR A
C626 FA39C6     JP M,CONBFIN54;TAB
C629 FE20       CP 20;ctrl check
C62B D231C6     JP NC,CONBFIN52
C62E CD4FC6     CALL BSOUT
C631 CD4FC6   CONBFIN52:CALL BSOUT
C634 05       CONBFIN53:DEC B
C635 0C         INC C
C636 C39FC5     JP CONBFIN2
C639 E5       CONBFIN54:PUSH HL
C63A C5         PUSH BC
C63B 0F         RRCA
C63C 0F         RRCA
C63D 0F         RRCA
C63E 0F         RRCA
C63F E607       AND 07
C641 3C         INC A
C642 4F         LD C,A
C643 CD4FC6   CONBFIN55:CALL BSOUT
C646 0D         DEC C
C647 C243C6     JP NZ,CONBFIN55
C64A C1         POP BC
C64B E1         POP HL
C64C C334C6     JP CONBFIN53
              ;
C64F CD57C6   BSOUT:CALL BSOUT2
C652 1E20       LD E,20
C654 CDF7C4     CALL CONOUT
C657 1E08     BSOUT2:LD E,08
C659 C3F7C4     JP CONOUT
              ;
              ; ctrl+R
C65C 1E23     CONBFIN6:LD E,23;#
C65E CDF7C4     CALL CONOUT
C661 C5         PUSH BC
C662 3A68D0     LD A,(CURSORWK)
C665 4F         LD C,A
C666 CDA7C6     CALL CRLF
C669 79         LD A,C
C66A B7         OR A
C66B CA77C6     JP Z,CONBFIN62
C66E 1E20       LD E,20
C670 CDF7C4   CONBFIN61:CALL CONOUT
C673 0D         DEC C
C674 C270C6     JP NZ,CONBFIN61
C677 2A66D0   CONBFIN62:LD HL,(CONBFINWK)
C67A 7E       CONBFIN63:LD A,(HL)
C67B B7         OR A
C67C FA97C6     JP M,CONBFIN66;TAB
C67F FE20       CP 20;ctrl check
C681 D28AC6     JP NC,CONBFIN64
C684 CDECC6     CALL CTRLDSP
C687 C38EC6     JP CONBFIN65
C68A 5F       CONBFIN64:LD E,A
C68B CDF7C4     CALL CONOUT
C68E 23       CONBFIN65:INC HL
C68F 05         DEC B
C690 C27AC6     JP NZ,CONBFIN63
C693 C1         POP BC
C694 C39FC5     JP CONBFIN2
C697 E5       CONBFIN66:PUSH HL
C698 C5         PUSH BC
C699 2A64D0     LD HL,(CURSOR)
C69C CD38C5     CALL TABOUT
C69F 2264D0     LD (CURSOR),HL
C6A2 C1         POP BC
C6A3 E1         POP HL
C6A4 C38EC6     JP CONBFIN65
              ;
C6A7 1E0D     CRLF:LD E,0D
C6A9 CDF7C4     CALL CONOUT
C6AC 1E0A       LD E,0A
C6AE C3F7C4     JP CONOUT
              ;
              ;ctrl+U
C6B1 1E23     CONBFIN7:LD E,23;#
C6B3 CDF7C4     CALL CONOUT
C6B6 3A68D0     LD A,(CURSORWK)
C6B9 4F         LD C,A
C6BA CDA7C6     CALL CRLF
C6BD 79         LD A,C
C6BE B7         OR A
C6BF CACBC6     JP Z,CONBFIN72
C6C2 1E20     CONBFIN71:LD E,20
C6C4 CDF7C4     CALL CONOUT
C6C7 0D         DEC C
C6C8 C2C2C6     JP NZ,CONBFIN71
C6CB E1       CONBFIN72:POP HL
C6CC E1         POP HL
C6CD C395C5     JP CONBFIN1
              ;
              ;ctrl+X
C6D0 2B       CONBFIN8:DEC HL
C6D1 7E         LD A,(HL)
C6D2 FE20       CP 20;ctrl check
C6D4 D2DAC6     JP NC,CONBFIN82
C6D7 CD4FC6     CALL BSOUT
C6DA CD4FC6   CONBFIN82:CALL BSOUT
C6DD 05         DEC B
C6DE C2D0C6     JP NZ,CONBFIN8
C6E1 E1         POP HL
C6E2 E1         POP HL
C6E3 C395C5     JP CONBFIN1
              ;
              ;ctrl+
C6E6 CDECC6   CONBFIN9:CALL CTRLDSP
C6E9 C3D8C5     JP CONBFIN23
C6EC F5       CTRLDSP:PUSH AF
C6ED 1E5E       LD E,5E;^
C6EF CDF7C4     CALL CONOUT
C6F2 F1         POP AF
C6F3 F5         PUSH AF
C6F4 C640       ADD A,40
C6F6 5F         LD E,A
C6F7 CDF7C4     CALL CONOUT
C6FA F1         POP AF
C6FB C9         RET
              ;
              ;CONSOLE STATUS CHECK FCALL 0B
              ;
C6FC E5       CONCHK:PUSH HL
C6FD 2160D0     LD HL,INDATA
C700 7E         LD A,(HL)
C701 B7         OR A
C702 C221C7     JP NZ,CONCHK3
C705 CD06D2     CALL B_CONST
C708 C20DC7     JP NZ,CONCHK1
C70B E1         POP HL
C70C C9         RET
C70D CD09D2   CONCHK1:CALL B_CONIN
C710 FE13       CP 13;Ctrl+S
C712 C220C7     JP NZ,CONCHK2
C715 CD09D2     CALL B_CONIN
C718 FE04       CP 04;Ctrl+D
C71A C220C7     JP NZ,CONCHK2
C71D C336D2     JP ZREENT
C720 77       CONCHK2:LD (HL),A
C721 3E01     CONCHK3:LD A,01
C723 E1         POP HL
C724 C9         RET
              ;
              ;VERSION NO. READ FCALL 0C
              ;
C725 212200   VERRD:LD HL,$0022
C728 C9         RET
              ;
              ;DISK RESET FCALL 0D
              ;
C729 210000   DISKRES:LD HL,$0000
C72C 2202D0     LD (ROVCT),HL
C72F C9         RET
              ;
              ;DISK DRIVE NO. SET FCALL 0E
              ;
C730 7B       DRVNOSET:LD A,E
C731 4F       DRVNOSET1:LD C,A
C732 47         LD B,A
C733 C5         PUSH BC
C734 CD1BD2     CALL B_SELDSK
C737 C27DC7     JP NZ,DRVNOSETE
C73A 1110D0     LD DE,DPARAM
C73D 0E10       LD C,10
C73F CD7FC7     CALL PRMCOPY
C742 2A1AD0     LD HL,(DPTOP)
C745 0E0F       LD C,0F
C747 CD7FC7     CALL PRMCOPY
C74A C1         POP BC
C74B 210100     LD HL,$0001
C74E 0C         INC C
C74F 0D       DRVNOSET2:DEC C
C750 CA57C7     JP Z,DRVNOSET3
C753 29         ADD HL,HL
C754 C34FC7     JP DRVNOSET2
C757 54       DRVNOSET3:LD D,H
C758 5D         LD E,L
C759 7D         LD A,L
C75A 2A00D0     LD HL,(CURDRVVCT)
C75D B5         OR L
C75E 6F         LD L,A
C75F 7A         LD A,D
C760 B4         OR H
C761 67         LD H,A
C762 2200D0     LD (CURDRVVCT),HL
C765 78         LD A,B
C766 3204D0     LD (CURDRV),A
C769 7B         LD A,E
C76A 2A02D0     LD HL,(ROVCT)
C76D A5         AND L
C76E 6F         LD L,A
C76F 7A         LD A,D
C770 A4         AND H
C771 B5         OR L
C772 3261D0     LD (CURROMK),A
C775 C8         RET Z
C776 3EFF       LD A,FF
C778 3261D0     LD (CURROMK),A
C77B AF         XOR A
C77C C9         RET
C77D C1         DRVNOSETE:POP BC
C77E C9         RET
              ;
C77F 7E       PRMCOPY:LD A,(HL)
C780 12         LD (DE),A
C781 23         INC HL
C782 13         INC DE
C783 0D         DEC C
C784 C27FC7     JP NZ,PRMCOPY
C787 C9         RET
              ;
              ;DISK FILE OPEN FCALL 0F
              ;
C788 CDF6C7   OPEN:CALL SRCHFST
C78B FEFF       CP FF
C78D C8         RET Z
C78E E5         PUSH HL
C78F 010C00     LD BC,$000C
C792 09         ADD HL,BC
C793 7E         LD A,(HL);extent No.
C794 E1         POP HL
C795 B7         OR A
C796 CAADC7     JP Z,OPEN2
C799 CD6FC8     CALL SRCHNXT
C79C FEFF       CP FF
C79E C8         RET Z
C79F E5         PUSH HL
C7A0 010C00     LD BC,$000C
C7A3 09         ADD HL,BC
C7A4 7E         LD A,(HL);extent No.
C7A5 E1         POP HL
C7A6 B7         OR A
C7A7 CAADC7     JP Z,OPEN2
C7AA 3EFF       LD A,FF
C7AC C9         RET
C7AD 0620     OPEN2:LD B,20
C7AF 1A         LD A,(DE)
C7B0 F5         PUSH AF
C7B1 D5         PUSH DE
C7B2 7E       OPEN3:LD A,(HL)
C7B3 12         LD (DE),A
C7B4 13         INC DE
C7B5 23         INC HL
C7B6 05         DEC B
C7B7 C2B2C7     JP NZ,OPEN3
C7BA D1         POP DE
C7BB F1         POP AF
C7BC 12         LD (DE),A
C7BD 3A0BD0     LD A,(FNPOSS)
C7C0 C9         RET
              ;
              ;DISK FILE CLOSE FCALL 10
              ;
C7C1 CDF6C7   CLOSE:CALL SRCHFST
C7C4 FEFF       CP FF
C7C6 C8         RET Z
C7C7 E5       CLOSE1:PUSH HL
C7C8 010C00     LD BC,$000C
C7CB 09         ADD HL,BC
C7CC 7E         LD A,(HL);extent No.
C7CD 62         LD H,D
C7CE 6B         LD L,E
C7CF 09         ADD HL,BC
C7D0 46         LD B,(HL)
C7D1 E1         POP HL
C7D2 B8         CP B
C7D3 CADFC7     JP Z,CLOSE2
C7D6 CD6FC8     CALL SRCHNXT
C7D9 FEFF       CP FF
C7DB C8         RET Z
C7DC C3C7C7     JP CLOSE1
C7DF 0620     CLOSE2:LD B,20
C7E1 D5         PUSH DE
C7E2 E5         PUSH HL
C7E3 1A       CLOSE3:LD A,(DE)
C7E4 77         LD (HL),A
C7E5 23         INC HL
C7E6 13         INC DE
C7E7 05         DEC B
C7E8 C2E3C7     JP NZ,CLOSE3
C7EB E1         POP HL
C7EC 3600       LD (HL),00
C7EE CD2AD2     CALL B_WRITE
C7F1 D1         POP DE
C7F2 3A0BD0     LD A,(FNPOSS)
C7F5 C9         RET
              ;
              ;FILE NAME SEARCH FIRST FCALL 11  return with HL=FCB
              ;
C7F6 CDDDC9   SRCHFST:CALL CURDRVCK
C7F9 CD0CCD     CALL DIRSET
C7FC 2A62D0   SRCHFST3:LD HL,(DIRBFADRS)
C7FF 010004     LD BC,$0400
C802 C5       SRCHFST4:PUSH BC
C803 CD30C8     CALL NMCMP
C806 CA27C8     JP Z,SRCHFST8
C809 012000   SRCHFST42:LD BC,$0020
C80C 09         ADD HL,BC
C80D C1         POP BC
C80E 0C         INC C
C80F 05         DEC B
C810 C202C8     JP NZ,SRCHFST4
C813 210AD0   SRCHFST43:LD HL,FNPOS
C816 34         INC (HL)
C817 34         INC (HL)
C818 34         INC (HL)
C819 34         INC (HL)
C81A 3A27D0     LD A,(DIRMAX)
C81D BE         CP (HL)
C81E DA2DC8     JP C,SRCHFST9
C821 CD53CD     CALL NDIRSET
C824 C3FCC7     JP SRCHFST3
              ;
C827 C1       SRCHFST8:POP BC
C828 79         LD A,C
C829 320BD0     LD (FNPOSS),A
C82C C9         RET
C82D 3EFF     SRCHFST9:LD A,FF
C82F C9         RET
              ;
              ;NAME COMP return with HL=FCB
C830 7E       NMCMP:LD A,(HL)
C831 FEE5       CP E5
C833 C238C8     JP NZ,NMCMP02
C836 B7         OR A;reset zflag
C837 C9         RET
C838 D5       NMCMP02:PUSH DE
C839 E5         PUSH HL
C83A 13         INC DE
C83B 23         INC HL
C83C 0E08       LD C,08
C83E 1A       NMCMP1:LD A,(DE)
C83F FE3F       CP 3F;?
C841 CA4BC8     JP Z,NMCMP2
C844 BE         CP (HL)
C845 CA4BC8     JP Z,NMCMP2
C848 E1         POP HL
C849 D1         POP DE
C84A C9         RET
C84B 13       NMCMP2:INC DE
C84C 23         INC HL
C84D 0D         DEC C
C84E C23EC8     JP NZ,NMCMP1
C851 0E03       LD C,03
C853 1A       NMCMP3:LD A,(DE)
C854 E67F       AND 7F
C856 FE3F       CP 3F;?
C858 CA66C8     JP Z,NMCMP4
C85B 47         LD B,A
C85C 7E         LD A,(HL)
C85D E67F       AND 7F
C85F B8         CP B
C860 CA66C8     JP Z,NMCMP4
C863 E1         POP HL
C864 D1         POP DE
C865 C9         RET
C866 13       NMCMP4:INC DE
C867 23         INC HL
C868 0D         DEC C
C869 C253C8     JP NZ,NMCMP3
C86C E1         POP HL
C86D D1         POP DE
C86E C9         RET
              ;
              ;FILE NAME SEARCH NEXT FCALL 12
              ;
C86F 3A0BD0   SRCHNXT:LD A,(FNPOSS)
C872 FE03       CP 03
C874 CA13C8     JP Z,SRCHFST43
C877 4F         LD C,A
C878 3E04       LD A,04
C87A 91         SUB C
C87B 47         LD B,A
C87C 79         LD A,C
C87D 2A62D0     LD HL,(DIRBFADRS)
C880 B7         OR A
C881 CA8EC8     JP Z,SRCHNXT22
C884 D5         PUSH DE
C885 112000     LD DE,$0020
C888 19       SRCHNXT2:ADD HL,DE
C889 3D         DEC A
C88A C288C8     JP NZ,SRCHNXT2
C88D D1         POP DE
C88E C5       SRCHNXT22:PUSH BC
C88F C309C8     JP SRCHFST42
              ;
              ;FILE DELETE FCALL 13
              ;
C892 3A61D0   DELETE:LD A,(CURROMK)
C895 B7         OR A
C896 C0         RET NZ
C897 CDF6C7     CALL SRCHFST
C89A FEFF       CP FF
C89C C8         RET Z
C89D 36E5     DELETE2:LD (HL),E5
C89F D5         PUSH DE
C8A0 112000     LD DE,$0020
C8A3 19         ADD HL,DE
C8A4 0610       LD B,10;=16
C8A6 7E       DELETE3:LD A,(HL)
C8A7 B7         OR A
C8A8 CAB2C8     JP Z,DELETE4
C8AB C5         PUSH BC
C8AC 067F       LD B,7F
C8AE CDE2CC     CALL BLKTOALV
C8B1 C1         POP BC
C8B2 05       DELETE4:DEC B
C8B3 C2A6C8     JP NZ,DELETE3
C8B6 EB         EX DE,HL
C8B7 2A62D0     LD HL,(DIRBFADRS)
C8BA EB         EX DE,HL
C8BB CD2AD2     CALL B_WRITE
C8BE D1         POP DE
C8BF CD6FC8     CALL SRCHNXT
C8C2 FEFF       CP FF
C8C4 C29DC8     JP NZ,DELETE2
C8C7 AF         XOR A
C8C8 C9         RET
              ;
              ;SEQUENTIAL READ FCALL 14
              ;
C8C9 210F00   SEQRD:LD HL,$000F
C8CC 19         ADD HL,DE
C8CD 46         LD B,(HL);rec no. in this extent
C8CE E5         PUSH HL
C8CF 111100     LD DE,$0011
C8D2 19         ADD HL,DE
C8D3 7E         LD A,(HL);next rec no.
C8D4 B8         CP B
C8D5 CA08C9     JP Z,SEQRDEND; end or next extent!!
C8D8 34         INC (HL)
C8D9 E1         POP HL
C8DA 23         INC HL
C8DB CD0CC9     CALL SRCHBLK
C8DE F5       SEQRD1:PUSH AF;position
C8DF 4E         LD C,(HL)
C8E0 0600       LD B,00
C8E2 CD68CD     CALL BLKTOTS;B=TRK,C=SEC
C8E5 F1         POP AF
C8E6 81         ADD A,C
C8E7 4F         LD C,A
C8E8 2120D0     LD HL,SEC
C8EB BE         CP (HL)
C8EC DAF2C8     JP C,SEQRD2
C8EF 04         INC B
C8F0 96         SUB (HL)
C8F1 4F         LD C,A
C8F2 C5       SEQRD2:PUSH BC
C8F3 48         LD C,B
C8F4 CD1ED2     CALL B_SETTRK
C8F7 C1         POP BC
C8F8 CD21D2     CALL B_SETSEC
C8FB 2A06D0     LD HL,(DMABFADRS)
C8FE 44         LD B,H
C8FF 4D         LD C,L
C900 CD24D2     CALL B_SETDMA
C903 CD27D2     CALL B_READ
C906 AF         XOR A
C907 C9         RET
              ;
C908 E1       SEQRDEND:POP HL
C909 3E01       LD A,01;end of file
C90B C9         RET     
              ;
              ;rec no. to brock no. alloc & position
              ;
C90C F5       SRCHBLK:PUSH AF
C90D 3A23D0     LD A,(BLKMSK)
C910 3C         INC A
C911 4F         LD C,A
C912 F1         POP AF
C913 B9         CP C
C914 D8         RET C
C915 23         INC HL
C916 91         SUB C
C917 C30CC9     JP SRCHBLK
              ;
              ;SEQUENTIAL WRITE FCALL 15
              ;
C91A 3A61D0   SEQWR:LD A,(CURROMK)
C91D B7         OR A
C91E C0         RET NZ
C91F 210F00     LD HL,$000F
C922 19         ADD HL,DE
C923 7E         LD A,(HL);rec amount in this extent
C924 3C         INC A
C925 FE81       CP 81
C927 CA74C9     JP Z,SEQWR8;next extent
C92A 77         LD (HL),A
C92B E5         PUSH HL
C92C 111100     LD DE,$0011
C92F 19         ADD HL,DE
C930 7E         LD A,(HL)
C931 34         INC (HL);next rec no.
C932 E1         POP HL
C933 23         INC HL
C934 CD0CC9     CALL SRCHBLK
C937 F5       SEQWR1:PUSH AF;position
C938 7E         LD A,(HL)
C939 B7         OR A
C93A C24BC9     JP NZ,SEQWR2
C93D CD79C9     CALL SRCHNXTBLK;A=next block no.
C940 DA75C9     JP C,SEQWR9;DISK FULL
C943 77         LD (HL),A;next block no.
C944 C5         PUSH BC
C945 0680       LD B,80
C947 CDE2CC     CALL BLKTOALV
C94A C1         POP BC
C94B 4E       SEQWR2:LD C,(HL)
C94C 0600       LD B,00
C94E CD68CD     CALL BLKTOTS;B=TRK,C=SEC
C951 F1         POP AF
C952 81         ADD A,C
C953 4F         LD C,A
C954 2120D0     LD HL,SEC
C957 BE         CP (HL)
C958 DA5EC9     JP C,SEQWR3
C95B 04         INC B
C95C 96         SUB (HL)
C95D 4F         LD C,A
C95E C5       SEQWR3:PUSH BC
C95F 48         LD C,B
C960 CD1ED2     CALL B_SETTRK
C963 C1         POP BC
C964 CD21D2     CALL B_SETSEC
C967 2A06D0     LD HL,(DMABFADRS)
C96A 44         LD B,H
C96B 4D         LD C,L
C96C CD24D2     CALL B_SETDMA
C96F CD2AD2     CALL B_WRITE
C972 AF         XOR A
C973 C9         RET
              ;
              ;next extent make !!!
C974 C9       SEQWR8:RET
              ;
C975 F1       SEQWR9:POP AF
C976 3E02       LD A,02;DISK FULL
C978 C9         RET
              ;
              ;search next block return with A=next block no.
C979 E5       SRCHNXTBLK:PUSH HL
C97A D5         PUSH DE
C97B C5         PUSH BC
C97C 2A1ED0     LD HL,(ALVTOP)
C97F 3A25D0     LD A,(BLKMAX);<FF !
C982 3C         INC A
C983 47         LD B,A
C984 0E00       LD C,00
C986 1608     SRCHNXTBLK1:LD D,08
C988 7E         LD A,(HL)
C989 07       SRCHNXTBLK2:RLCA
C98A D29AC9     JP NC,SRCHNXTBLK3
C98D 05         DEC B
C98E CAA0C9     JP Z,SRCHNXTBLK9;disk full
C991 0C         INC C
C992 15         DEC D
C993 C289C9     JP NZ,SRCHNXTBLK2
C996 23         INC HL
C997 C386C9     JP SRCHNXTBLK1
C99A 79       SRCHNXTBLK3:LD A,C
C99B C1         POP BC
C99C D1         POP DE
C99D E1         POP HL
C99E B7         OR A;reset Cflag
C99F C9         RET
C9A0 C1       SRCHNXTBLK9:POP BC
C9A1 D1         POP DE
C9A2 E1         POP HL
C9A3 37         SCF;disk full
C9A4 C9         RET
                ;
              ;NEW FILE OPEN FCALL 16
              ;
C9A5 CDDDC9   NEWOPEN:CALL CURDRVCK
C9A8 CD0CCD     CALL DIRSET
C9AB CDECC9     CALL SRCHE5
C9AE FEFF       CP FF
C9B0 C8         RET Z;directory full
C9B1 F5         PUSH AF
C9B2 3A61D0     LD A,(CURROMK)
C9B5 B7         OR A
C9B6 CABBC9     JP Z,NEWOPEN1
C9B9 C1         POP BC;dummy
C9BA C9         RET
C9BB E5       NEWOPEN1:PUSH HL
C9BC 211000     LD HL,$0010
C9BF 19         ADD HL,DE
C9C0 AF         XOR A
C9C1 0610       LD B,10
C9C3 77       NEWOPEN2:LD (HL),A
C9C4 23         INC HL
C9C5 05         DEC B
C9C6 C2C3C9     JP NZ,NEWOPEN2
C9C9 E1         POP HL
C9CA 0620       LD B,20
C9CC 1A       NEWOPEN3:LD A,(DE)
C9CD 77         LD (HL),A
C9CE 23         INC HL
C9CF 13         INC DE
C9D0 05         DEC B
C9D1 C2CCC9     JP NZ,NEWOPEN3
C9D4 2A62D0     LD HL,(DIRBFADRS)
C9D7 EB         EX DE,HL
C9D8 CD2AD2     CALL B_WRITE
C9DB F1         POP AF
C9DC C9         RET
              ;
C9DD 1A       CURDRVCK:LD A,(DE)
C9DE B7         OR A
C9DF C8         RET Z
C9E0 3D         DEC A
C9E1 2104D0     LD HL,CURDRV
C9E4 BE         CP (HL)
C9E5 C8         RET Z
C9E6 D5         PUSH DE
C9E7 CD31C7     CALL DRVNOSET1
C9EA D1         POP DE
C9EB C9         RET
              ;
              ;dir search 'E5'
C9EC D5       SRCHE5:PUSH DE
C9ED 2A62D0   SRCHE5_2:LD HL,(DIRBFADRS)
C9F0 110004     LD DE,$0400
C9F3 7E       SRCHE5_3:LD A,(HL)
C9F4 FEE5       CP E5
C9F6 CA16CA     JP Z,SRCHE5_8
C9F9 012000     LD BC,$0020
C9FC 09         ADD HL,BC
C9FD 1C         INC E
C9FE 15         DEC D
C9FF C2F3C9     JP NZ,SRCHE5_3
CA02 210AD0     LD HL,FNPOS
CA05 34         INC (HL)
CA06 34         INC (HL)
CA07 34         INC (HL)
CA08 34         INC (HL)
CA09 3A27D0     LD A,(DIRMAX)
CA0C BE         CP (HL)
CA0D DA19CA     JP C,SRCHE5_9
CA10 CD53CD     CALL NDIRSET
CA13 C3EDC9     JP SRCHE5_2
              ;
CA16 7B       SRCHE5_8:LD A,E
CA17 D1         POP DE
CA18 C9         RET
CA19 D1       SRCHE5_9:POP DE
CA1A 3EFF       LD A,FF
CA1C C9         RET
              ;
              ;RENAME FCALL 17
              ;
CA1D 3A61D0   RENAME:LD A,(CURROMK)
CA20 B7         OR A
CA21 C0         RET NZ
CA22 CDF6C7     CALL SRCHFST
CA25 FEFF       CP FF
CA27 C8         RET Z
CA28 23       RENAME2:INC HL
CA29 D5         PUSH DE
CA2A EB         EX DE,HL
CA2B 011100     LD BC,$0011
CA2E 09         ADD HL,BC
CA2F 060B       LD B,0B;=11
CA31 7E       RENAME3:LD A,(HL)
CA32 12         LD (DE),A
CA33 23         INC HL
CA34 13         INC DE
CA35 05         DEC B
CA36 C231CA     JP NZ,RENAME3
CA39 CD2AD2     CALL B_WRITE
CA3C D1         POP DE
CA3D CD6FC8     CALL SRCHNXT
CA40 FEFF       CP FF
CA42 C228CA     JP NZ,RENAME2
CA45 AF         XOR A
CA46 C9         RET
              ;
              ;CURRENT DRIVE VECTOR(LOGIN VECTOR) ADDRESS READ FCALL 18
              ;
CA47 2A00D0   CURDRVVCTRD:LD HL,(CURDRVVCT)
CA4A C9         RET
              ;
              ;CURRENT DRIVE NO. READ FCALL 19
              ;
CA4B 3A04D0   CURDRVNORD:LD A,(CURDRV)
CA4E C9         RET
              ;
              ;DMA ADRRESS SET FCALL 1A
              ;
CA4F 62       DMAADRSSET:LD H,D
CA50 6B         LD L,E
CA51 2206D0     LD (DMABFADRS),HL
CA54 C9         RET
              ;
              ;ALLOCATION VECTOR ADDRESS READ FCALL 1B
              ;
CA55 2A1ED0   ALVADRSRD:LD HL,(ALVTOP)
CA58 C9         RET
              ;
              ;WRITE PROTECT SET FCALL 1C
              ;
CA59 2A02D0   WPSET:LD HL,(ROVCT)
CA5C EB         EX DE,HL
CA5D 3A04D0     LD A,(CURDRV)
CA60 3C         INC A
CA61 210100     LD HL,$0001
CA64 3D       WPSET1:DEC A
CA65 CA6CCA     JP Z,WPSET2
CA68 29         ADD HL,HL
CA69 C364CA     JP WPSET1
CA6C 7C       WPSET2:LD A,H
CA6D B2         OR D
CA6E 67         LD H,A
CA6F 7D         LD A,L
CA70 B3         OR E
CA71 6F         LD L,A
CA72 2202D0     LD (ROVCT),HL
CA75 C9         RET
              ;
              ;READ ONLY VECTOR ADDRESS READ FCALL 1D
              ;
CA76 2A02D0   ROVRD:LD HL,(ROVCT)
CA79 C9         RET
              ;
              ;FILE ATTRIBUTE SET FCALL 1E
              ;
CA7A CDF6C7   ATTRSET:CALL SRCHFST
CA7D FEFF       CP FF
CA7F C8         RET Z
CA80 E5         PUSH HL
CA81 010C00     LD BC,$000C
CA84 09         ADD HL,BC
CA85 7E         LD A,(HL);extent No.
CA86 E1         POP HL
CA87 B7         OR A
CA88 CA9FCA     JP Z,ATTRSET2
CA8B CD6FC8     CALL SRCHNXT
CA8E FEFF       CP FF
CA90 C8         RET Z
CA91 E5         PUSH HL
CA92 010C00     LD BC,$000C
CA95 09         ADD HL,BC
CA96 7E         LD A,(HL);extent No.
CA97 E1         POP HL
CA98 B7         OR A
CA99 CA9FCA     JP Z,ATTRSET2
CA9C 3EFF       LD A,FF
CA9E C9         RET
CA9F 010900   ATTRSET2:LD BC,$0009
CAA2 09         ADD HL,BC
CAA3 EB         EX DE,HL
CAA4 09         ADD HL,BC
CAA5 0603       LD B,03
CAA7 7E       ATTRSET3:LD A,(HL)
CAA8 12         LD (DE),A
CAA9 23         INC HL
CAAA 13         INC DE
CAAB 05         DEC B
CAAC C2A7CA     JP NZ,ATTRSET3
CAAF CD2AD2     CALL B_WRITE
CAB2 3A0BD0     LD A,(FNPOSS)
CAB5 C9         RET
              ;
              ;DISK PARAMETER ADDRESS READ FCALL 1F
              ;
CAB6 2A1AD0   DPARAMRD:LD HL,(DPTOP)
CAB9 C9         RET
              ;
              ;UNDEFINE FCALL 20,26,27
              ;
CABA C9       UNDEFINE:RET
              ;
              ;RANDOM READ FCALL 21
              ;
CABB AF       RNDMRD:XOR A
CABC 3269D0     LD (RWSW),A
CABF CDC8CA     CALL RNDMSB
CAC2 D2DEC8     JP NC,SEQRD1
CAC5 3EFF       LD A,FF;********** err CODE
CAC7 C9         RET
              ;
              ;rec no. to BLOCK aloc position
              ;return value B=this extent no. C=rec no. in this extent
              ;HL=BLOCK ALOC POINT
              ;if err then cf on
CAC8 212100   RNDMSB:LD HL,$0021
CACB 19         ADD HL,DE
CACC 7E         LD A,(HL)
CACD 23         INC HL
CACE 66         LD H,(HL)
CACF 6F         LD L,A;HL=next rec no.
CAD0 0607       LD B,07;
CAD2 7C       RNDMSB2:LD A,H
CAD3 1F         RRA
CAD4 67         LD H,A
CAD5 7D         LD A,L
CAD6 1F         RRA
CAD7 6F         LD L,A
CAD8 05         DEC B
CAD9 C2D2CA     JP NZ,RNDMSB2
CADC 7C         LD A,H
CADD 1F         RRA
CADE 1F         RRA
CADF 4F         LD C,A;rec no. in extent
CAE0 45         LD B,L;extent no.
CAE1 210C00   RNDMSB3:LD HL,$000C
CAE4 19         ADD HL,DE
CAE5 78         LD A,B
CAE6 BE         CP (HL)
CAE7 C217CB     JP NZ,RNDMSB5;read next extent
CAEA 23       RNDMSB30:INC HL
CAEB 23         INC HL
CAEC 23         INC HL
CAED 3A69D0     LD A,(RWSW)
CAF0 B7         OR A
CAF1 CAFBCA     JP Z,RNDMSB31
CAF4 79         LD A,C
CAF5 3C         INC A
CAF6 BE         CP (HL);amount in this extent
CAF7 DAFBCA     JP C,RNDMSB31
CAFA 77         LD (HL),A
CAFB 23       RNDMSB31:INC HL
CAFC EB         EX DE,HL
CAFD 2A22D0     LD HL,(BLKSFT)
CB00 EB         EX DE,HL;E=BLKSFT,D=BLKMSK
CB01 79         LD A,C
CB02 A2         AND D
CB03 57         LD D,A
CB04 79         LD A,C
CB05 0F       RNDMSB32:RRCA
CB06 1D         DEC E
CB07 C205CB     JP NZ,RNDMSB32
CB0A E61F       AND 1F
CB0C CA14CB     JP Z,RNDMSB42
CB0F 23       RNDMSB4:INC HL
CB10 3D         DEC A
CB11 C20FCB     JP NZ,RNDMSB4
CB14 7A       RNDMSB42:LD A,D;position no. in block
CB15 B7         OR A;reset cf
CB16 C9         RET
              ;
CB17 C5       RNDMSB5:PUSH BC
CB18 F5         PUSH AF
CB19 3A69D0     LD A,(RWSW)
CB1C B7         OR A
CB1D C4C1C7     CALL NZ,CLOSE;save this FCB
CB20 CDF6C7     CALL SRCHFST
CB23 F1       RNDMSB52:POP AF
CB24 E5         PUSH HL
CB25 010C00     LD BC,$000C
CB28 09         ADD HL,BC
CB29 BE         CP (HL);same extent No.?
CB2A CA3ACB     JP Z,RNDMSB6;FCB found
CB2D E1         POP HL
CB2E F5         PUSH AF
CB2F CD6FC8     CALL SRCHNXT
CB32 FEFF       CP FF
CB34 CA50CB     JP Z,RNDMSB7;then,make new FCB
CB37 C323CB     JP RNDMSB52
              ;
CB3A E1       RNDMSB6:POP HL
CB3B D5         PUSH DE
CB3C 0620       LD B,20
CB3E 7E       RNDMSB62:LD A,(HL)
CB3F 12         LD (DE),A
CB40 23         INC HL
CB41 13         INC DE
CB42 05         DEC B
CB43 C23ECB     JP NZ,RNDMSB62
CB46 D1         POP DE
CB47 210C00     LD HL,$000C
CB4A 19         ADD HL,DE
CB4B C1         POP BC
CB4C 70         LD (HL),B;extent No.
CB4D C3EACA     JP RNDMSB30
              ;
CB50 F1       RNDMSB7:POP AF
CB51 3A69D0     LD A,(RWSW)
CB54 B7         OR A
CB55 C25BCB     JP NZ,RNDMSB71
CB58 C1         POP BC
CB59 37         SCF
CB5A C9         RET
CB5B C1       RNDMSB71:POP BC
CB5C 210C00     LD HL,$000C
CB5F 19         ADD HL,DE
CB60 70         LD (HL),B;extent No.
CB61 E5         PUSH HL
CB62 23         INC HL
CB63 0613       LD B,13
CB65 AF         XOR A
CB66 77       RNDMSB72:LD (HL),A
CB67 23         INC HL
CB68 05         DEC B
CB69 C266CB     JP NZ,RNDMSB72
CB6C C5         PUSH BC
CB6D CD0CCD     CALL DIRSET
CB70 CDECC9     CALL SRCHE5
CB73 FEFF       CP FF
CB75 C27CCB     JP NZ,RNDMSB73
CB78 C1         POP BC
CB79 E1         POP HL
CB7A 37         SCF
CB7B C9         RET
CB7C D5       RNDMSB73:PUSH DE
CB7D 0620       LD B,20
CB7F 1A       RNDMSB74:LD A,(DE)
CB80 77         LD (HL),A
CB81 23         INC HL
CB82 13         INC DE
CB83 05         DEC B
CB84 C27FCB     JP NZ,RNDMSB74
CB87 2A62D0     LD HL,(DIRBFADRS)
CB8A EB         EX DE,HL
CB8B CD2AD2     CALL B_WRITE
CB8E D1         POP DE
CB8F C1         POP BC
CB90 E1         POP HL
CB91 C3EACA     JP RNDMSB30
              ;
              ;RANDOM WRITE FCALL 22
              ;
CB94 3A61D0   RNDMWR:LD A,(CURROMK)
CB97 B7         OR A
CB98 C0         RET NZ
CB99 3E01       LD A,01
CB9B 3269D0     LD (RWSW),A
CB9E CDC8CA     CALL RNDMSB
CBA1 D237C9     JP NC,SEQWR1
CBA4 3EFF       LD A,FF;******* err CODE
CBA6 C9         RET
              ;
              ;FILE SIZE READ FCALL 23
              ;
CBA7 0600     FSIZERD:LD B,00
CBA9 C5         PUSH BC;B=max extent No.
CBAA CDF6C7     CALL SRCHFST
CBAD FEFF       CP FF
CBAF CAE3CB     JP Z,FSIZERDERR
CBB2 010C00   FSIZERD1:LD BC,$000C
CBB5 09         ADD HL,BC
CBB6 7E         LD A,(HL);extent No.
CBB7 C1         POP BC;max extent No.
CBB8 B8         CP B
CBB9 DAC1CB     JP C,FSIZERD2
CBBC 47         LD B,A
CBBD 23         INC HL
CBBE 23         INC HL
CBBF 23         INC HL
CBC0 4E         LD C,(HL);sectors in this extent
CBC1 C5       FSIZERD2:PUSH BC
CBC2 CD6FC8     CALL SRCHNXT
CBC5 FEFF       CP FF
CBC7 C2B2CB     JP NZ,FSIZERD1
CBCA C1         POP BC
CBCB 68         LD L,B
CBCC 2600       LD H,00
CBCE 0607       LD B,07
CBD0 29       FSIZERD3:ADD HL,HL
CBD1 05         DEC B
CBD2 C2D0CB     JP NZ,FSIZERD3;*128
CBD5 09         ADD HL,BC
CBD6 EB         EX DE,HL
CBD7 012100     LD BC,$0021
CBDA 09         ADD HL,BC
CBDB 73         LD (HL),E
CBDC 23         INC HL
CBDD 72         LD (HL),D
CBDE 23         INC HL
CBDF 3600       LD (HL),00;**************
CBE1 AF         XOR A
CBE2 C9         RET
CBE3 C1       FSIZERDERR:POP BC
CBE4 3EFF       LD A,FF
CBE6 C9         RET
              ;
              ;RANDOM ACCESS RECOAD NO. SET FCALL 24
              ;
CBE7 210C00   RNDMNOSET:LD HL,$000C
CBEA 19         ADD HL,DE
CBEB 4E         LD C,(HL);extent
CBEC 212000     LD HL,$0020
CBEF 19         ADD HL,DE
CBF0 6E         LD L,(HL);next rec no.
CBF1 3A22D0     LD A,(BLKSFT)
CBF4 0600       LD B,00
CBF6 67         LD H,A
CBF7 B7         OR A;reset CF
CBF8 CD18CC   RNDMNOSET2:CALL RLBC
CBFB 25         DEC H
CBFC C2F8CB     JP NZ,RNDMNOSET2
CBFF 2604       LD H,04
CC01 CD18CC   RNDMNOSET3:CALL RLBC
CC04 25         DEC H
CC05 C201CC     JP NZ,RNDMNOSET3
CC08 2600       LD H,00
CC0A 09         ADD HL,BC
CC0B 44         LD B,H
CC0C 4D         LD C,L
CC0D 212100     LD HL,$0021
CC10 19         ADD HL,DE
CC11 71         LD (HL),C
CC12 23         INC HL
CC13 70         LD (HL),B
CC14 23         INC HL
CC15 3600       LD (HL),00
CC17 C9         RET
              ;
CC18 79       RLBC:LD A,C
CC19 17         RLA
CC1A 4F         LD C,A
CC1B 78         LD A,B
CC1C 17         RLA
CC1D 47         LD B,A
CC1E C9         RET
              ;
              ;WITH DISK DRIVE VECTOR RESET FCALLO 25
              ;
CC1F 7A       DRVVCTRES:LD A,D
CC20 42         LD B,D
CC21 4B         LD C,E
CC22 2A00D0     LD HL,(CURDRVVCT)
CC25 EB         EX DE,HL
CC26 2A02D0     LD HL,(ROVCT)
CC29 2F         CPL
CC2A 47         LD B,A
CC2B A4         AND H
CC2C 67         LD H,A
CC2D 78         LD A,B
CC2E A2         AND D
CC2F 57         LD D,A
CC30 79         LD A,C
CC31 2F         CPL
CC32 4F         LD C,A
CC33 A5         AND L
CC34 6F         LD L,A
CC35 79         LD A,C
CC36 A3         AND E
CC37 5F         LD E,A
CC38 2202D0     LD (ROVCT),HL
CC3B EB         EX DE,HL
CC3C 2200D0     LD (CURDRVVCT),HL
CC3F C9         RET
              ;
              ;RANDOM WRITE WITH 00 FCALL 28
              ;
CC40 3A61D0   RNDMWR0:LD A,(CURROMK)
CC43 B7         OR A
CC44 C0         RET NZ
CC45 CDC8CA     CALL RNDMSB
CC48 E5         PUSH HL
CC49 CD37C9     CALL SEQWR1
CC4C E1         POP HL
CC4D FEFF       CP FF
CC4F C8         RET Z
CC50 3A23D0     LD A,(BLKMSK)
CC53 E5       RNDMWR03:PUSH HL
CC54 F5         PUSH AF
CC55 CDDEC8     CALL SEQRD1
CC58 FEFF       CP FF
CC5A CA8DCC     JP Z,RNDMWR09
CC5D 2A06D0     LD HL,(DMABFADRS)
CC60 0680       LD B,80
CC62 3EE5       LD A,E5
CC64 BE       RNDMWR04:CP (HL)
CC65 C285CC     JP NZ,RNDMWR06
CC68 23         INC HL
CC69 05         DEC B
CC6A C264CC     JP NZ,RNDMWR04
CC6D 0680       LD B,80
CC6F 2A06D0     LD HL,(DMABFADRS)
CC72 AF         XOR A
CC73 77       RNDMWR05:LD (HL),A
CC74 23         INC HL
CC75 05         DEC B
CC76 C273CC     JP NZ,RNDMWR05
CC79 F1         POP AF
CC7A E1         POP HL
CC7B E5         PUSH HL
CC7C F5         PUSH AF
CC7D CD37C9     CALL SEQWR1
CC80 FEFF       CP FF
CC82 CA8DCC     JP Z,RNDMWR09
CC85 F1       RNDMWR06:POP AF
CC86 E1         POP HL
CC87 3D         DEC A
CC88 F253CC     JP P,RNDMWR03
CC8B AF         XOR A
CC8C C9         RET
              ;
CC8D F1       RNDMWR09:POP AF
CC8E E1         POP HL
CC8F 3EFF       LD A,FF
CC91 C9         RET
              ;
CC92 2A25D0   ALVSET:LD HL,(BLKMAX);clr ALV
CC95 44         LD B,H
CC96 7D         LD A,L
CC97 2A29D0     LD HL,(DIRALC)
CC9A 54         LD D,H
CC9B 5D         LD E,L
CC9C 2A1ED0     LD HL,(ALVTOP)
CC9F 73         LD (HL),E
CCA0 23         INC HL
CCA1 72         LD (HL),D
              ;
CCA2 CD0CCD     CALL DIRSET
CCA5 0E00       LD C,00
CCA7 2A62D0   ALVSET1:LD HL,(DIRBFADRS)
CCAA 0604       LD B,04
CCAC 7E       ALVSET11:LD A,(HL)
CCAD FEE5       CP E5
CCAF CACCCC     JP Z,ALVSET2
CCB2 111000     LD DE,$0010
CCB5 19         ADD HL,DE
CCB6 1610       LD D,10
CCB8 7E       ALVSET12:LD A,(HL)
CCB9 B7         OR A
CCBA CAC4CC     JP Z,ALVSET13
CCBD C5         PUSH BC
CCBE 0680       LD B,80
CCC0 CDE2CC     CALL BLKTOALV
CCC3 C1         POP BC
CCC4 23       ALVSET13:INC HL
CCC5 15         DEC D
CCC6 C2B8CC     JP NZ,ALVSET12
CCC9 C3D0CC     JP ALVSET21
CCCC 112000   ALVSET2:LD DE,$0020
CCCF 19         ADD HL,DE
CCD0 0C       ALVSET21:INC C
CCD1 05         DEC B
CCD2 C2ACCC     JP NZ,ALVSET11
CCD5 3A27D0     LD A,(DIRMAX)
CCD8 B9         CP C
CCD9 D8         RET C
CCDA C5         PUSH BC
CCDB CD53CD     CALL NDIRSET
CCDE C1         POP BC
CCDF C3A7CC     JP ALVSET1
              ;
              ;A=BLOCK NO. B=80(SET) B=7F(CLR)
CCE2 E5       BLKTOALV:PUSH HL
CCE3 2A1ED0     LD HL,(ALVTOP)
CCE6 FE08     BLKTOALV1:CP 08
CCE8 DAF1CC     JP C,BLKTOALV2
CCEB 23         INC HL
CCEC D608       SUB 08
CCEE C3E6CC     JP BLKTOALV1
CCF1 4F       BLKTOALV2:LD C,A
CCF2 0C         INC C
CCF3 78         LD A,B
CCF4 0D       BLKTOALV3:DEC C
CCF5 CAFCCC     JP Z,BLKTOALV4
CCF8 0F         RRCA
CCF9 C3F4CC     JP BLKTOALV3
CCFC 4F       BLKTOALV4:LD C,A
CCFD 78         LD A,B
CCFE FE80       CP 80
CD00 7E         LD A,(HL)
CD01 CA08CD     JP Z,BLKTOALV5
CD04 A1         AND C
CD05 C309CD     JP BLKTOALV6
CD08 B1       BLKTOALV5:OR C
CD09 77       BLKTOALV6:LD (HL),A
CD0A E1         POP HL
CD0B C9         RET
              ;
              ;DIR TRACK&SECTOR SET & READ
CD0C D5       DIRSET:PUSH DE
CD0D 2129D0     LD HL,DIRALC
CD10 7E         LD A,(HL)
CD11 0608       LD B,08
CD13 0E00       LD C,00
CD15 07       DIRSET1:RLCA
CD16 DA2BCD     JP C,DIRSETE
CD19 0C         INC C
CD1A 05         DEC B
CD1B C215CD     JP NZ,DIRSET1
CD1E 23         INC HL
CD1F 7E         LD A,(HL)
CD20 0608       LD B,08
CD22 07       DIRSET2:RLCA
CD23 DA2BCD     JP C,DIRSETE
CD26 0C         INC C
CD27 05         DEC B
CD28 C222CD     JP NZ,DIRSET2
              ;
CD2B AF       DIRSETE:XOR A
CD2C 320AD0     LD (FNPOS),A
CD2F 0600       LD B,00
CD31 CD68CD     CALL BLKTOTS
CD34 2108D0   DIRSETE2:LD HL,DIRTRK
CD37 70         LD (HL),B
CD38 23         INC HL
CD39 71         LD (HL),C
CD3A C5         PUSH BC
CD3B 48         LD C,B
CD3C CD1ED2     CALL B_SETTRK
CD3F C1         POP BC
CD40 CD21D2     CALL B_SETSEC
CD43 2A62D0     LD HL,(DIRBFADRS)
CD46 44         LD B,H
CD47 4D         LD C,L
CD48 CD24D2     CALL B_SETDMA
CD4B CD27D2     CALL B_READ
CD4E 320BD0     LD (FNPOSS),A
CD51 D1         POP DE
CD52 C9         RET
              ;
              ;NEXT DIR TRACK&SECTOR SET & READ
CD53 D5       NDIRSET:PUSH DE
CD54 2108D0     LD HL,DIRTRK
CD57 46         LD B,(HL)
CD58 23         INC HL
CD59 4E         LD C,(HL)
CD5A 0C         INC C
CD5B 3A20D0     LD A,(SEC)
CD5E B9         CP C
CD5F C234CD     JP NZ,DIRSETE2
CD62 0E00       LD C,00
CD64 04         INC B
CD65 C334CD     JP DIRSETE2
              ;
              ;FROM BLOCK NO. TO TRACK,SECTOR
              ;BC=BLKNo. > B=TRK C=SEC
CD68 3A22D0   BLKTOTS:LD A,(BLKSFT);BROCK TO SECTOR
CD6B 5F         LD E,A
CD6C 79       BLKTOTS1:LD A,C
CD6D B7         OR A
CD6E 17         RLA
CD6F 4F         LD C,A
CD70 78         LD A,B
CD71 17         RLA
CD72 47         LD B,A
CD73 1D         DEC E
CD74 C26CCD     JP NZ,BLKTOTS1
              ;TRACK=BC/SEC SEC must be 2^n
CD77 3A20D0     LD A,(SEC)
CD7A 57         LD D,A
CD7B 79         LD A,C
CD7C 15         DEC D
CD7D A2         AND D
CD7E F5         PUSH AF;SECTOR
CD7F 14         INC D
CD80 7A       BLKTOTS2:LD A,D
CD81 1F         RRA
CD82 57         LD D,A
CD83 DA8FCD     JP C,BLKTOTS3
CD86 78         LD A,B
CD87 1F         RRA
CD88 47         LD B,A
CD89 79         LD A,C
CD8A 1F         RRA
CD8B 4F         LD C,A
CD8C C380CD     JP BLKTOTS2
CD8F 41       BLKTOTS3:LD B,C
CD90 F1         POP AF
CD91 4F         LD C,A;SECTOR
CD92 C9         RET
              ;A
ALVADRSRD    =CA55  ALVSET       =CC92  ALVSET1      =CCA7  
ALVSET11     =CCAC  ALVSET12     =CCB8  ALVSET13     =CCC4  
ALVSET2      =CCCC  ALVSET21     =CCD0  ALVTOP       =D01E  
ATTRSET      =CA7A  ATTRSET2     =CA9F  ATTRSET3     =CAA7  
BDOS         =C47E  BLKMAX       =D025  BLKMSK       =D023  
BLKSFT       =D022  BLKTOALV     =CCE2  BLKTOALV1    =CCE6  
BLKTOALV2    =CCF1  BLKTOALV3    =CCF4  BLKTOALV4    =CCFC  
BLKTOALV5    =CD08  BLKTOALV6    =CD09  BLKTOTS      =CD68  
BLKTOTS1     =CD6C  BLKTOTS2     =CD80  BLKTOTS3     =CD8F  
BSOUT        =C64F  BSOUT2       =C657  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  
CDRV_DIRWK   =D005  CLOSE        =C7C1  CLOSE1       =C7C7  
CLOSE2       =C7DF  CLOSE3       =C7E3  CONBFIN      =C58C  
CONBFIN1     =C595  CONBFIN2     =C59F  CONBFIN22    =C5B0  
CONBFIN23    =C5D8  CONBFIN24    =C5DD  CONBFIN3     =C5FC  
CONBFIN4     =C5E3  CONBFIN41    =C5ED  CONBFIN42    =C5F5  
CONBFIN43    =C5F9  CONBFIN5     =C61E  CONBFIN52    =C631  
CONBFIN53    =C634  CONBFIN54    =C639  CONBFIN55    =C643  
CONBFIN6     =C65C  CONBFIN61    =C670  CONBFIN62    =C677  
CONBFIN63    =C67A  CONBFIN64    =C68A  CONBFIN65    =C68E  
CONBFIN66    =C697  CONBFIN7     =C6B1  CONBFIN71    =C6C2  
CONBFIN72    =C6CB  CONBFIN8     =C6D0  CONBFIN82    =C6DA  
CONBFIN9     =C6E6  CONBFINWK    =D066  CONCHK       =C6FC  
CONCHK1      =C70D  CONCHK2      =C720  CONCHK3      =C721  
CONIN        =C4DE  CONINBF      =D0FE  CONINBF31    =C60A  
CONINOT      =C565  CONINSB      =C4EA  CONIO_IN     =C56E  
CONOUT       =C4F7  CONOUT12     =C516  CONOUT2      =C524  
CONOUT3      =C532  CONOUT4      =C54E  CONOUT42     =C552  
CONOUT43     =C554  CONOUT44     =C557  CRLF         =C6A7  
CSVTOP       =D01C  CTRLDSP      =C6EC  CURDRV       =D004  
CURDRVCK     =C9DD  CURDRVNORD   =CA4B  CURDRVVCT    =D000  
CURDRVVCTRD  =CA47  CURROMK      =D061  CURSOR       =D064  
CURSORWK     =D068  DELETE       =C892  DELETE2      =C89D  
DELETE3      =C8A6  DELETE4      =C8B2  DEOUT        =C57E  
DEOUT2       =C580  DIRADRS      =D018  DIRALC       =D029  
DIRBFADRS    =D062  DIRCNTR      =D00E  DIRMAX       =D027  
DIRSCT       =D009  DIRSET       =CD0C  DIRSET1      =CD15  
DIRSET2      =CD22  DIRSETE      =CD2B  DIRSETE2     =CD34  
DIRTRK       =D008  DISKRES      =C729  DMAADRSSET   =CA4F  
DMABFADRS    =D006  DPARAM       =D010  DPARAMRD     =CAB6  
DPTOP        =D01A  DRVCHR       =D00F  DRVNOSET     =C730  
DRVNOSET1    =C731  DRVNOSET2    =C74F  DRVNOSET3    =C757  
DRVNOSETE    =C77D  DRVVCTRES    =CC1F  FNCTBL       =C48B  
FNPOS        =D00A  FNPOSS       =D00B  FSIZERD      =CBA7  
FSIZERD1     =CBB2  FSIZERD2     =CBC1  FSIZERD3     =CBD0  
FSIZERDERR   =CBE3  INDATA       =D060  IOBYTE       =8003  
IOBYTERD     =C575  IOBYTESET    =C579  LSTOUT       =C564  
NDIRSET      =CD53  NEWOPEN      =C9A5  NEWOPEN1     =C9BB  
NEWOPEN2     =C9C3  NEWOPEN3     =C9CC  NMCMP        =C830  
NMCMP02      =C838  NMCMP1       =C83E  NMCMP2       =C84B  
NMCMP3       =C853  NMCMP4       =C866  OPEN         =C788  
OPEN2        =C7AD  OPEN3        =C7B2  PRMCOPY      =C77F  
PUNOUT       =C560  RDRIN        =C55D  RENAME       =CA1D  
RENAME2      =CA28  RENAME3      =CA31  RLBC         =CC18  
RNDMNOSET    =CBE7  RNDMNOSET2   =CBF8  RNDMNOSET3   =CC01  
RNDMRD       =CABB  RNDMSB       =CAC8  RNDMSB2      =CAD2  
RNDMSB3      =CAE1  RNDMSB30     =CAEA  RNDMSB31     =CAFB  
RNDMSB32     =CB05  RNDMSB4      =CB0F  RNDMSB42     =CB14  
RNDMSB5      =CB17  RNDMSB52     =CB23  RNDMSB6      =CB3A  
RNDMSB62     =CB3E  RNDMSB7      =CB50  RNDMSB71     =CB5B  
RNDMSB72     =CB66  RNDMSB73     =CB7C  RNDMSB74     =CB7F  
RNDMWR       =CB94  RNDMWR0      =CC40  RNDMWR03     =CC53  
RNDMWR04     =CC64  RNDMWR05     =CC73  RNDMWR06     =CC85  
RNDMWR09     =CC8D  ROVCT        =D002  ROVRD        =CA76  
RWSW         =D069  SAVECNTR     =D00C  SEC          =D020  
SECTRN       =D230  SEQRD        =C8C9  SEQRD1       =C8DE  
SEQRD2       =C8F2  SEQRDEND     =C908  SEQWR        =C91A  
SEQWR1       =C937  SEQWR2       =C94B  SEQWR3       =C95E  
SEQWR8       =C974  SEQWR9       =C975  SRCHBLK      =C90C  
SRCHE5       =C9EC  SRCHE5_2     =C9ED  SRCHE5_3     =C9F3  
SRCHE5_8     =CA16  SRCHE5_9     =CA19  SRCHFST      =C7F6  
SRCHFST3     =C7FC  SRCHFST4     =C802  SRCHFST42    =C809  
SRCHFST43    =C813  SRCHFST8     =C827  SRCHFST9     =C82D  
SRCHNXT      =C86F  SRCHNXT2     =C888  SRCHNXT22    =C88E  
SRCHNXTBLK   =C979  SRCHNXTBLK1  =C986  SRCHNXTBLK2  =C989  
SRCHNXTBLK3  =C99A  SRCHNXTBLK9  =C9A0  SYSFCB       =D03C  
SYSFCBALC    =D04C  SYSFCBCR     =D05C  SYSFCBEX     =D048  
SYSFCBRC     =D04B  SYSRES       =C4DD  TABOUT       =C538  
TABOUT1      =C540  UNDEFINE     =CABA  VERRD        =C725  
WPSET        =CA59  WPSET1       =CA64  WPSET2       =CA6C  
ZREENT       =D236  


[第154回]へ戻る


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