<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
		<id>https://rn-wissen.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User</id>
		<title>Assembler Einführung für Bascom-User - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="https://rn-wissen.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User"/>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;action=history"/>
		<updated>2026-04-12T03:25:57Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in RN-Wissen.de</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17735&amp;oldid=prev</id>
		<title>Besserwessi: /* SBI/CBI bei Interrupt-Flags */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17735&amp;oldid=prev"/>
				<updated>2011-07-26T16:57:26Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;SBI/CBI bei Interrupt-Flags&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 26. Juli 2011, 16:57 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1218&quot; &gt;Zeile 1.218:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.218:&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;=== SBI/CBI bei Interrupt-Flags ===&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;=== SBI/CBI bei Interrupt-Flags ===&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;Für das Setzen und Löschen einzelner Bits gibt es für die ersten 32 IO Register extra Befehle SBI und CBI.&amp;#160; Eine mögliche Anwendung ist zum Beispiel das Ausgeben einer 1 auf PortA, Bit 3 mit dem Befehl&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;Für das Setzen und Löschen einzelner Bits gibt es für die ersten 32 IO Register extra Befehle SBI und CBI.&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Diese Befehle fallen etwas aus dem Rahmen, weil hier kleines der 32 GPRs benutzt wird.&amp;#160;  &lt;/ins&gt;Eine mögliche Anwendung ist zum Beispiel das Ausgeben einer 1 auf PortA, Bit 3 mit dem Befehl&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; SBI&amp;#160;  PortA,3&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; SBI&amp;#160;  PortA,3&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;statt des längeren&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;statt des längeren&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1227&quot; &gt;Zeile 1.227:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.227:&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;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &amp;#160;&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;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &amp;#160;&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;−&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;Die Interrupt-Flags werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Wieder zurück auf 0 geht es durch das Auslösen des Interrupts oder halt von Hand durch das Programm. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;Die Interrupt-Flags werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Wieder zurück auf 0 geht es durch das Auslösen des Interrupts oder halt von Hand durch das Programm. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Eine gewisse Logic hat das Löschen mit einer 1 schon, denn oft will man nach dem Aktivieren von Interrupts über die Interrupt-Masken die dazugehörigen Interrupt-Flags löschen. Dazu kann man so den selben Wert einfach in beide Register schreiben&lt;/ins&gt;. &amp;#160;&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;−&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt zum löschen eines Interrupt-falgs den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so ähnlich umgesetzt wie oben gezeigt, nur das Register r16 und das Status Register bleiben unverändert. Für die normalen Register ist es kein Problem den Inhalt auszulesen und wieder zu schreiben. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(z.B. Mega8, Mega32) &lt;/ins&gt;jetzt auf die Idee kommt zum löschen eines Interrupt-falgs den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so ähnlich umgesetzt wie oben gezeigt, nur das Register r16 und das Status Register bleiben unverändert. Für die normalen Register ist es kein Problem den Inhalt auszulesen und wieder zu schreiben. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;−&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;Bei einigen (neueren, z.B. Mega88) µCs wurde das Verhalten des SBI Befehls so geändert, dass wirklich nur das eine Bit geschrieben wird - es geht dann mit SBI, aber halt nur bei diesen neueren Chips und den ersten 32 IO Registern.&amp;#160; So viel komplizierter ist das Löschen eines Interrupt Flags über die Befehle LDI und OUT auch nicht. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&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;Bei einigen (neueren, z.B. Mega88&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, Tiny2313, Mega324&lt;/ins&gt;) µCs wurde das Verhalten des SBI Befehls so geändert, dass wirklich nur das eine Bit geschrieben wird - es geht dann mit SBI, aber halt nur bei diesen neueren Chips und &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;natürlich nur &lt;/ins&gt;den ersten 32 IO Registern.&amp;#160; So viel komplizierter ist das Löschen eines Interrupt Flags über die Befehle LDI und OUT auch nicht. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&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;==Unterprogramme==&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;==Unterprogramme==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17726&amp;oldid=prev</id>
		<title>Besserwessi: /* SBI/CBI bei Interrupt-Flags */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17726&amp;oldid=prev"/>
				<updated>2011-07-25T19:24:39Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;SBI/CBI bei Interrupt-Flags&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 25. Juli 2011, 19:24 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1229&quot; &gt;Zeile 1.229:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.229:&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;Die Interrupt-Flags werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Wieder zurück auf 0 geht es durch das Auslösen des Interrupts oder halt von Hand durch das Programm. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;Die Interrupt-Flags werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Wieder zurück auf 0 geht es durch das Auslösen des Interrupts oder halt von Hand durch das Programm. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;−&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt zum löschen eines &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Interruptfalgs &lt;/del&gt;den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so ähnlich umgesetzt wie oben gezeigt, nur das Register r16 und das Status Register bleiben unverändert. Für die normalen Register ist es kein Problem den &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;inhalt &lt;/del&gt;auszulesen und wieder zu schreiben. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt zum löschen eines &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Interrupt-falgs &lt;/ins&gt;den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so ähnlich umgesetzt wie oben gezeigt, nur das Register r16 und das Status Register bleiben unverändert. Für die normalen Register ist es kein Problem den &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Inhalt &lt;/ins&gt;auszulesen und wieder zu schreiben. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;−&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;Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;so das &lt;/del&gt;wirklich nur das eine Bit geschrieben wird&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. Trotzdem &lt;/del&gt;geht das Löschen eines Interrupt Flags &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;besser und schneller &lt;/del&gt;über &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;den Befehl &lt;/del&gt;OUT. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.&amp;#160; Es gibt also gar keinen Grund die Befehle SBI oder CBI für die Interrupt-Flags zu benutzen&lt;/del&gt;.&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;Bei einigen (neueren&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, z.B. Mega88&lt;/ins&gt;) µCs wurde das Verhalten des SBI Befehls &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;so &lt;/ins&gt;geändert, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dass &lt;/ins&gt;wirklich nur das eine Bit geschrieben wird &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;- es &lt;/ins&gt;geht &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dann mit SBI, aber halt nur bei diesen neueren Chips und den ersten 32 IO Registern.&amp;#160; So viel komplizierter ist &lt;/ins&gt;das Löschen eines Interrupt Flags über &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;die Befehle LDI und &lt;/ins&gt;OUT &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;auch nicht&lt;/ins&gt;. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&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;==Unterprogramme==&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;==Unterprogramme==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17614&amp;oldid=prev</id>
		<title>Besserwessi: /* SBI/CBI bei Interrupt-Flags */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17614&amp;oldid=prev"/>
				<updated>2011-07-23T19:14:48Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;SBI/CBI bei Interrupt-Flags&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 23. Juli 2011, 19:14 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1219&quot; &gt;Zeile 1.219:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.219:&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;=== SBI/CBI bei Interrupt-Flags ===&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;=== SBI/CBI bei Interrupt-Flags ===&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;Für das Setzen und Löschen einzelner Bits gibt es für die ersten 32 IO Register extra Befehle SBI und CBI.&amp;#160; Eine mögliche Anwendung ist zum Beispiel das Ausgeben einer 1 auf PortA, Bit 3 mit dem Befehl&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;Für das Setzen und Löschen einzelner Bits gibt es für die ersten 32 IO Register extra Befehle SBI und CBI.&amp;#160; Eine mögliche Anwendung ist zum Beispiel das Ausgeben einer 1 auf PortA, Bit 3 mit dem Befehl&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; SBI PortA,3&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; SBI &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;PortA,3&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;statt des längeren&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;statt des längeren&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; in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;r16, PortA&amp;#160; &amp;#160;  &amp;#160;&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; in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160;  &lt;/ins&gt;r16, PortA&amp;#160; &amp;#160;  &amp;#160;&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; ori r16, 8&amp;#160; &amp;#160; &amp;#160; &amp;#160;  ' bei der 8 ist Bit 3 gesetzt&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; ori &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;r16, 8&amp;#160; &amp;#160; &amp;#160; &amp;#160;  ' bei der 8 ist Bit 3 gesetzt&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; out PortA, r16&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; out &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;PortA, r16&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;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &amp;#160;&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;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &amp;#160;&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;−&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;Die &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;entsprechenden Bits in dem Register &lt;/del&gt;werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;Die &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Interrupt-Flags &lt;/ins&gt;werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Wieder zurück auf 0 geht es durch das Auslösen des Interrupts oder halt von Hand durch das Programm&lt;/ins&gt;. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;−&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dazu &lt;/del&gt;den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt wie oben gezeigt, nur das Register r16 und das Status Register bleiben unverändert. Für die normalen Register ist &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;das in der Regel &lt;/del&gt;kein Problem. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zum löschen eines Interruptfalgs &lt;/ins&gt;den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ähnlich &lt;/ins&gt;umgesetzt wie oben gezeigt, nur das Register r16 und das Status Register bleiben unverändert. Für die normalen Register ist &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;es &lt;/ins&gt;kein Problem &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;den inhalt auszulesen und wieder zu schreiben&lt;/ins&gt;. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das wirklich nur das eine Bit geschrieben wird. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&amp;#160; Es gibt also gar keinen Grund die Befehle SBI oder CBI für die Interrupt-Flags zu benutzen.&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;Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das wirklich nur das eine Bit geschrieben wird. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&amp;#160; Es gibt also gar keinen Grund die Befehle SBI oder CBI für die Interrupt-Flags zu benutzen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17591&amp;oldid=prev</id>
		<title>Besserwessi: /* begrenzte Reichweite von IN / OUT */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17591&amp;oldid=prev"/>
				<updated>2011-07-22T16:18:34Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;begrenzte Reichweite von IN / OUT&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 22. Juli 2011, 16:18 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1206&quot; &gt;Zeile 1.206:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.206:&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;=== begrenzte Reichweite von IN / OUT ===&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;=== begrenzte Reichweite von IN / OUT ===&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;Für das Ansprechen der Peripherie-Geräte und PORTs gibt es die Befehle IN und OUT. Diese sind ganz ähnlich den Befehlen LDS bzw. STS. Bei IN und OUT gehen die erlaubten Adresse nur bis 63 und damit man damit etwas weiter kommt wird noch 32 dazu addiert. Ein &amp;#160;&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;Für das Ansprechen der Peripherie-Geräte und PORTs gibt es die Befehle IN und OUT. Diese sind ganz ähnlich den Befehlen LDS bzw. STS. Bei IN und OUT gehen die erlaubten Adresse nur bis 63 und damit man damit etwas weiter kommt wird noch 32 dazu addiert. Ein &amp;#160;&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; IN Register, ioadr&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; IN &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160;  &lt;/ins&gt;Register, ioadr&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;entspricht also einem&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;entspricht also einem&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; LDS Register, ioadr+32&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; LDS &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;Register, ioadr+32&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;Durch die relativ lange Adresse, von immerhin 16 Bits (auch wenn die selten alle wirklich gebraucht werden) ist der Befehl LDS doppelt so lang und braucht auch doppelt so lange wie die kurze Form IN. &amp;#160;&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;Durch die relativ lange Adresse, von immerhin 16 Bits (auch wenn die selten alle wirklich gebraucht werden) ist der Befehl LDS doppelt so lang und braucht auch doppelt so lange wie die kurze Form IN. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17590&amp;oldid=prev</id>
		<title>Besserwessi: /* SBI/CBI bei Interrupt-Flags */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17590&amp;oldid=prev"/>
				<updated>2011-07-22T14:27:13Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;SBI/CBI bei Interrupt-Flags&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 22. Juli 2011, 14:27 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1221&quot; &gt;Zeile 1.221:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.221:&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; SBI PortA,3&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; SBI PortA,3&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;statt des längeren&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;statt des längeren&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; in&amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;R16&lt;/del&gt;, PortA&amp;#160; &amp;#160;  &amp;#160;&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; in&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;r16&lt;/ins&gt;, PortA&amp;#160; &amp;#160;  &amp;#160;&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; ori &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;R16&lt;/del&gt;, 8&amp;#160; &amp;#160; &amp;#160; &amp;#160;  ' bei der 8 ist Bit 3 gesetzt&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; ori &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;r16&lt;/ins&gt;, 8&amp;#160; &amp;#160; &amp;#160; &amp;#160;  ' bei der 8 ist Bit 3 gesetzt&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; out PortA, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;R16&lt;/del&gt;&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; out PortA, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;r16&lt;/ins&gt;&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;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &amp;#160;&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;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1229&quot; &gt;Zeile 1.229:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.229:&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;Die entsprechenden Bits in dem Register werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;Die entsprechenden Bits in dem Register werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&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;−&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt wie oben gezeigt, nur &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;R16 &lt;/del&gt;und das Status Register bleiben unverändert. Für die normalen Register ist das in der Regel kein Problem. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. noch schlechter CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt wie oben gezeigt, nur &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;das Register r16 &lt;/ins&gt;und das Status Register bleiben unverändert. Für die normalen Register ist das in der Regel kein Problem. Aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird und eine 1 Schreiben bedeutet hier halt gerade Bit löschen. &amp;#160;&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;Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das wirklich nur das eine Bit geschrieben wird. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&amp;#160; Es gibt also gar keinen Grund die Befehle SBI oder CBI für die Interrupt-Flags zu benutzen.&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;Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das wirklich nur das eine Bit geschrieben wird. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum löschen einzelner Bits hat das Register ja schon von sich aus.&amp;#160; Es gibt also gar keinen Grund die Befehle SBI oder CBI für die Interrupt-Flags zu benutzen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17589&amp;oldid=prev</id>
		<title>Besserwessi: /* SBI/CBI bei Interrupt-Flags */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17589&amp;oldid=prev"/>
				<updated>2011-07-22T14:24:13Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;SBI/CBI bei Interrupt-Flags&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 22. Juli 2011, 14:24 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1218&quot; &gt;Zeile 1.218:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.218:&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;=== SBI/CBI bei Interrupt-Flags ===&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;=== SBI/CBI bei Interrupt-Flags ===&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI &lt;/del&gt;und &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;SBI zum setzen bzw. &lt;/del&gt;Löschen einzelner Bits &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;geboten. Da kommen sogar gleich 2 Tücken zusammen. Zum einen verhalten sich diese &lt;/del&gt;IO Register &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;beim schreiben ungewöhnlich&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Die entsprechenden Bits in dem Register werden von der Hardware &lt;/del&gt;auf &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1 gesetzt wenn ein Interrupt ausgelöst werden könnte&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;z.B. bei einem Timer Überlauf. Das schreiben &lt;/del&gt;in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;diese IO-Register hat einen ungewöhnlichen Effekt. Die Bits wo man eine 1 hinschreibt werden gelöscht&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;und &lt;/del&gt;bei &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;einer 0 passiert einfach nichts. Dadurch &lt;/del&gt;ist &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;es möglich gezielt ausgewählte Bits zu löschen&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&lt;/del&gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Für das Setzen &lt;/ins&gt;und Löschen einzelner Bits &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gibt es für die ersten 32 &lt;/ins&gt;IO Register &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;extra Befehle SBI und CBI&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; Eine mögliche Anwendung ist zum Beispiel das Ausgeben einer 1 &lt;/ins&gt;auf &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;PortA&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Bit 3 mit dem Befehl&lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt; SBI PortA,3&lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt;statt des längeren&lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; R16&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;PortA&amp;#160; &amp;#160;  &lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt; ori R16, 8&amp;#160; &amp;#160; &amp;#160; &amp;#160;  ' &lt;/ins&gt;bei &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;der 8 &lt;/ins&gt;ist &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Bit 3 gesetzt&lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt; out PortA&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;R16&lt;/ins&gt;&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;−&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dass die CPU das ganze Register ausliest&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dann das gewünschte Bit setzt &lt;/del&gt;und &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;schließlich &lt;/del&gt;das &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ganze &lt;/del&gt;Register &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;zurück schreibt - ganz so wie man es sonst auch zu Fuß machen würde, nur halt in einem Befehl&lt;/del&gt;. Für die normalen Register ist das in der Regel kein Problem&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, aber &lt;/del&gt;bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;zurück &lt;/del&gt;geschrieben wird. Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;es geht&lt;/del&gt;. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;verändern &lt;/del&gt;einzelner Bits hat das Register ja schon von sich aus.&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Bei den Interrupt-Flags ist besondere Vorsicht mit den Befehlen CBI und SBI geboten. Da kommen sogar gleich 2 Tücken zusammen. &lt;/ins&gt;&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;&amp;#160;&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 class=&quot;diffchange diffchange-inline&quot;&gt;Die entsprechenden Bits in dem Register werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen ungewöhnlichen Effekt: Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt. Von Hand setzen kann man die Bits in der Regel gar nicht.&lt;/ins&gt;&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;&amp;#160;&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;noch schlechter &lt;/ins&gt;CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wie oben gezeigt&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nur R16 &lt;/ins&gt;und das &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Status &lt;/ins&gt;Register &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;bleiben unverändert&lt;/ins&gt;. Für die normalen Register ist das in der Regel kein Problem&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Aber &lt;/ins&gt;bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 geschrieben wird &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;und eine 1 Schreiben bedeutet hier halt gerade Bit löschen&lt;/ins&gt;. &amp;#160;&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;&amp;#160;&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;Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wirklich nur das eine Bit geschrieben wird&lt;/ins&gt;. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;löschen &lt;/ins&gt;einzelner Bits hat das Register ja schon von sich aus&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&amp;#160; Es gibt also gar keinen Grund die Befehle SBI oder CBI für die Interrupt-Flags zu benutzen&lt;/ins&gt;.&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;==Unterprogramme==&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;==Unterprogramme==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17588&amp;oldid=prev</id>
		<title>Besserwessi: /* begrenzte Reichweite von IN / OUT */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17588&amp;oldid=prev"/>
				<updated>2011-07-22T13:51:19Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;begrenzte Reichweite von IN / OUT&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 22. Juli 2011, 13:51 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1205&quot; &gt;Zeile 1.205:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.205:&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;=== begrenzte Reichweite von IN / OUT ===&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;=== begrenzte Reichweite von IN / OUT ===&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;Viele neuere µCs wie Mega88 oder Mega644 haben mehr als 64-IO Register. Damit sind nicht mehr alle SFRs über die Befehle IN und OUT zu erreichen, sondern müssen wie das RAM über LDS&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, &lt;/del&gt;STS &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;oder ähnlich &lt;/del&gt;angesprochen werden. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;Selbst in den Datenblättern finden sich fehlerhafte Beispiele (z.B. für die USART0), die dies nicht berücksichtigen. Das sind aber kleine Fehler, die der Compiler / Assembler erkennt und die leicht zu berichtigen sind.&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Für das Ansprechen der Peripherie-Geräte und PORTs gibt es die Befehle IN und OUT. Diese sind ganz ähnlich den Befehlen LDS bzw. STS. Bei IN und OUT gehen die erlaubten Adresse nur bis 63 und damit man damit etwas weiter kommt wird noch 32 dazu addiert. Ein &lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt; IN Register, ioadr&lt;/ins&gt;&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;&amp;#160;&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 class=&quot;diffchange diffchange-inline&quot;&gt;entspricht also einem&lt;/ins&gt;&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 class=&quot;diffchange diffchange-inline&quot;&gt; LDS Register, ioadr+32&lt;/ins&gt;&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;&amp;#160;&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 class=&quot;diffchange diffchange-inline&quot;&gt;Durch die relativ lange Adresse, von immerhin 16 Bits (auch wenn die selten alle wirklich gebraucht werden) ist der Befehl LDS doppelt so lang und braucht auch doppelt so lange wie die kurze Form IN. &lt;/ins&gt;&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;&amp;#160;&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 class=&quot;diffchange diffchange-inline&quot;&gt;Bei den älteren µCs wie Mega8 oder Mega32 reichten die Befehle IN und OUT gerade aus um alle SFRs zu erreichen. &lt;/ins&gt;Viele neuere µCs wie Mega88 oder Mega644 haben mehr als 64-IO Register. Damit sind nicht mehr alle SFRs über die Befehle IN und OUT zu erreichen, sondern müssen wie das RAM über LDS &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;bzw. &lt;/ins&gt;STS angesprochen werden.&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;&amp;#160;&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;Selbst in den Datenblättern finden sich &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ein paar &lt;/ins&gt;fehlerhafte Beispiele (z.B. für die USART0), die dies nicht berücksichtigen. Das sind aber kleine Fehler, die der Compiler / Assembler erkennt und die leicht zu berichtigen sind.&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;=== SBI/CBI bei Interrupt-Flags ===&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;=== SBI/CBI bei Interrupt-Flags ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17587&amp;oldid=prev</id>
		<title>Besserwessi: /* SBI/CBI bei Interrupt-Flags */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17587&amp;oldid=prev"/>
				<updated>2011-07-21T21:39:18Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;SBI/CBI bei Interrupt-Flags&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 21. Juli 2011, 21:39 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1208&quot; &gt;Zeile 1.208:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.208:&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;=== SBI/CBI bei Interrupt-Flags ===&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;=== SBI/CBI bei Interrupt-Flags ===&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;Bei den Interrupt-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Falgs &lt;/del&gt;ist besondere Vorsicht mit den Befehlen CBI und SBI zum setzen bzw. Löschen einzelner Bits geboten. Da kommen sogar gleich 2 Tücken zusammen. Zum einen verhalten sich diese IO Register beim schreiben ungewöhnlich. Die entsprechenden Bits in dem Register werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Ungewöhnlichen &lt;/del&gt;Effekt. Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. Von Hand setzen kann man die Bits in der Regel gar nicht&lt;/del&gt;. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt.&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;Bei den Interrupt-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Flags &lt;/ins&gt;ist besondere Vorsicht mit den Befehlen CBI und SBI zum setzen bzw. Löschen einzelner Bits geboten. Da kommen sogar gleich 2 Tücken zusammen. Zum einen verhalten sich diese IO Register beim schreiben ungewöhnlich. Die entsprechenden Bits in dem Register werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ungewöhnlichen &lt;/ins&gt;Effekt. Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Von Hand setzen kann man die Bits in der Regel gar nicht&lt;/ins&gt;.&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt dass die CPU das ganze Register ausliest, dann das gewünschte Bit setzt und schließlich das ganze Register zurück schreibt - ganz so wie man es sonst auch zu Fuß machen würde, nur halt in einem Befehl. Für die normalen Register ist das in der Regel kein Problem, aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 zurück geschrieben wird. Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das es geht. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum verändern einzelner Bits hat das Register ja schon von sich aus.&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt dass die CPU das ganze Register ausliest, dann das gewünschte Bit setzt und schließlich das ganze Register zurück schreibt - ganz so wie man es sonst auch zu Fuß machen würde, nur halt in einem Befehl. Für die normalen Register ist das in der Regel kein Problem, aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 zurück geschrieben wird. Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das es geht. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum verändern einzelner Bits hat das Register ja schon von sich aus.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17586&amp;oldid=prev</id>
		<title>Besserwessi: /* INC/DEC */  2 neue Tücken</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17586&amp;oldid=prev"/>
				<updated>2011-07-21T21:30:16Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;INC/DEC: &lt;/span&gt;  2 neue Tücken&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 21. Juli 2011, 21:30 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1203&quot; &gt;Zeile 1.203:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.203:&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;'''Bleibt eigentlich nur R24:R25 für solche 16-Bit Befehle'''&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;'''Bleibt eigentlich nur R24:R25 für solche 16-Bit Befehle'''&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;&lt;/ins&gt;&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;=== begrenzte Reichweite von IN / OUT ===&lt;/ins&gt;&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;Viele neuere µCs wie Mega88 oder Mega644 haben mehr als 64-IO Register. Damit sind nicht mehr alle SFRs über die Befehle IN und OUT zu erreichen, sondern müssen wie das RAM über LDS, STS oder ähnlich angesprochen werden.&amp;#160; Selbst in den Datenblättern finden sich fehlerhafte Beispiele (z.B. für die USART0), die dies nicht berücksichtigen. Das sind aber kleine Fehler, die der Compiler / Assembler erkennt und die leicht zu berichtigen sind.&lt;/ins&gt;&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;&lt;/ins&gt;&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;=== SBI/CBI bei Interrupt-Flags ===&lt;/ins&gt;&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;Bei den Interrupt-Falgs ist besondere Vorsicht mit den Befehlen CBI und SBI zum setzen bzw. Löschen einzelner Bits geboten. Da kommen sogar gleich 2 Tücken zusammen. Zum einen verhalten sich diese IO Register beim schreiben ungewöhnlich. Die entsprechenden Bits in dem Register werden von der Hardware auf 1 gesetzt wenn ein Interrupt ausgelöst werden könnte, z.B. bei einem Timer Überlauf. Das schreiben in diese IO-Register hat einen Ungewöhnlichen Effekt. Die Bits wo man eine 1 hinschreibt werden gelöscht, und bei einer 0 passiert einfach nichts. Von Hand setzen kann man die Bits in der Regel gar nicht. Dadurch ist es möglich gezielt ausgewählte Bits zu löschen, unabhängig davon was die Hardware gleichzeitig mit den anderen Bits anstellt.&lt;/ins&gt;&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;&lt;/ins&gt;&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;Die eigentliche Tücke kommt, wenn man bei einem etwas älteren µC jetzt auf die Idee kommt dazu den Befehl SBI (oder ggf. CBI) zu nutzen.&amp;#160; Intern wird da der Befehl SBI so umgesetzt dass die CPU das ganze Register ausliest, dann das gewünschte Bit setzt und schließlich das ganze Register zurück schreibt - ganz so wie man es sonst auch zu Fuß machen würde, nur halt in einem Befehl. Für die normalen Register ist das in der Regel kein Problem, aber bei den speziellen Registern mit den Interrupt-Flags werden so alle Flags gelöscht, weil genau für die gesetzten Flags eine 1 zurück geschrieben wird. Bei einigen (neueren) µCs wurde das Verhalten des SBI Befehls geändert, so das es geht. Trotzdem geht das Löschen eines Interrupt Flags besser und schneller über den Befehl OUT. Die spezielle Logik zum verändern einzelner Bits hat das Register ja schon von sich aus.&lt;/ins&gt;&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;==Unterprogramme==&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;==Unterprogramme==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17585&amp;oldid=prev</id>
		<title>Besserwessi: /* Beispiel Timer */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=Assembler_Einf%C3%BChrung_f%C3%BCr_Bascom-User&amp;diff=17585&amp;oldid=prev"/>
				<updated>2011-07-21T20:25:41Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Beispiel Timer&lt;/span&gt;&lt;/span&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;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 21. Juli 2011, 20:25 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1339&quot; &gt;Zeile 1.339:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1.339:&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;Die hier verwendeten Werte von &amp;quot;64&amp;quot; für den Prescaler und die &amp;quot;131&amp;quot; für den Counter sind aus der Angabe &amp;quot;$crystal = 8000000&amp;quot; berechnet worden und ergeben Interrupts im Abstand von 1 mS.&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;Die hier verwendeten Werte von &amp;quot;64&amp;quot; für den Prescaler und die &amp;quot;131&amp;quot; für den Counter sind aus der Angabe &amp;quot;$crystal = 8000000&amp;quot; berechnet worden und ergeben Interrupts im Abstand von 1 mS.&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;−&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;Gerade bei einer ISR bietet es sich an die ganze ISR in ASM zu schreiben, denn BASCOM rettet für die ISR fast alle Register ([[Bascom_Debounce_ISR_in_Assembler#Warum_eine_ISR_in_Assembler_programmieren.3F|Details]]).&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;Gerade bei einer ISR bietet es sich an die ganze ISR in ASM zu schreiben, denn BASCOM rettet für die ISR fast alle Register ([[Bascom_Debounce_ISR_in_Assembler#Warum_eine_ISR_in_Assembler_programmieren.3F|Details]])&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Die ISR ganz in ASM ist entsprechend ein Beispiel wo der ASM Code deutlich schneller und kürzer werden kann als der Code vom Compiler&lt;/ins&gt;.&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;==Autor==&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;==Autor==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	</feed>