--- title: "Change RAMTOP Without NEW" type: "article" slug: "change-ramtop-without-new" url: "http://localhost/article/change-ramtop-without-new/" markdown_url: "http://localhost/article/change-ramtop-without-new.md" published_at: "2025-08-04T01:19:32+00:00" modified_at: "2026-06-21T23:36:15+00:00" featured_image: url: "http://localhost/wp-content/uploads/2025/08/SyncWare-News-v1n1-6_0068-1024x892-1.jpg" excerpt: "You may have wanted to change RAMTOP without wiping out what you have in memory. It is not enough to simply POKE 16388 and 16389 with the desired RAMTOP, since the machine-code stack stays in the same place until you relocate them using NEW. Several \"fixes\" have been reported, including one using a ROM call…" category: - name: "SyncWare News" slug: "syncware-news" taxonomy: "category" url: "http://localhost/category/periodicals/syncware-news/" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" publication_r: id: 10245 title: "SyncWare News" type: "periodical" url: "http://localhost/periodical/syncware-news/" authors_r: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" volume: "1" issues_articles: - id: 38991 title: "SyncWare News v1" type: "issue" url: "http://localhost/issue/syncware-v1/" pages: "74" pubdate: "1984" archive_link: false --- # Change RAMTOP Without NEW You may have wanted to change RAMTOP without wiping out what you have in memory. It is not enough to simply POKE 16388 and 16389 with the desired RAMTOP, since the machine-code stack stays in the same place until you relocate them using NEW. Several “fixes” have been reported, including one using a ROM call in SWN 1:3; an observant reader pointed out that it simply didn’t work. Since then, I’ve been looking into how the various programs that accomplish this go about it, and found there are several different approaches. My favorite is used in the initialization routine for G. Russell’s “HRP” program. In its simplest form, the routine goes like this: ``` 215B40 LD HL,TADD F9 LD SP,HL 21nnnn LD HL,desired RAMTOP 220440 LD (RMTP),HL 2B DEC HL F9 LD SP,HL 2B DEC HL 2B DEC HL 220240 LD (ERSP),HL C37506 JP 0675 ``` Notice how the routine uses system variable TADDR, which the manual claims is “very unlikely to be useful.” (Heh, heh…) Also note the lack of a RET at the end; instead it jumps into the ROM (at an “uncharted” entry point, no less) from whence the ROM returns you to BASIC, The charm of this one is that you can use it within a program and keep right on running on return. Don’t call it from within a GOSUB or m/c CALL, and don’t PUSH anything you want to keep, as the stack is reset to “empty.