Educational program - FULL DESCRIPTION + FULL ROM DISASSEMBLER TR-DOS 5.04 (5.03)

City #49
 @@@ @@@@
 @ @ @
           @@@
           @ @ @ @ @ @@ @@@@ @@@ @@@
           @ @ @ @ @@@ @ @ @ @ @ @ @
           @ @ @ @ @ @ @ @@ @@@@ @ @
        @ @ @ @ @ @@ @ @ @ @ @ @ @@
         @@ @@ @@@ @@ @ @@ @@@@ @@@@ @
                                                  @@@@
                                                 @@
(c) P. Fedin  @@@@

 FULL DESCRIPTION + FULL ROM DISASSEMBLER TR-DOS 5.04 (5.03)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 FOR PROFESSIONALS, AND ALSO FOR THOSE WHO WANT TO BECOME THEM
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 continued

Address 7726.Deleting a memory area. In HL place the beginning of the circle
lasty, in DE - length.
7726 RST 32
      DEFW #19E8
      RET
──────────────────────────────── ────────────────────────────────
Address 7734. Loading the track register. Set to 23761. When you select
by mistake, 255 is placed in 23831. Can be used with an address
ES 7738 for direct output to port 63.
7734 CALL 16050;determining the number of the track on which the head is located
      LD A,H ;set track register
7738 OUT (63),A
      RET ;return
───────────────────────── ─────────────────── ────────────────────
Address 7741. Loading sectors. Login: in HL - download address,
in D - track number, in E - sector number, in B - number of sectors.
7741 XOR A ;load sign
      JR 7780;jump to sector load/write subroutine
───────────────────────── ─────────────────── ────────────────────
Address 7744.Record information about the file. The input to C should be
file number. Also used from addresses:
7747 - writing a sector from the buffer. Login: set the number to 23796
sector+1, and in 23797 - the track number.
7757 - record sectors. In HL - address, in D - track number, in E -
numbersectors, in B - number of sectors.
7780 - loading/writing sectors. Presets
as for the previous subroutine plus in A, set 0 to register
ruzki or something else for recording.
7744 CALL 5739 ;reading a sector with a file descriptor and replacing the descriptor
7747 LD DE,(23796); take the sector number to record
      DEC DE
      LD B,1 ;write 1 sector
      LD HL,23845 ;we will write from the buffer
7757 PUSH HL ;save the address of the sectors on disk and in memory
      PUSH DE
      CALL 15889 ;take the drive type
      BIT 7,(HL);is it 40-track?
      JR Z,7776; if yes, then you can write it down
      BIT 0,(HL) ;using 40 tracks on an 80-track?
      JR NZ,7776; if not, then you can write it down
      LD HL,10712 ;message address READ ONLY
      JP 7465 ;change to error handling
Attention, error!!! They forgot to set the error code in the battery.
7776 POP DE ;restoring sector addresses
      POP HL
7778 LD A,255; record sign
7780 LD (23758),A ;setting the operation flag
7783 LD (23796),DE; setting the address of sectors on the disk
      PUSH BC ;save the number of sectors
      PUSH HL ;and download/record addresses
      CALL 7734 ;read track index area
      POP HL ;restore download/record address
      POP BC ;and quantitiessectors
      XOR A ;number of sectors is 0?
      OR B
      RET Z ;if yes, then return
7797 PUSH BC ;save the address and number of sectors
      PUSH HL
      CALL 16134 ;setting the loading/writing address of sectors
      LD A,(23796) ;setting the sector number
      CALL 16130
      LD A,(23797) ;positioning the head on the track
      CALL 15971
      LD A,(23758) ;take the operation flag
      OR A ;loading?
      PUSH AF
      CALL Z,16142 ;if yes, then loading the sector
      POP AF
      CALL NZ,16138;otherwise sector entry
      POP HL; take the address of the next sector
      LD DE,256
      ADD HL,DE
      PUSH HL ;save it
      LD A,16; there are 16 sectors on the track
      LD HL,23796
      INC (HL) ;next sector
      CP (HL) ;end of track ?
      JR NZ,7847 ;if yes, then the next sector number is 0
      LD(HL),0
      LD HL,23797 ;and take the next track
      INC(HL)
7847 POP HL ;restoring the next sector address
      POP BC ;and number of sectors
      DJNZ 7797 ;if not all, then repeat
      RET ;return

 to be continued...

Share your thoughts about the article