<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5913854448534801152</id><updated>2025-06-01T06:49:21.932+05:30</updated><category term="8085 Programs"/><category term="8085Architecture"/><title type='text'>Learn 8085</title><subtitle type='html'>This blog is dedicated to impart programming knowledge about Intel&#39;s 8085 micro-processor.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-3203343113915606341</id><published>2012-01-15T22:17:00.000+05:30</published><updated>2012-01-15T22:17:00.485+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>How to ADD two 16 Bit Number</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Suppose we have to add two HEX numbers viz:&lt;div&gt;
4351 &amp;amp; 3211.&lt;/div&gt;
&lt;div&gt;
First take the LSB of two number and &lt;b&gt;ADD&lt;/b&gt; them. Then take the MSB of thw numbers and add them with &lt;b&gt;CARRY&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;CODE:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;MVI A,51H&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;MVI B,11H&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;ADD B&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;STA 5000H&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;MVI A,43H&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;MVI B,32H&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;ADC B&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;STA 5002H&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;HLT&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
When this program will be executed then &lt;b&gt;LSB&lt;/b&gt;&amp;nbsp;will be saved at location&lt;b&gt; 5000H&lt;/b&gt; and &lt;b&gt;MSB&lt;/b&gt; will be saved at &lt;b&gt;5002H&lt;/b&gt; location&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/3203343113915606341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2012/01/how-to-add-two-16-bit-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/3203343113915606341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/3203343113915606341'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2012/01/how-to-add-two-16-bit-number.html' title='How to ADD two 16 Bit Number'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-8905219699289578697</id><published>2011-10-15T02:07:00.002+05:30</published><updated>2011-10-15T02:20:00.351+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>To find factorial of a number.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To find factorial of a number we can use the same procedure as in C++ programming.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;CODE:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MVI B,05&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MOV C, B&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;DCR C&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;LABEL2: MOV E, C&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;SUB A&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;LABEL1: ADD B&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;DCR E&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;JNZ LABEL1&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MOV B, A&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;DCR C&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;JNZ LABEL2&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;STA 00H&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;HLT&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Screen Shot:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVzFJ_AVAA0GEEWc0ZVFSq7FWOOuMxYC3e4enrDSZfvjqZ1xhOTgzs6yWtdohTP6mM2kdvWhBzJ6wahkFrvBZeGM1JqIYxEU8AKUXbC2UUG06Sy0Sj_3VdCZibA02RawJDsZ0p1d8kXN5w/s1600/Screenshot+at+2011-10-15+02%253A04%253A36.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;346&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVzFJ_AVAA0GEEWc0ZVFSq7FWOOuMxYC3e4enrDSZfvjqZ1xhOTgzs6yWtdohTP6mM2kdvWhBzJ6wahkFrvBZeGM1JqIYxEU8AKUXbC2UUG06Sy0Sj_3VdCZibA02RawJDsZ0p1d8kXN5w/s640/Screenshot+at+2011-10-15+02%253A04%253A36.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/8905219699289578697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/10/to-find-factorial-of-number.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/8905219699289578697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/8905219699289578697'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/10/to-find-factorial-of-number.html' title='To find factorial of a number.'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVzFJ_AVAA0GEEWc0ZVFSq7FWOOuMxYC3e4enrDSZfvjqZ1xhOTgzs6yWtdohTP6mM2kdvWhBzJ6wahkFrvBZeGM1JqIYxEU8AKUXbC2UUG06Sy0Sj_3VdCZibA02RawJDsZ0p1d8kXN5w/s72-c/Screenshot+at+2011-10-15+02%253A04%253A36.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-8109875425622765782</id><published>2011-10-15T00:25:00.000+05:30</published><updated>2011-10-15T02:21:06.537+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>To multiply two numbers.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To multiply two numbers we can use multiple addition of that number up to the second number.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CODE:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MVI D,3&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MVI B,2&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MVI A,00&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;LABEL: ADD D&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;DCR B&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;JNZ LABEL&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;HLT&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Screen Shot:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OOhtcNDqREAS62cEuos1z9Bi7yxT85BDr-12FwKV_f__B38VkmvgH19qXEvbcLeoHT0y4N5Jt0oG_iLZ_dh1P5Rj-9D6IFK8daY1e6MrCIN8yqnI1kT512OfGaJEy_AokTPkRzkLncZ-/s1600/Screenshot+at+2011-10-15+00%253A23%253A09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;346&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OOhtcNDqREAS62cEuos1z9Bi7yxT85BDr-12FwKV_f__B38VkmvgH19qXEvbcLeoHT0y4N5Jt0oG_iLZ_dh1P5Rj-9D6IFK8daY1e6MrCIN8yqnI1kT512OfGaJEy_AokTPkRzkLncZ-/s640/Screenshot+at+2011-10-15+00%253A23%253A09.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/8109875425622765782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/10/to-multiply-two-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/8109875425622765782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/8109875425622765782'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/10/to-multiply-two-numbers.html' title='To multiply two numbers.'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OOhtcNDqREAS62cEuos1z9Bi7yxT85BDr-12FwKV_f__B38VkmvgH19qXEvbcLeoHT0y4N5Jt0oG_iLZ_dh1P5Rj-9D6IFK8daY1e6MrCIN8yqnI1kT512OfGaJEy_AokTPkRzkLncZ-/s72-c/Screenshot+at+2011-10-15+00%253A23%253A09.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-3521218069495047208</id><published>2011-10-14T02:33:00.002+05:30</published><updated>2011-10-15T02:21:52.711+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>How to add two numbers without using ADD command?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To add two numbers without using ADD command first we need to understand the basics of addition. The basic of addition is that we increment the first number by 1 upto second number to reach the answer of their additon. The same procedure will be followed here in this program&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CODE&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MVI A,08&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;MVI B,54&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;LABEL: INR A&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;DCR B&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;JNZ LABEL&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;HLT&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Screen shot of the program ran in simulator is here:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWGpZQCertGlEhiJ6CHLcs_8QGCiBcLhmVODQJ2lcaUy0i5HSnVhUQ4DU5q5DNqURIuN9irEECU481UI80agEjB0IZNKgvztFHVf1FlbGQNuA_l0RomguMAQSNcie9omj7f4cPvDXwyY0b/s1600/Screenshot+at+2011-10-14+02%253A37%253A57.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;546&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWGpZQCertGlEhiJ6CHLcs_8QGCiBcLhmVODQJ2lcaUy0i5HSnVhUQ4DU5q5DNqURIuN9irEECU481UI80agEjB0IZNKgvztFHVf1FlbGQNuA_l0RomguMAQSNcie9omj7f4cPvDXwyY0b/s640/Screenshot+at+2011-10-14+02%253A37%253A57.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/3521218069495047208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/10/how-to-add-two-numbers-without-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/3521218069495047208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/3521218069495047208'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/10/how-to-add-two-numbers-without-using.html' title='How to add two numbers without using ADD command?'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWGpZQCertGlEhiJ6CHLcs_8QGCiBcLhmVODQJ2lcaUy0i5HSnVhUQ4DU5q5DNqURIuN9irEECU481UI80agEjB0IZNKgvztFHVf1FlbGQNuA_l0RomguMAQSNcie9omj7f4cPvDXwyY0b/s72-c/Screenshot+at+2011-10-14+02%253A37%253A57.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-6648514797465318332</id><published>2011-10-10T01:13:00.000+05:30</published><updated>2011-10-10T01:13:32.359+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085Architecture"/><title type='text'>8085 Architecture</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJFtLutNl14LQSTzuyfiEQGsARJ_IWd71N0eQpPGmXUzzvsc5KgyZrrYVZLTJSC5VC1aEUgHL42AIntVpiHPzBplUHogQs3_0bYQKqskRiXtK-V0BPjlPjtLWM-1xYpCtqhZObVMB5Ocj-/s1600/8085.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJFtLutNl14LQSTzuyfiEQGsARJ_IWd71N0eQpPGmXUzzvsc5KgyZrrYVZLTJSC5VC1aEUgHL42AIntVpiHPzBplUHogQs3_0bYQKqskRiXtK-V0BPjlPjtLWM-1xYpCtqhZObVMB5Ocj-/s320/8085.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/6648514797465318332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/10/8085-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/6648514797465318332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/6648514797465318332'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/10/8085-architecture.html' title='8085 Architecture'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJFtLutNl14LQSTzuyfiEQGsARJ_IWd71N0eQpPGmXUzzvsc5KgyZrrYVZLTJSC5VC1aEUgHL42AIntVpiHPzBplUHogQs3_0bYQKqskRiXtK-V0BPjlPjtLWM-1xYpCtqhZObVMB5Ocj-/s72-c/8085.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-8384419527480824101</id><published>2011-10-10T01:10:00.001+05:30</published><updated>2011-10-10T01:51:44.204+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>How to count number of 1&#39;s in a byte?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To count the number of 1&#39;s in a byte[8 bits] the technique is as follows:-&lt;br /&gt;
We use RAR instruction to rotate the D0 bit via CARRY flag and check the status of carry flag for 1. And we count the number of times the CARRY flag is set[ie equal to 1].&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code-&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MVI A,FFH&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Load A with Immediate data as FF&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MVI B,08&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Initialize B with 08 for counting&lt;br /&gt;
&lt;b&gt;&amp;nbsp;LABEL2: RAR&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Rotate Right through CARRY&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JC LABEL1&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Check for CARRY flag&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DCR B&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Decrement counter&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JNZ LABEL2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;; Check for number of counting&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LABEL1: INR C&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Increment C for number of 1&#39;s&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DCR B&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JNZ LABEL2&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HLT&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/8384419527480824101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/10/how-to-count-number-of-1s-in-byte.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/8384419527480824101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/8384419527480824101'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/10/how-to-count-number-of-1s-in-byte.html' title='How to count number of 1&#39;s in a byte?'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-6924940439762255842</id><published>2011-10-03T18:15:00.001+05:30</published><updated>2011-10-10T01:15:37.856+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>Table of 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;In this program the starting address is taken as 2001H.&lt;br /&gt;
The table of 2 {2,4,6,8,.......,20} would be saved in memory location starting from 2001H location.&lt;br /&gt;
&lt;b&gt;&lt;u&gt;CODE:&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LXI H,2001H&lt;/b&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Make H/L pair as pointer to location 2001H&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MVI A,00H &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;&amp;nbsp;;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MVI &amp;nbsp;B,10&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Taking Register B as a counter for table&lt;br /&gt;
&lt;b&gt;LABEL: ADI 02&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Add 02 as immediate value toRregister A&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOV M,A&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Save value of Register A to memory location pointed by H&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INX H&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Increment the address pointed by Register H&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DCR B&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Decrement the B&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JNZ LABEL&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Check for ZERO &amp;nbsp;and Jump to LABEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/6924940439762255842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/10/table-of-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/6924940439762255842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/6924940439762255842'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/10/table-of-2.html' title='Table of 2'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5913854448534801152.post-7730201581455199050</id><published>2011-09-25T07:39:00.002+05:30</published><updated>2011-10-10T01:15:21.322+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8085 Programs"/><title type='text'>How to exchange the content of two memory location.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;boldtimes&quot; style=&quot;line-height: 12.0pt; margin-bottom: 1.0pt; margin-left: 0in; margin-right: 0in; margin-top: 1.0pt;&quot;&gt;&lt;span lang=&quot;EN-GB&quot;&gt;1. &lt;u&gt;&lt;b&gt;Using XCHG operation&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;boldtimes&quot; style=&quot;line-height: 12.0pt; margin-bottom: 1.0pt; margin-left: 0in; margin-right: 0in; margin-top: 1.0pt;&quot;&gt;&lt;span lang=&quot;EN-GB&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;boldtimes&quot; style=&quot;line-height: 12.0pt; margin-bottom: 1.0pt; margin-left: 0in; margin-right: 0in; margin-top: 1.0pt;&quot;&gt;Instruction &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Comment&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;LXI &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H, D000 H &lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;; HL pointing to D000 H&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;LXI &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D, D001 H&lt;/b&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; DE pointing to D001 H&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;MOV &amp;nbsp;&amp;nbsp; B, M &lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; B&amp;nbsp; (HL) (first byte)&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;LDAX&amp;nbsp;&amp;nbsp;&amp;nbsp; D &lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Load second byte in ACC.&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;XCHG &lt;/b&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;; Exchange DE and HL pair contents.&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;MOV &amp;nbsp;&amp;nbsp; M, B &lt;/b&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Store first byte in second location&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;STAX&amp;nbsp;&amp;nbsp;&amp;nbsp; D &lt;/b&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Store second byte in first location.&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;HLT &lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Stop&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;u&gt;&lt;b&gt;Foot note:&lt;/b&gt;&amp;nbsp;&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;i&gt;&lt;u&gt;The XCHG memonic can only be used for exchanging contents of DE and HL pair. So for exchanging the contents of any two memory location its better to make DE and HL as memory pointer.&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;i&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;i&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;i&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;2. Without using XCHG operation.&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;Instruction &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Comment&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;LXI H,D000H &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;; HL pointing to D000H&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;LXI B,D001H &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;; BC pointing to D001H&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;MOV D,M&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Move the contents of M to D&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;LDAX B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;; Move the contents of BC to Accumulator&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;MOV M,A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;;&lt;b&gt;&amp;nbsp;&lt;/b&gt;Move the contents of &amp;nbsp;BC to HL&lt;b&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;STAX D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Move the contents of HL to BC&lt;/div&gt;&lt;div class=&quot;prog&quot; style=&quot;margin-left: 1.4pt; tab-stops: 32.2pt 56.7pt 146.3pt;&quot;&gt;&lt;b&gt;HLT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Stop&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i8085.blogspot.com/feeds/7730201581455199050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i8085.blogspot.com/2011/09/how-to-exchange-content-of-two-memory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/7730201581455199050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5913854448534801152/posts/default/7730201581455199050'/><link rel='alternate' type='text/html' href='http://i8085.blogspot.com/2011/09/how-to-exchange-content-of-two-memory.html' title='How to exchange the content of two memory location.'/><author><name>Priyatam</name><uri>http://www.blogger.com/profile/10525108239438367510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>