Energy #05
29 мая 1997 |
|
TR-DOS - The work of the ports of TR-DOS'a.
TR-DOS Docent / LGN '& Spectre / LGN In this issue we discover ENERGY a new section dedicated to small ruses, which facilitate the difficult life of the encoder. The first of these articles little deploy theme begun in ZX-FORMAT'e # 5 "TR-DOS programmers. ZX-FORMAT in the face of Max Petrov us very described in detail how to write a turbo-loader; Echo told how to avoid trouble when working with VG'shkoy; well and we will discuss work with the ports of TR-DOS'a. There is several ways to work with ports TR-DOS'a: - On some computers (eg PROFI) can be put on VG'shku direct access - In some ROM (TR-DOS) at # 3C30 stitched command codes IN A, (# 1F) RET - In TR-DOS v5.03 at # 09E7 is similar combination Pull all the port # 1F explained by the fact that the remaining ports to read is not so important (Except port # 7F course). And the port # 1F Reads a byte error occurred when the disc. A small digression: from entry in the ports are no problems, so as at # 2A53 stitched: OUT (C), A RET Now, about reading, the first and the best known way to read from the port # 1F Rodionov mentioned in his book, "TR-DOS for users and programmers, "he Despite its flaws (some spoil registers, spoil the contents of the port sectors, etc.) is still active applied. A more detailed description this method, see above book. We will tell you two more: # 3EF3 IN H, (C) # 3EF5 IN A, (# FF) AND # C0 JR Z, # 3EF5 EI RET M DI IN A, (# 7F) JR # 3EF5 This method works on all computers, using it can be read the contents of any register VG'shki. For that in BC Specifies the port number and H get the value read, the main that during this procedure came to signal the end of execution team. And the second: # 3FE5 IN A, (# FF) AND # C0 JR Z, # 3FE5 RET M # 3FEC INI JR # 3FE5 This procedure is used TR-DOS'om to read the data, but we can use it for reading information from any port. Application: HL asking address of where to place the result of the operation, and the BC port number. It needs to run with Address # 3FEC. Conditions of performance similar to the previous one. Corresponding bits to read information can be found in All the same book Rodionova of TR-DOS'e. If you are interested we can mention the address of # 2099, resulting from the use This procedure will be the state flag ZERO: if there was not one mistake then to Z, well, and if NZ - DISK ERROR!!! When This error is any situation (no disk read / write error, etc.) Now calling the procedure: PUSH BC; save BC and HL PUSH HL; IN LD HL, CONTIN; A, (# 1F) PUSH HL; LD HL, METKA; AND # 7F PUSH HL; LD B, 1; OR A PUSH BC; LD HL, # 2099; RET Z PUSH HL JP # 3D2F METKA DB # 01 CONTIN DI POP HL; continued POP BC Note: after is EI. At the end of articles may add in order to avoid problems with your computer "Byte-01 and to health our turbo-loader'ov on your hard drive The authors of this paper used the standard entry point to the TR-DOS - # 3D13, and the errors caught by # 5CC2. How to catch errors through # 5CC2 look at ART STUDIO. And maybe we'll write about it article.
Other articles:
Similar articles:
В этот день... 23 November