{"id":5426,"date":"2014-03-30T21:53:16","date_gmt":"2014-03-30T21:53:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/assembly-program-to-stop-stopwatch-counter-if-a-key-is-pressed-and-show-the-stopwatch-count-collection-of-common-programming-errors\/"},"modified":"2014-03-30T21:53:16","modified_gmt":"2014-03-30T21:53:16","slug":"assembly-program-to-stop-stopwatch-counter-if-a-key-is-pressed-and-show-the-stopwatch-count-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/assembly-program-to-stop-stopwatch-counter-if-a-key-is-pressed-and-show-the-stopwatch-count-collection-of-common-programming-errors\/","title":{"rendered":"Assembly program to stop stopwatch counter if a key is pressed and show the stopwatch count-Collection of common programming errors"},"content":{"rendered":"<p>It a shame you can&#8217;t post your code, but I presume that you&#8217;re using some kind of loop for updating the stopwatch and thus have some kind of code like;<\/p>\n<pre><code>loop:\n\"update stopwatch\"\nJMP loop\n<\/code><\/pre>\n<p>and you what to quit the loop when &#8216;s&#8217; is pressed. If that is the case you can query the keyboard status to see if the key is pressed.<\/p>\n<pre><code>loop:\n\"update stopwatch\"\nMOV AH, 0x01\nINT 0x16\nJZ loop     ; ZF is set if there is no key in buffer\nMOV AH, 0x00\nINT 0x16    ; Get ASCII code from buffer\nCMP AL, \"s\"\nJNE loop\n<\/code><\/pre>\n<p>Probably not the most elegant way, but it should work.<\/p>\n<p>I hope this answers your question.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It a shame you can&#8217;t post your code, but I presume that you&#8217;re using some kind of loop for updating the stopwatch and thus have some kind of code like; loop: &#8220;update stopwatch&#8221; JMP loop and you what to quit the loop when &#8216;s&#8217; is pressed. If that is the case you can query the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5426","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5426"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5426\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}