<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page &quot;Appvars&quot;</title>
		<link>http://z80-heaven.wikidot.com/forum/t-98069/appvars</link>
		<description>Posts in the discussion thread &quot;Appvars&quot;</description>
				<copyright></copyright>
		<lastBuildDate>Fri, 13 Mar 2026 07:22:30 +0000</lastBuildDate>
		
					<item>
				<guid>http://z80-heaven.wikidot.com/forum/t-98069#post-1729656</guid>
				<title>Appvars</title>
				<link>http://z80-heaven.wikidot.com/forum/t-98069/appvars#post-1729656</link>
				<description></description>
				<pubDate>Tue, 12 Mar 2013 19:36:30 +0000</pubDate>
				<wikidot:authorName>Xeda Elnara</wikidot:authorName>				<wikidot:authorUserId>595803</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>In the last tutorial we pointed out that you can not create permanent self modifying code.</p> </blockquote> <p>This is bugging me because you definitely can do this. The OS leaves the name of the executing program in OP1, so you can do something like:</p> <div class="code"> <pre><code> bcall(_ChkFindSym) ld hl,smc_num-9D95h+4 ;+4 because DE points tot he size bytes and 2 bytes are the header BB6Dh add hl,de ld e,(hl) inc hl ld d,(hl) inc de ld (hl),d dec hl ld (hl),e ex de,hl bcall(_DispHL) ret smc_num: .dw 0</code></pre></div> <br /> Note that this won't work on the uncompressed hex codes, so you need to either make sure to use AsmComp() or have it compiled by some compiler.
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>