Virtual Worlds #01
31 декабря 1999 |
|
Assembler - Secrets of the TR-DOS: the methods of distribution presence drives.
TR-DOS (C) TimeKeeper / MHCG Opening this column, I would like would be to start to say a few words about why this is and for whom. The fact that a conversation on this subject was already quite a lot and it may seem that nothing new here for you can imagine, So, once I hasten to assure you that there are still enough problems and puzzles that joint efforts can try to solve. Yes and no All that has been published or someone said about the TR-DOS was correct and understandable. I have already quite a long time trying to write driver disk to complete the interception of disk errors, but could not find all the necessary data. Even in famous ZX-Revue I have not found answers to my issues, and listings of drivers that I tried to recruit, was often a lot of mistakes or they simply did not fit me. By the way, once I started, I'd tell a few "gentle" of articles from the ZX-Revue. Interesting there, of course, very much, but here's Listings leave much to be desired. Driver disk, which is in this issue magazine, has been recruited precisely because Revyushki, but it otassemblirovat in its original form and is not failed. Part Subprogramme just missing, and part was napisana wrong. I only narrowly failed to bring the driver to working condition. In connection with the this occasion I had the the impression that the listings programs are printed without any what a preliminary check on the performance. But this is the issue of professionalism, and perhaps we'll come back to it, but in another again ... The first thing I wanted to write - it's how you can determine availability of disk drives. Not the presence or absence of a floppy disk in drive, namely the existence of the drive. You ask why? Well, this is at your discretion. I used this verification in Hard Core ver 3.01 full, to know how many panels can be printed, two or one, and just recently included in the fashion insert in the program test computer, so that's there then You can adapt this procedure: ORG # 8000 ENT XOR A CALL TEST LD (DRV_0), A LD A, 1 CALL TEST LD (DRV_1), A LD A, 2 CALL TEST LD (DRV_2), A LD A, 3 CALL TEST LD (DRV_3), A RET TEST OR # 3C LD C, # FF LD HL, # 1FF3 CALL DOS LD A, # 08 LD HL, # 2FC3 CALL DOS LD IY, 10000 , The number of matched IY ; Empirically. , (The maximum time of movement; of drive heads from the village; glaciers on track zero) AGAIN LD HL, # 1FDD CALL DOS LD A, (# 5CD7) CP # 50 RET NZ DEC IY LD A, LY OR HY JR NZ, AGAIN RET DOS PUSH HL JP # 3D2F DRV_0 DEFB 0 DRV_1 DEFB 0 DRV_2 DEFB 0 DRV_3 DEFB 0 Generally speaking, the controller There is a special tool for definition of "readiness" to drive, but I have this tool triggered only when the drive is inserted floppy disk. A reduced the procedure correctly determines whether the drive is not regardless of whether there is in it floppy disk or not. How it works: when we send the controller command output on the zero track, he tries to receive from the drive confirmation operation is performed. (Signal 'head in the initial state' - 2_oy bit port # 1F) If the drive is connected and the head is at the zero path the controller immediately generates this signal, and if the drive No, the controller receives confirmation from the drive and not will issue a confirmation signal, indicating that team has not been completed. Naturally, testing should be carried out at off turbo mode if you have it. After starting the program will in turn the LED drives. To test each have spent approximately 1 / 25 seconds if the drive connected, and about 1 / 2 otherwise, so that during verification, before going on to the next drive, it would be nice display a message like: "wait, test drive number N ", so that the user did not think that the program hung. After testing, the corresponding variable is entered toe, if the device is not detected or # 28 with a positive result. At this opredelyalki about everything. Maybe next time I'll show you how to determine drive parameters: number of sides, paths, velocity heads, and perhaps even firm, to produce this model. :-))
Other articles:
Similar articles:
В этот день... 21 November