Educational program - a complete disassembly of TR-DOS ROM.

City #20
OOOOOOOOOOOOOOOOOOOOOOOOO
     OOOOOOOOOOOLIKBEZ OOOOOOOOOO
            OOOOOOOOOOOOOOOOOOOOOOOOO

╔═════════════ ═══════════════════════════╗
║ ║
║ FULL DESCRIPTION + FULL DISASSEMBLER ║
║ ROM ║
║ ║
║ TR-DOS 5.04T (5.03) ║
║ ║
║ FOR PROFESSIONALS, ║
║ ║
║ AND ALSO FOR THOSE ║
║ ║
║ WHO WANTS TO BECOME THEM.         ║
║ ║
╚════════════════════ ════════════════════╝

               continuation





 P. Fedin
Address 1270. Checking variable 23801 and
checks that the end of the directory has been reached when
print.

1270 PUSH HL ;saving HL and BC
PUSH BC
      LD A,(23801) ;take the drive number
 to display the directory
      LD HL,23798 ; this disco is assigned
 water ?
      CP(HL)
      CALL NZ,15755;if not, then about the last
 Read at the end
Error in the program!! More on this at the end
                     text.
      POP BC ;restoration of HL and BC
 POP HL
      JP 12230 ;achievement check
 end of the directory and return
                    rat
Pay special attention to the CALL command
NZ,15755.  In a similar subroutine for
LIST costs CALL NZ,15819. In our case
control will be transferred to the subroutine
print the character (its address is 15744) to the address,

where are the 2 bytes of the address from the command
CALL 15764. The program from this address will
like this:
SUB H
DEC A
CALL 8433
POP DE
POP B.C.
POP HL
RET
This way the memory will change,
if it is enabled, then the stack will be
3 addresses were removed and placed inregisters and
then there will be a refund.  Consequences of everything
this is determined by the program that called
1270.
───────────────────── ─────────────────────
Address 1287. Addition 16 to HL.
1287 LD DE,16
      ADD HL,DE
      RET

────────────── ────────────────────────────
Address 1292. Verification and processing of achievements
near the end of the buffer when working with a directory.
Install 23756 and put current in HL
buffer location. If its end is reached, then
in HL there will be the beginning of the buffer and there will be
The next directory sector is loaded.
1292 PUSH HL ;saving HL and BC
PUSH BC
      LD BC,41435;end of buffer reached?
ADD HL,BC
      JR C,1303 ;if yes, then loading follows
 blowing sector
      POP BC ;restoration of HL and BC
 POP HL
      RET ;return
1303 LD HL,23756;next sector
 INC (HL)
      CALL 1004 ; loading it into the buffer
 POP BC ;restoration of BC and HL


 POP HL
      LD HL,23845;placement in HL addresses
 beginning of the buffer
      RET ;return
────────────── ────────────────────────────
Address 1316. Calculation of the drive number by
his name.  Place the name in A, on the output
there will be a number.
1316 AND 223 ; capital letter
 SBC A,65 ;calculation of disk number
 water
      JP C,7450 ;if the name was a symbol
 is less than "A", then an error
      CP 4 ;is the number greater than 3?
JP NC,7450;if yes, then error
 RET ;return
────────────── ────────────────────────────
Address 1338. Execute NEW command. Mouth-update 23825 and 23611. Also used with
addresses 1385 (record file information;
set the file number in register C).

1338 CALL 7629 ;receiving file names on
 calculator stack
      CALL 7541 ;if checking for
 syntax, then return
      CALL 4142 ;receiving file extension
 CALL 7344 ;setting the old name
 file
      LD A,(23798);take the drive number
LD (23800),A;save it
 JP NZ,985 ;if the file is not found, then
 error
      PUSH BC ;save file number
 CALL 5725 ;loading file descriptor
 la
      CALL 7344 ;setting a new name
 file
      PUSH AF ;saving the result
 file name checks
      LD A,(23800);in the new file name
 another disco is assigned
 water

LD HL,23798
      CP(HL)
      JP NZ,7450 ;if yes, then error
 CALL 1029 ;disk setting
 POP AF ;restoring the results
name check data
                   file
      JP Z,7248 ;if such a file is already
 is, then error
      POP BC ;number recovery
 file
1385 CALL 5739 ; loading sector with description
file mate and replacement
                   descriptor
      CALL 7747 ;sector overwrite
JP 993 ;O.K. message.
───────────────────── ─────────────────────
Address 1394. Checking variable 23824. Co-
responsible content will be installed
flag Z, and the contents themselves will be in the accumulative
tore.

1394 LD A,(23824)
      OR A
      RET
────────────── ────────────────────────────
Address 1399. Checking the number of erased
files. Install
23825. If there is 0, then there will be a message NO
FILE, otherwise O.K.
1399 LD A,(23825);take the amount of eraser

      OR A ;is it equal to 0 ?
 JP Z,985 ;if yes, then NO FILE
JP 993 ;otherwise O.K.




 to be continued...

Share your thoughts about the article