--- title: "Use Less RAM By Typing More" type: "article" slug: "use-less-ram-by-typing-more-2" url: "http://localhost/article/use-less-ram-by-typing-more-2/" markdown_url: "http://localhost/article/use-less-ram-by-typing-more-2.md" published_at: "2022-10-07T12:27:44+00:00" modified_at: "2026-06-27T07:58:42+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Don Lambert wrote me a letter and stated that being a less experienced programmer he could not understand why I used statements with VAL and CODE in them. The answer, Don, is to save program space. Just a couple of bytes saved can sometimes save a whole disk track of 5090 bytes! One of my…" category: - name: "Nite-Times News" slug: "nite-times-news" taxonomy: "category" url: "http://localhost/category/periodicals/nite-times-news/" post_tag: - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Tutorial" slug: "tutorial" taxonomy: "post_tag" url: "http://localhost/tag/tutorial/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Bob Swoger (K9WVY)" slug: "bob-swoger" taxonomy: "indiv" url: "http://localhost/indiv/bob-swoger/" publication_r: id: 10206 title: "Nite-Times News" type: "periodical" url: "http://localhost/periodical/nite-times-news/" authors: "Bob Swoger" volume: "6" issue: "3" issues_articles: - id: 39311 title: "Nite-Times News v6 n3" type: "issue" url: "http://localhost/issue/nite-times-news-v6-n3/" pages: "7" pubdate: "May - June 1992" archive_link: false --- # Use Less RAM By Typing More [Don Lambert](http://localhost/indiv/donald-lambert/) wrote me a letter and stated that being a less experienced programmer he could not understand why I used statements with VAL and CODE in them. The answer, Don, is to save program space. Just a couple of bytes saved can sometimes save a whole disk track of 5090 bytes! One of my favorite examples is [Larry Kenny](http://localhost/indiv/larry-kenny/) opening up channel 4 to access his LKDOS because PRINT #4 is easier to type [less key strokes] than RAND USR 100. [page 11 of his V3 manual] Also, he told me it takes up less RAM space in a program. Well, LARRY, it can USE UP MORE RAM space! The problem I have is channel 4 is also assigned to my ZEBRA Talker and I can’t change that. Consider a short program to load [LogiCall](http://localhost/product/logicall/). Get in front of your machine and do the following: Turn on your TS2068 and type PRINT FREE. You get 38652. This is our free RAM space. Now enter the two lines: ``` 10 RANDOMIZE USR 100: OPEN #4, "dd" 20 PRINT #4: LOAD "L.B1" ``` Now type PRINT FREE . You get 38609. Strange, you just added 9 keystrokes to the program and gained 9 bytes of RAM! Now EDIT the lines and put VAL with quotes around the 100 and the 4s. The program now reads: ``` 10 RANDOMIZE USR VAL"100": OPEN #4, "dd" 20 PRINT # VAL"4": LOAD "L.B1" ``` Now type PRINT FREE . You get 38609. Strange, you just added 9 keystrokes to the program and gained 9 bytes of RAM! Now lets try the ultimate RAM saving trick. Most numbers over 31 can be expressed in the program as CODE. Let’s change VAL”100″ to CODE”d” , do you follow me, Don? It is on page 242 in the TS2068 manual. The program now reads: ``` 10 RANDOMIZE USR CODE"d": OPEN # VAL "4" "dd" 20 PRINT # VAL"4": LOAD "L.B1" ``` Now type PRINT FREE . You get 38611. Losing the two zeros bought us two bytes. Notice that the following statements all mean the same thing. ``` RANDOMIZE USR 100 RANDOMIZE USR VAL "100" RANDOMIZE USR CODE "d" ``` But what about OPENing channel 4 to save RAM space. Type in the program: ``` 10 LET h=CODE "d" 20 RANDOMIZE USR h: LOAD "L.B1" ``` Now type PRINT FREE. You get 38624. Both programs will LOAD LogiCall but the channel 4 call uses 41 bytes while the USR call uses only 28. Also, for the record, RAND USR h is six bytes shorter than PRINT # 4 and just as easy to type,