88,89 Why the minus one in the calculation? The first byte of the screen is the first byte in the loop. If we add the total size, we will go one byte past the end of the soreen, so we subtract one from the total. Here's how to arrive at the value for the total amount ot memory located for screen use, display list and Text window: Total memory allocation for the screen Screen display Display List ----------------------------------------------------------- Text unused bytes screen unused used GR window always cond. use bytes bytes Total ----------------------------------------------------------- 0 ... none none 960 none 32 992 1 160 none 80 400 none 34 674 2 160 none 40 200 none 24 424 3 160 none 40 200 none 34 434 4 160 none 80 400 none 54 694 5 160 none 160 800 none 54 1174 6 160 none 320 1600 none 94 2174 7 160 none 640 3200 96 94 4190 8 160 16 1280 6400 80 176 8112 The number of bytes from RAMTOP (location 106; $6A) is counted from the left text window column towards the total column. MEMTOP (741, 742; $2E5, $2E6) points to one byte below RAMTOP * 256 minus the number of bytes in the total column. If 16 is added to the GRAPHICS mode (no text window), then the conditional unused bytes are added to the total. Then the bytes normally added for the text window become unused, and the Display List expands slightly. (See COMPUTE!, September 1981.) When you normally PRINT CHR$(125) (clear screen), Atari sends zeroes to the memory starting at locations 88 and 89. It continues to do this until it reaches one byte less than the contents of RAMTQP (location 106; $6A). Here is a potential source of conflict with your program, however: CHR$(125)--CLEAR SCREEN--and any GRAPHICS command actually continue to clear the first 64 ($40) bytes above RAMTOP! It would have no effect on BASIC since BASIC is a ROM cartridge. The OS Source Listing seems to indicate that it ends at RAMTOP, but Atari assumed that there would be nothing after RAMTOP, so no checks were provided. Don't reserve any data within 64 bytes of RAMTOP or else it will be eaten by the CLEAR SCREEN routine, or avoid using a CLEAR SCREEN or a GRAPHICS command. Scrolling the text window also clears 800 bytes of memory above RAMTOP. You can use this to clear other areas of memory by POKEing the