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

City #52


                            ░░▓▓  ██▓▓░░░░░▓▓█▓░░
          ▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▓████▓▓██▓▓██████▓▓█████▒░░░░░
     ░░░░▒▒▓▓▓▓▓▓▓█████▓▓███████▓████▓▓▓██▓▓█▓▓▓▓▓▓▓▓███▒
     ░▓██████▓██████▓███▓▓░░██████▓░███▓███████▓██▓█▓▓▒░
 ▓▓▓▓▓▓▓█▓▓▓█▓██▓▓████░░████████░█████    ▒▒█████▓▓▓▓██████▓█
 ░▒▓▓▓▓█▓█████▓▓     ███▓▓▓▓█░▓▓▓███▓▒  ▒▓▓███▓▓██▓▓▓▓██░░▒▒▓▓▓
   ░▒▓▓▓▓████▓▓  ▓░  ░████▓█░░██▓▓██▒ ░  ░██▓▓█▓▓▓▓███▓     ░█▒
  ░░░▒███████▓  █▓░  █▓▓███▓▓██████▓▓▒ ░  ░████▓▓▒▓▓█▓  ▓█   ▓▓▓
  ▓██▓▓█▓▓▓█▓  ▒▓░  ▓▓  ▓█▓  ▓█  ▓▒  ▓▓▒    ▒▓▒     ░█▒▓▓   ▓░▓▓
  ░▒▒▒▓▓▓░░█▒  ▓▓░  ▒  ░█▓   █▓    ▒▓█▓  ░▓  ░  ░▓  ░▒█░▓▓  ▓▓▓▓
    ▓███▓░░▒  ▓█▓  ▓░  ▓░   ░▓  ▒  ░██░  ▒▓  ░     ░█  ▓▒   █▓▓▓
    ▒▒▓▓▓    ▓█▓░  ▓█░    ░  █  ▓▒   ░▓▓    ░▒  ▒▓▓▓▒░    ░▓▓▓█▓
  ▒██████▓░░▓▓█▓  ▓███░▓░█░░▓█▓▓▓█░░░▓██▓░░▓▓▓▓    ░░██░░░▓▓▓▒▓
  ░░░░░▒▓▓▓▓▓██░░▓▓▓▓▓▓▓▓▓███████▓▓███▓▓█████▓▓▓░░▓▓▓░█▓▓▓▓▒▒▒░
      ░▒▒▒▓▓▓▓▓███░░░██▓▓▓██░░▓██▓▓▓▓▓▓▓░░░▓▓▓▓▓▓▓███░▓▓▓
     ░▓████▓▓█████▓▓▓███████▓▓████▓▓▓░░▓█▓▓▓▓▓▓▓▓▒▒▒░░
      ░░   ░░▒░▒▒▒░▒▒░░░▒░▒▓▓▒▒▒░▒▒░▒░░░░░░░░▓▓▓░░

  (c) П.Федин

  ПОЛНОЕ ОПИСАНИЕ + ПОЛНЫЙ ДИЗАССЕМБЛЕР ПЗУ TR-DOS 5.04 (5.03)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ДЛЯ ПРОФЕССИОНАЛОВ, А ТАКЖЕ ДЛЯ ТЕХ,WHO WANTS TO BECOME THEM
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 continued

      LD C,127 ;data register address
      LD A,E ;set track number
      OUT(63),A
      LD HL,(23784); take the address of the sector table to check
8330 LD B,3 ;3 attempts
      LD A,(HL); take the sector number from the table
      OUT (95),A ;sector setting
      PUSH HL ;save sector table address
8336 DI ;interrupt disable
      LD A,128 ;read sector
      OUT(31),A
      PUSH BC ;save the number of attempts
      CALL 16357 ;reading data at address from HL (in ROM, not
                    scary)
      IN A,(31) ;is everything okay?
      AND 127
      POP BC ;restore attempt counter
      JR Z,8358 ;if everything is in order, then the next sector
      DJNZ 8336 ;next try
      LD HL,23766;there is 1 bad sector
      INC(HL)
8358 POP HL ;restoring sector table address
      LD A,(HL); take the number of the current sector
      INC HL ;take the address of the next sector number
      CP 1 ;end of table ?
      JR NZ,8330; if not, then repeat
      EI ;interrupt enable
      RET ;return───────────────────────── ─────────────────── ────────────────────
Address 8367. Write byte 1 time. Place a byte in register D,
C - 127 and issue a write command to VG-93. Also used with
addresses 8369 (write byte multiple times; all for 8367 plus in B
number of issues).
8367 LD B,1 ;write 1 time
8369 IN A,(255);waiting for DRQ or INTRQ
      AND 192
      JR Z,8369
      RET M ;if INTRQ is received, then return
      OUT (C),D ;byte output
      DJNZ 8369 ;repeat to end
      RET ;return
───────────────────────── ─────────────────── ────────────────────
Address 8381. Disk formatting. Install 23770, 23767, 23782
and 23784.
8381 LD HL, 23767; take the number of formatted tracks
      LD B,(HL)
      XOR A ;check tracks
      INC HL
      LD(HL),A
      LD E,255 ;let's start from track 0
      PUSH BC ;save number of tracks
8390 INC E ;next track
      LD A,E
      LD B,27 ;positioning
      CALL 15940
      CALL 8171 ;select the upper side of the disk
      CALL 13021 ;print track number and format it
      LD A,(23770);take the quantity flagparties
      CP 128 ;format 2 sides ?
      JR NZ,8417;if yes, then
      CALL 8182 ;select the bottom side of the disk
      CALL 13071 ;print track number and format it
8417 POP BC ;restore number of tracks
      DJNZ 8390 ;if not all, then repeat
      RET ;return
───────────────────────── ─────────────────── ────────────────────
Address 8421. Deleting a buffer with memory changes. At the input of the installation
new variables 23734, 23800, 23820 and 23832. Output: in 23832
255 is written, and if 23820 contains 0, then it is also sent there
255. Also used from address 8433 (memory change, work-
Available only with 23734 and 23832).
8421 PUSH AF ;save AF
      LD A,(23800);do nothing?
      CP 255
      JR Z,8476 ;if yes, then return
      POP AF ;restore AF
      CALL 10608 ;deleting buffer
8433 PUSH AF ;save AF
      LD A,(23734);change allowed?
      CP 244
      JR Z,8476 ;if not, then return
      XOR A
      LD HL,23832;is there confirmation?
      OR(HL)
      LD (HL), 255; next time confirmation will be
      JR Z,8476; if it was not there, then return
      LD A,(23820);is there a buffer?
      OR A
      LD HL,23747 ;beginning of the first block
      LD DE,23859;beginning of the second block
      JR NZ,8465 ;if there is a buffer, then the second block is offset by 257
      LD DE,24116 ;bytes
8465 LD B,45; block length - 45 bytes
8467 LD C,(HL) ;swap blocks
      LD A,(DE)
      LD(HL),A
      LD A,C
      LD(DE),A
      INC HL
      INC DE
      DJNZ 8467
8476 POP AF ;AF recovery
      RET ;return
───────────────────────── ─────────────────── ────────────────────
Address 8478. Clearing the editor buffer.
8478 LD HL,(23641);take the editor buffer address
      LD (HL),13 ;ENTER
      LD (23643),HL;cursor setting
      INC HL ;end of area
      LD(HL),128
      RET ;return
───────────────────────── ─────────────────── ────────────────────
Address 8490. Command line recovery. Set to 23840.
8490 LD DE,(23641);transfer symbols to the editor buffer
      LD HL,23840 ;from 23840
      CALL 688 ;transfer characters
      RET ;return

 to be continued...

Share your thoughts about the article