<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>7 Segment count display on interrupt two pins when high.</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/35864/7-segment-count-display-on-interrupt-two-pins-when-high</link><description> 
I am facing problem when programming 89c51 using assembly
language.According to following code controller counts only 4.please
help me to correct the code when both the pins (P1.0 and P1.1)are
high then pin (P1.7)should be high to count. 

 
ORG 0 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: 7 Segment count display on interrupt two pins when high.</title><link>https://community.arm.com/thread/93852?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2016 15:03:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:df5179ee-72a2-47e2-b0cf-4f96c380f40c</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;you are supposed to read through your own code and try to
understand it.&lt;/i&gt;&lt;br /&gt;
which would be easier with labels less cryptic and a few comments
would not hurt&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7 Segment count display on interrupt two pins when high.</title><link>https://community.arm.com/thread/69722?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2016 14:25:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e10f6e51-3e99-48c3-b3d8-278a2eb6551d</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
I think you forgot one thing - you are supposed to read through
your own code and try to understand it. Every line of it.&lt;/p&gt;

&lt;p&gt;
Interesting here:&lt;br /&gt;
Your comparisons:&lt;/p&gt;

&lt;pre&gt;
#1
#2
#3
#4
#4 &amp;lt;= again???
#5
#6
#7
#8
#9
&lt;/pre&gt;

&lt;p&gt;
Another interesting thing - your output patterns:&lt;/p&gt;

&lt;pre&gt;
#00000001B ;1
#00000010B ;2
#00000010B ;3 &amp;lt;= wanna bet???
#00000100B ;4
#00000101B ;5
#00000110B ;6
#00000111B ;7
#00001000B ;8
#00001001B ;9
#00000000B ;0
&lt;/pre&gt;

&lt;p&gt;
How fast is this counter expected to tick? As fast as it can?&lt;/p&gt;

&lt;p&gt;
And what is the actual intention with the output pin?&lt;/p&gt;

&lt;p&gt;
If you think the assembler understands numbers both as decimal and
binary constants - why are you using binary constants that you need
to &amp;quot;explain&amp;quot; with a decimal value directly after?&lt;/p&gt;

&lt;p&gt;
Do you think compilers and assemblers got support for software
comments just so that a developer could add information about the
intentions and meanings of variables, I/O pins etc? Or is software
comments just so that we can add a copyright message just before we
hand in our assignments? Your only use of comments is to insert
(sometimes incorrect) translations from binary to decimal.&lt;/p&gt;

&lt;p&gt;
Next thing - before your loop you clear A. Then your code only
increments A. And your code assumes that if A isn&amp;#39;t 1, 2, 3, 4, 5, 6,
7, 8, 9 then your display should continue to display the previous
value. Extra interesting since A=1 should display1. While A=9 should
not display 9 but 0... But further - is A really limited to the
numeric range 0..9? What is the expected display output if you have
let A increment to 47? Or 59? Or 243? Or 255? Did you really intend
that A should continut to tick 253 -&amp;gt; 254 -&amp;gt; 255 -&amp;gt; 0 just
to return back to the 10 numeric values your counter most probably
was intended to understands?&lt;/p&gt;

&lt;p&gt;
Wouldn&amp;#39;t you think it&amp;#39;s a good idea if you actually debug your
code - stepping through the full intended range of your variables,
and stepping through all specific values that are expected to match
explicit tests - before you post? Code coverage is how to test code
so you attempt to test true/false for every single comparison.
Off-by-one errors are expected to be hunted by testing the actual end
ranges to make sure that the first and last value really will be the
first and last values - and will produce the expected result.&lt;/p&gt;

&lt;p&gt;
A forum can&amp;#39;t remove the need for &lt;i&gt;&lt;b&gt;you&lt;/b&gt;&lt;/i&gt; to invest own
time.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>