552,553 When locations 536, 537 ($218, $219) reach (count down to) zero, the OS vectors through here (jumps to the location specified by these two addresses). You can set your machine code routine address here for execution when timer one reaches (counts down to) zero. Your code should end with the RTS instruction. Problems may occur when timer values are set greater than 255, since the 6502 cannot manipulate 16-bit values directly (a number in the range of zero to 255 is an eight-bit value; if a value requires two bytes to store, such as a memory location, it is a 16-bit value). Technically, a VBLANK interrupt could occur when one timer byte is being initialized and the other not yet set. To avoid this, keep timer values less than 255. See the Atari OS User's Manual, page 106, for details. Since the OS uses timer one, it is recommended that you use timer two instead, to avoid conflicts with the operation of the Atari. Initialized to 60396 ($EBEA) in the old ROMs, 60400 ($EBF0) in the new ROMs. NMI 552,553 228,229 CDTMA2 System timer two jump address. Not used by the OS, available to user to enter the address of his or her own routine to JMP to when the timer two (538, 539; $21A, $21B) count reaches zero. Initialized to zero; the address must be user specified. NMI 554 22A CDTMF3 System timer three flag, set when location 540, 541 ($21C, $21D) reaches zero. This register is also used by DOS as a timeout flag. 555 22B SRTIMR Software repeat timer, controlled by the IRQ device routine. It establishes the initial 1/2 second delay before a key will repeat. Stage two VBLANK establishes the 1/10 second repeat rate, decrements the timer and implements the auto repeat logic. Every time a key is pressed, STIMER is set to 48 ($30). Whenever SRTIMR is equal to zero and a key is being continuously pressed, the value of that key is continually stored in CH, location 764 ($2FC). 556 22C CDTMF4 System timer four flag. Set when location 542, 543 ($21E, $21F) counts down to zero. 557 22D INTEMP Temporary register used by the SETVBL routine at 58460 ($E45C). 558 22E CDTMF5 System timer five flag. Set when location 558, 559 ($22E, $22F) counts down to zero.