ZX-News #10
22 октября 1996 |
|
Programmers - Some mysteries command input and output.
Programmers Kostya Shelonin, 1996 On some "secret" Command INPUT / OUTPUT we all loved CPU Z80. Do not worry, it will not that A register is the high byte address port teams, ispolzyyuschih immediate operand, and ... execution time commands IN / OUT. Many people are familiar skazhyt: "What tyt mystery - he took, and looked at reference ". But the thing is just a guide ... Some time ago, it took me write protsedypy, which used to synchronize the port # FF (zakonchennyyu Test programmy, soderzhaschyyu ety protsedypy, dymayu, you've nibyd yvidite and betaversiyu - tomorrow, if zainteresyetes). So, it would have been nice if not one little trouble - not converge the actual and estimated run time below this fragment. This made me prizadymatsya ... int IN A, (# FF) INC A INC BC JP NZ, int Estimated time - 31 bar Real-time performance - 32 cycles I looked in the directory data on komandy IN A, (n), takes 11 clock cycles, and command IN A, (C) in 12 cycles, and decided instead of 11 cycles prikinyt 12 ... AND estimated time to come together with the real! This result is a bit puzzling, since it's not a typo - in drygih references also worth 11 clock cycles! In connection with this "mystery", I conducted a series of experiments on zamery runtime commands IN and OUT, and here is a reward for the experiments: n - 8-bit port address r - register, 8 bits team handbook really IN A, (n) 11 cycles 12 cycles IN r, (C) 12 cycles 12 cycles OUT (n), A 11 clock cycles 12 cycles OUT (C), r 12 cycles 12 cycles Drygie I / O commands are not checked! P.S. If you have any questions, can contact me by phone: (812) 151-44-43, Kostya Or soap on oridzhin (2:5030 / 41.30). With yvazheniem, K-Hacker from Omega group. __________________________
Other articles:
Similar articles:
В этот день... 21 November