--- title: "Beyond the TS 1500 (ZX81/TS 1000) User Manual: Your RAM Memory" type: "article" slug: "beyond-the-ts-1500-zx81-ts-1000-user-manual-your-ram-memory" url: "http://localhost/article/beyond-the-ts-1500-zx81-ts-1000-user-manual-your-ram-memory/" markdown_url: "http://localhost/article/beyond-the-ts-1500-zx81-ts-1000-user-manual-your-ram-memory.md" published_at: "2026-11-03T17:32:43+00:00" modified_at: "2026-11-03T21:15:07+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Here are some corrections to the first installment of this series which appeared in the July/August '87 issue of TDM. On page 30, lines 5 and 6, right column, should read as follows: \"displacement between E_LINE and STKEND as after the line has been placed in the Program area, the Line being typed + work…" post_tag: - name: "Errata" slug: "errata" taxonomy: "post_tag" url: "http://localhost/tag/errata/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "TS 1500" slug: "ts1500" taxonomy: "post_tag" url: "http://localhost/tag/ts1500/" - name: "Tutorial" slug: "tutorial" taxonomy: "post_tag" url: "http://localhost/tag/tutorial/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" - name: "Timex/Sinclair 1500" slug: "ts-1500" taxonomy: "model" url: "http://localhost/model/ts-1500/" indiv: - name: "Earl Dunnington" slug: "earl-dunnington" taxonomy: "indiv" url: "http://localhost/indiv/earl-dunnington/" publication_r: id: 10277 title: "Time Designs Magazine" type: "periodical" url: "http://localhost/periodical/time-designs-magazine/" authors: "Earl V Dunnington" volume: "4" issue: "1" issues_articles: - id: 36805 title: "Time Designs Magazine v4 n1" type: "issue" url: "http://localhost/issue/time-designs-magazine-v4-n6-2/" pages: "19-20" pubdate: "November/December 1987" archive_link: false --- # Beyond the TS 1500 (ZX81/TS 1000) User Manual: Your RAM Memory Here are some corrections to the first installment of this series which appeared in the July/August ’87 issue of TDM. On page 30, lines 5 and 6, right column, should read as follows: “displacement between E_LINE and STKEND as after the line has been placed in the Program area, the Line being typed + work space area no longer exists and the”. Hopefully no one with a ZX81 that did not have a RAMPACK attached tried to do the examples from lines 27 to 30, left col., page 30. If so, I extend my apologies as there is not enough memory left after expanding the Display file to enter the commands. You would have to PEEK each address of the System variable E_LINE separately, recording the results either with pencil and paper or use the [TS2040 printer](http://localhost/product/printer/) and LPRINT instead of PRINT. Then turn off the computer to get back into the unexpanded Display mode. You can then carry out the arithmetic. The remainder of the examples can be done in the unexpanded Display mode. In the first episode of this article, a diagram (Figure 1) was presented depicting the structure of the BASIC system in the RAM memory after turning on the computer or entering NEW. You will need that diagram, the TS2040 printer, and your USER MANUAL. BASIC routines were presented to prove that the structure of the BASIC system of the lower RAM memory consisted of either 153 or 920 bytes depending upon the value stored in the System variable RAMTOP. Partial proof was also presented that the number of bytes in the upper RAM memory used by the BASIC system after initialization, are four. Unfortunately, there is no System variable for the Machine stack pointer, sp. These two registers (s and p) of the Z80 CPU cannot be PEEKed directly using BASIC. Only by the use of a machine code program and the USR function can the address stored in these two registers be determined. Indirect proof that the addressed stored in the s and p registers and the address stored in the System variable ERR SP are the same at the time of completion of initialization, is that the routines I presented to set RAMTOP within a program would not work if this was not correct (see page 9 and 10, July/Aug ’85, or page 9 and 10 of “[The Best of TDM Vol.1](http://localhost/book/the-best-of-time-designs/)“, also Fig. No.1, pg. 16, Nov/Dec ’86 and Fig. 4, pg. 40, Jan/Feb ’87). Referring to diagram Figure 1 (July/Aug ’87, pg. 30), let us now prove that the System variables area contains 125 bytes. To do this we substract the fixed address of the start of the System variables from the fixed address 16509 which is the address of the first byte of the Display file in no BASIC program is in the computer. Turn on the computer and type in the direct command: PRINT 16509-16384 Then press ENTER. The result should be 125. The two bytes of the System variable D_FILE contain the address of the start of the Display file. If Figure No.1 is correct, PEEKing these two bytes should return the value 16509, proving that the Program area does not exist until a numbered program line is entered. Compare Figure No.1 with the diagram on page 128 of the ZX81 and the TS1000 (or page 154 of the TS1500) User Manuals. Turning to the listing of the System variables in your manual, you will find that the addresses of the two bytes of D_FILE are n=16396 and n+1=16397. Substituting these values in the PEEK formula at the beginning of the listing, type in the direct command: PRINT PEEK 16396+256*PEEK 16397 Then press ENTER. The result should be 16509. To prove that the unexpanded Display file, with the cursor showing on the screen, uses 26 bytes, we must be very devious, because when a direct command is ENTERed both the command and the cursor no longer occupy the Display file. In order to avoid using the screen for the results we use the 2040 or equivalent printer. Then if your computer has 3.25K or more RAM, you must fool the computer into thinking there is less than this amount available so that an unexpanded Display file will be set up. To do this, POKE the System variable RAMTOP with an address less than 19712 and then execute a CLS. For example using the address 19711, type in the following direct commands: (Note: ZX81 must have RAMPACK) POKE 16388,19711-256*INT (19711/256) Then press ENTER POKE 16389, INT (19711/256) Then press ENTER CLS Then press ENTER Everybody type in the program presented in Figure Number 2. A line by line explanation follows: ``` 10 POKE 16418,0 20 PRINT AT 23,0;"[inverse K]" 30 LPRINT (PEEK 16400+256*PEEK 16401)-(PEEK 16396+256*PEEK 163 97) 40 LPRINT "PRESS ANY KEY TO QU IT" 50 LPRINT 60 PAUSE 32768 70 POKE 16418,2 FIGURE NO. 2 ``` 10 – POKEs the System Variable DF_SZ with a zero so that you can print on lines 22 or 23 of screen display. 20 – PRINTs the inverse K on line 23. 30 – LPRINTs, using the printer, the difference between the addresses contained in the System variables VARS and D FILE. 40 – LPRINTs a message on the printer. 50 – Advances the paper in the printer so that the messages can be read. 60 – Stops the program execution so that the screen with the inverse K can be seen. 70 – Restores the original value in the System variable DF_SZ to avoid a crash. Turn on the printer, type RUN, and press ENTER. Be sure to follow the instructions to quit. Leave the program in your computer. In order to prove that the expanded Display file, with or without the cursor, uses 793 bytes, POKE the System variable RAMTOP with a value 19712 or greater, then enter a CLS. For example, using 19712, type in the following direct commands: POKE 16388, 19712-256*INT (19712/256) Then press ENTER POKE 16389, INT (19712/256) Then press ENTER CLS Then press ENTER Be sure that the printer is on, then type in RUN and press ENTER. To continue follow the instruction to quit. Delete lines 10, 20, and 70. Then rerun the program. It is very important to understand that you do not change the physical location of RAMTOP by merely POKEing the System variable RAMTOP without entering NEW or by a special routine (see “Automatically Set RAMTOP” page 9 in either TDM, Jul/Aug ’85, or “The Best of TDM Vol.1”). Clear the computer by turning it off and back on. If we take the address contained in the System variable E_LINE and subtract the address contained in the System variable VARS we should, according to Figure No.1, find only one byte of memory present in the variables area. Type in the direct command: PRINT (PEEK 16404+256*PEEK 16405)-(PEEK 16400+256*PEEK 16401) Then press ENTER The result should be a one (1) To find the value that is stored by the ROM routines, always in the last address of the Variables area, type in the direct command: PRINT PEEK (PEEK 16400+256*PEEK 16401) Then press ENTER The result should be 128. Turning to page 139 of the ZX81 (page 140 of the TS1000 or page 144 of the TS1500) User Manuals, you will find that the value corresponds to 80 hexadecimal. To prove that this is the marker that tells the SAVE command that it has reached the end of the data to be recorded on tape would require an investigation of the ROM SAVE routine and is beyond the scope of these articles. This concluded the chapter on the big picture of how your RAM memory is utilized by the BASIC programming system of the computer. Among others, we have dispelled such myths as “you can PRINT on 22 lines of the display”, “the programmable area of the screen consists of 23 lines and 32 characters”, and “the display file constantly occupies 1K of memory”.