<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=BIOS_Kernel_Functions</id>
		<title>BIOS Kernel Functions - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=BIOS_Kernel_Functions"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;action=history"/>
		<updated>2026-08-28T16:41:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;diff=65519&amp;oldid=prev</id>
		<title>MacDeath at 16:40, 19 December 2010</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;diff=65519&amp;oldid=prev"/>
				<updated>2010-12-19T16:40:41Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:40, 19 December 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L48&quot; &gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== RAM Bank Selection (6128 only) ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== RAM Bank Selection (6128 only) ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; BD5B KL_RAM_SELECT_6128 ;in: A=new config, out: A=old config (6128 only)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; BD5B KL_RAM_SELECT_6128 ;in: A=new config, out: A=old config (6128 only)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:BIOS]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MacDeath</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;diff=39554&amp;oldid=prev</id>
		<title>Nocash at 21:50, 24 January 2010</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;diff=39554&amp;oldid=prev"/>
				<updated>2010-01-24T21:50:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:50, 24 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Low Jump (to BIOS Bank) ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Low Jump (to BIOS Bank) ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RST 08h is used in vectors at [BB00h and up] (official BIOS functions).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RST 08h is used in vectors at [BB00h and up] (official BIOS functions).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0008 KL_LO_JUMP (RST1)&amp;#160;  ;in: [[SP]]=dest,out: SP=SP+2;\jump dest AND 3FFFh&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0008 KL_LO_JUMP (RST1)&amp;#160;  ;in: [ [SP] ]=dest,out: SP=SP+2 ;\jump dest AND 3FFFh&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 000B KL_LO_CALL_HL&amp;#160; &amp;#160; &amp;#160;  ;in: HL=dest &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/del&gt;;/with ROM cfg = MSBs&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 000B KL_LO_CALL_HL&amp;#160; &amp;#160; &amp;#160;  ;in: HL=dest &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  &lt;/ins&gt;;/with ROM cfg = MSBs&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RST 28h is used in vectors at [BDxxh] (BASIC sub-functions; EDIT/FLO/INT).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RST 28h is used in vectors at [BDxxh] (BASIC sub-functions; EDIT/FLO/INT).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0028 KL_FIRM_JUMP (RST5) ;in: [[SP]]=addr,out:SP=SP+2 ;LO=ON,call addr,LO=OFF&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0028 KL_FIRM_JUMP (RST5) ;in: [ [SP] ]=addr,out:SP=SP+2 ;LO=ON,call addr,LO=OFF&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RST 08h and RST 28h act as &amp;quot;JUMPS&amp;quot;, ie. they discard the retadr on stack, and return to the function that has called the RST opcode (rather than returning to a location after the RST opcode).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RST 08h and RST 28h act as &amp;quot;JUMPS&amp;quot;, ie. they discard the retadr on stack, and return to the function that has called the RST opcode (rather than returning to a location after the RST opcode).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Although they aren't identical, RST 08h and RST 28h have exactly the same purpose, the main difference is that RST 28h is faster.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Although they aren't identical, RST 08h and RST 28h have exactly the same purpose, the main difference is that RST 28h is faster.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Far Call (to Any Bank) ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Far Call (to Any Bank) ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0018 KL_FAR_CALL_SP (RST3) ;in: [[[SP]]]=addr/cfg, out:PC=[SP]+2 ;\useful&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0018 KL_FAR_CALL_SP (RST3) ;in: [ [ [SP] ] ]=addr/cfg, out:PC=[SP]+2 ;\useful&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 001B KL_FAR_CALL_C_HL&amp;#160; &amp;#160; &amp;#160; ;in: HL=addr, C=cfg &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/del&gt;; for RSX&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 001B KL_FAR_CALL_C_HL&amp;#160; &amp;#160; &amp;#160; ;in: HL=addr, C=cfg &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/ins&gt;; for RSX&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0023 KL_FAR_CALL_HL&amp;#160; &amp;#160; &amp;#160; &amp;#160; ;in: [HL]=addr/cfg &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  &lt;/del&gt;;/commands&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0023 KL_FAR_CALL_HL&amp;#160; &amp;#160; &amp;#160; &amp;#160; ;in: [HL]=addr/cfg &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  &lt;/ins&gt;;/commands&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The triple-indirect [[[SP]]] means: [SP]=retadr, [retadr]=ptr16bit, [ptr16bit]=ptr24bit (lsb,msb,bank). Using the 16bit pointer (instead of directly storing the 24bit pointer after the RST opcode), has two reasons: One can store the KL_FIND_COMMAND result in DATA region (rather than needing to patch the CODE region), and one can put RST 18h in the 3-byte BIOS vector region (eg. done by AMSDOS to patch the CAS_functions; where the AMSDOS functions do manually remove retadr from stack, so that the FAR_CALL works like a FAR_JUMP in that case).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The triple-indirect [ [ [SP] ] ] means: [SP]=retadr, [retadr]=ptr16bit, [ptr16bit]=ptr24bit (lsb,msb,bank). Using the 16bit pointer (instead of directly storing the 24bit pointer after the RST opcode), has two reasons: One can store the KL_FIND_COMMAND result in DATA region (rather than needing to patch the CODE region), and one can put RST 18h in the 3-byte BIOS vector region (eg. done by AMSDOS to patch the CAS_functions; where the AMSDOS functions do manually remove retadr from stack, so that the FAR_CALL works like a FAR_JUMP in that case).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Side Call (to another BASIC bank) ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Side Call (to another BASIC bank) ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0010 KL_SIDE_CALL_SP (RST2);in: [[SP]]=dest,out:PC=[SP]+2;\jump dest OR C000h&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0010 KL_SIDE_CALL_SP (RST2);in: [ [SP] ]=dest,out:PC=[SP]+2 ;\jump dest OR C000h&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0013 KL_SIDE_CALL_HL&amp;#160; &amp;#160; &amp;#160;  ;in: HL=dest &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  &lt;/del&gt;;/bank=base+DEST/C000h&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 0013 KL_SIDE_CALL_HL&amp;#160; &amp;#160; &amp;#160;  ;in: HL=dest &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/ins&gt;;/bank=base+DEST/C000h&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Rarely useful. Probably intended for future, where BASIC ROM might grow from 16K to up to 64K (=four ROM banks).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Rarely useful. Probably intended for future, where BASIC ROM might grow from 16K to up to 64K (=four ROM banks).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nocash</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;diff=39553&amp;oldid=prev</id>
		<title>Nocash: Created page with '== Low Jump (to BIOS Bank) == RST 08h is used in vectors at [BB00h and up] (official BIOS functions).   0008 KL_LO_JUMP (RST1)   ;in: SP=dest,out: SP=SP+2;\jump dest AND 3FFF…'</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=BIOS_Kernel_Functions&amp;diff=39553&amp;oldid=prev"/>
				<updated>2010-01-24T21:48:42Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;== Low Jump (to BIOS Bank) == RST 08h is used in vectors at [BB00h and up] (official BIOS functions).   0008 KL_LO_JUMP (RST1)   ;in: &lt;a href=&quot;/index.php?title=SP&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;SP (page does not exist)&quot;&gt;SP&lt;/a&gt;=dest,out: SP=SP+2;\jump dest AND 3FFF…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Low Jump (to BIOS Bank) ==&lt;br /&gt;
RST 08h is used in vectors at [BB00h and up] (official BIOS functions).&lt;br /&gt;
  0008 KL_LO_JUMP (RST1)   ;in: [[SP]]=dest,out: SP=SP+2;\jump dest AND 3FFFh&lt;br /&gt;
  000B KL_LO_CALL_HL       ;in: HL=dest                 ;/with ROM cfg = MSBs&lt;br /&gt;
RST 28h is used in vectors at [BDxxh] (BASIC sub-functions; EDIT/FLO/INT).&lt;br /&gt;
  0028 KL_FIRM_JUMP (RST5) ;in: [[SP]]=addr,out:SP=SP+2 ;LO=ON,call addr,LO=OFF&lt;br /&gt;
RST 08h and RST 28h act as &amp;quot;JUMPS&amp;quot;, ie. they discard the retadr on stack, and return to the function that has called the RST opcode (rather than returning to a location after the RST opcode).&lt;br /&gt;
Although they aren't identical, RST 08h and RST 28h have exactly the same purpose, the main difference is that RST 28h is faster.&lt;br /&gt;
&lt;br /&gt;
== Far Call (to Any Bank) ==&lt;br /&gt;
  0018 KL_FAR_CALL_SP (RST3) ;in: [[[SP]]]=addr/cfg, out:PC=[SP]+2 ;\useful&lt;br /&gt;
  001B KL_FAR_CALL_C_HL      ;in: HL=addr, C=cfg                   ; for RSX&lt;br /&gt;
  0023 KL_FAR_CALL_HL        ;in: [HL]=addr/cfg                    ;/commands&lt;br /&gt;
The triple-indirect [[[SP]]] means: [SP]=retadr, [retadr]=ptr16bit, [ptr16bit]=ptr24bit (lsb,msb,bank). Using the 16bit pointer (instead of directly storing the 24bit pointer after the RST opcode), has two reasons: One can store the KL_FIND_COMMAND result in DATA region (rather than needing to patch the CODE region), and one can put RST 18h in the 3-byte BIOS vector region (eg. done by AMSDOS to patch the CAS_functions; where the AMSDOS functions do manually remove retadr from stack, so that the FAR_CALL works like a FAR_JUMP in that case).&lt;br /&gt;
&lt;br /&gt;
== Side Call (to another BASIC bank) ==&lt;br /&gt;
  0010 KL_SIDE_CALL_SP (RST2);in: [[SP]]=dest,out:PC=[SP]+2;\jump dest OR C000h&lt;br /&gt;
  0013 KL_SIDE_CALL_HL       ;in: HL=dest                ;/bank=base+DEST/C000h&lt;br /&gt;
Rarely useful. Probably intended for future, where BASIC ROM might grow from 16K to up to 64K (=four ROM banks).&lt;br /&gt;
&lt;br /&gt;
== Jump to Register (normal NEAR jumps, without changing memory banks) ==&lt;br /&gt;
  000E KL_JP_BC          ;in: BC=addr&lt;br /&gt;
  0016 KL_JP_DE          ;in: DE=addr&lt;br /&gt;
  001E KL_JP_HL          ;in: HL=addr&lt;br /&gt;
Jumps to BC, DE, or HL (either by PUSH BC/DE, RET, or by JP HL opcodes).&lt;br /&gt;
&lt;br /&gt;
== Enable/Disable upper or lower ROM ==&lt;br /&gt;
  B900 KL_U_ROM_ENABLE   ;out: A=old C'&lt;br /&gt;
  B903 KL_U_ROM_DISABLE  ;out: A=old C'&lt;br /&gt;
  B906 KL_L_ROM_ENABLE   ;out: A=old C'&lt;br /&gt;
  B909 KL_L_ROM_DISABLE  ;out: A=old C'&lt;br /&gt;
  B90C KL_ROM_RESTORE    ;in: A=new C' (Bit2,3)&lt;br /&gt;
Enables/disables upper or lower ROM (manipulates the BC' register, and writes the result to the Gate Array).&lt;br /&gt;
&lt;br /&gt;
== Upper ROM Bank Number ==&lt;br /&gt;
  B90F KL_ROM_SELECT     ;in: C=upper ROM bank (select, and enable that bank)&lt;br /&gt;
  B912 KL_CURR_SELECTION ;out: A=upper ROM bank&lt;br /&gt;
  B915 KL_PROBE_ROM      ;in: C=upper ROM bank, out: A=[C000h], HL=[C001h]&lt;br /&gt;
  B918 KL_ROM_DESELECT   ;in: B=new C', C=upper ROM bank, out: B=A, C=old bank&lt;br /&gt;
Related to upper ROM bank number, commonly used banks are 00h=BASIC, and 07h=AMSDOS (for details, see Port DFXXh).&lt;br /&gt;
&lt;br /&gt;
== Shadow RAM Read ==&lt;br /&gt;
  0020 KL_RAM_LD_A_HL (RST4) ;in: HL=src, out: A=[HL]&lt;br /&gt;
  B91B KL_RAM_LDIR           ;in: HL=src, DE=dest, BC=len&lt;br /&gt;
  B91E KL_RAM_LDDR           ;in: HL=src_end, DE=dest_end, BC=len&lt;br /&gt;
Temporarily disables ROM, and executes a LD A,[HL], LDIR, or LDDR opcode.&lt;br /&gt;
&lt;br /&gt;
== RAM Bank Selection (6128 only) ==&lt;br /&gt;
  BD5B KL_RAM_SELECT_6128 ;in: A=new config, out: A=old config (6128 only)&lt;/div&gt;</summary>
		<author><name>Nocash</name></author>	</entry>

	</feed>