APPENDIX ELEVEN 764 2FC CH In COMPUTE!'s Third Book of Atari, Orson Scott Card explained the keyboard and how to read it using the CH register. The values listed as "internal code" in Appendix 10 are not the same as those produced at 764. The internal code is the order the characters are stored in the character set. The keycode re- flected by 764 is the hardware code, which is altogether dif- ferent for no reason I've been able to ascertain. 768-779 300-30B Page three device information Here are some brief examples showing how to use these loca- tions with the disk drive (it already has a handler in place, and we don't have to write a new one). The CIO call routine can be used in all your disk I/O routines based around these locations. To check if a sector has data in it: 5 DIM SEC$(128),CHK$(128) 10 DATA 104,32,83,228,96 15 SEC$(1)=CHR$(0):SEC$(128)=SEC$:SEC$(2)=S EC$:CHK$(1)=CHR$(0):CHK$(128) =CHK$:CHK$( 2)=CHK$ 16 REM SETS UP ARRAY SPACE AND FILLS IT 17 REM CHK$ IS FULL OF BLANK SPACES - CONTE NTS OF UNUSED SECTORS 20 FOR N=1536 TO 1540:READ X:POKE N,X:NEXT N 25 REM THIS POKES THE CIO CALL UP ROUTINE I NTO PAGE SIX 30 POKE 769,1:POKE 770,82 35 REM THIS POKES THE DRIVE NUMBER (1) AND READ FUNCTION (82) 40 PRINT "ENTER A SECTOR NUMBER TO CHECK":I NPUT SNUM 45 IF SNUM<0 OR SNUM>720 THEN 40:REM VALIDI TY CHECK ON NUMBERS 50 POKE 778,SNUM-(INT(SNUM/256)*256):POKE 7 79,INT(SNUM/256) 51 REM POKES LSB, MSB OF SECTOR INTO 778, 7 79 55 BUFFER=ADR(SEC$):BUFFL=BUFFER-(INT(BUFFE R/256)*256):BUFFH=INT(BUFFER/256) 56 POKE 772,BUFFL:POKE 773,BUFFH 57 REM POKE ADDRESS OF SEC$ INTO BUFFER ADD RESS 60 Z=USR(1536):REM CALL UP CIO ROUTINE 70 IF SEC$=CHK$ THEN PRINT "NO DATA IN SECT OR":GOTO 40 80 PRINT "SECTOR HAS DATA":GOTO 40