{"id":14233,"date":"2022-11-05T19:48:26","date_gmt":"2022-11-05T19:48:26","guid":{"rendered":"https:\/\/bryceautomation.com\/?p=14233"},"modified":"2022-11-05T19:48:30","modified_gmt":"2022-11-05T19:48:30","slug":"cosmac-1802-subtract-instructions","status":"publish","type":"post","link":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/","title":{"rendered":"COSMAC 1802 Subtract Instructions"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction to COSMAC 1802 Subtract Instructions<\/h2>\n\n\n\n<p>COSMAC 1802 Subtract Instructions will subtract the accumulator (D Register) from an immediate value, or a memory location (or vice-versa)  In this post, we&#8217;ll go over each of these instructions, and how you would use them in your logic.  There are eight subtract instructions in the COSMAC:<\/p><div id=\"bryce-4262464456\" class=\"bryce-afterfirst bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"7728240895\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SD &#8212; Subtracts D from a memory location contained in a register that X desginator. (Memory &#8211; D)<\/li>\n\n\n\n<li>SDI &#8212; Subtract D from an immediate value (following the instruction) (Value &#8211; D)<\/li>\n\n\n\n<li>SDB &#8212; Subtract with borrow.  Just like SD, but also subtracts the NOT of the data flag bit (DF). (Memory &#8211; D &#8211; (NOT DF))<\/li>\n\n\n\n<li>SDBI &#8212; Subtract with borrow (immediate).  Just like SDI, but also subtracts the NOT of DF. (Value &#8211; D &#8211; (NOT DF))<\/li>\n\n\n\n<li>SM &#8212; Subtracts memory from D  (Memory &#8211; D)  <\/li>\n\n\n\n<li>SMI &#8212; Same as SDI, but the operands are opposite.  (D &#8211; Value)<\/li>\n\n\n\n<li>SMB &#8212; Subtracts memory from D with borrow.  Just like SDB, but again, we flip the operands.  (D &#8211; Memory &#8211; (NOT DF).  The memory location we get data from is contained in the register that X designates.<\/li>\n\n\n\n<li>SMBI &#8212; Subtracts an immediate value from D, and also subtracts the NOT of DF.  (D &#8211; Value &#8211; (NOT DF)<\/li>\n<\/ul>\n\n\n\n<p>It&#8217;s important to realize that after a subtract, if DF is true, then a borrow did not occur.  In other words, when DF is true, the result is positive.<\/p>\n\n\n\n<p>In this post, I&#8217;ll be using the <a href=\"https:\/\/bryceautomation.com\/index.php\/2022\/10\/22\/a18-assembler-for-cosmac\/\">A18 Assembler.<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"769\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract-1024x769.png\" alt=\"COSMAC 1802 Subtract Instructions\" class=\"wp-image-14251 lazyload\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract-1024x769.png 1024w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract-300x225.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract-768x576.png 768w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png 1263w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/769;\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">SD &#8211; COSMAC 1802 Subtract Instructions (Accumulator)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">SD (Subtract D) Instruction<\/h3>\n\n\n\n<p>Let&#8217;s start with the SD instruction.  Remember that SD will subtract D from a memory location.  Remember, D is the accumulator in the 1802.  The memory location that contains the data is in a register that the X designator points to.  In the example below, we will load 8200H into the RF register.  8200H is the memory location that we want to subtract from.  Our logic places 55H into this memory location.<\/p>\n\n\n\n<p>At this point, we set the X designator to Register 15 (which is RF).   After that, we load a 1 into the accumulator, and execute the SD command.  The processor subtracts D from the data at memory location 8200H.  As a result, we get a value of 54H.  Finally, we&#8217;ll store the result to the accumulator.  Then we will branch to the break routine that is in my ROM.    If you don&#8217;t have a break routine in your ROM, just idle the processor with the IDL command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MYMEMORY:   EQU     8200H \nBREAK:      EQU     2756H\nRF          EQU     15\n\n            ORG     8000H\n          \n            LOAD    RF, MYMEMORY  ; Load RF with 8200H\n            LDI     55H           ; Place 55H into the accumulator\n            STR     RF            ; then store the value of 55H to 8200H.\n            SEX     RF            ; Designate RF in the X register.\n            LDI     01H           ; Load 01H to the accumulator\n            SD                    ; Subtract D from 8200H (55H - 01H)\n            STR     RF            ; Store the new result back to 8200H\n            LBR     BREAK         ; Stop the program\n            END\n<\/code><\/pre>\n\n\n\n<p>Take a look at the data at 8200H.  You will see it is now 54H.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SDI (Subtract D from Immediate) Instruction<\/h3>\n\n\n\n<p>The SDI instruction subtracts the value of D from an immediate value.  In other words, if the immediate value is larger than D, then the result will be positive.  Let&#8217;s take a look at an example, so we can see how the SDI command operates.<\/p>\n\n\n\n<p>I believe there might be a small error in the COSMAC manual for this instruction..  (At least the one I&#8217;m looking at).   It operates off an immediate value, and not by a memory location indirectly specified by X as the formula states.  Let&#8217;s take a look at some logic to verify it&#8217;s operation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MYMEMORY:   EQU     8200H \nBREAK:      EQU     2756H\nRF          EQU     15\n\n            ORG     8000H\n            LOAD    RF, MYMEMORY\n          \n            LDI     02H  ; Load Accumulator with 02H\n            SDI     55H  ; Subtract the Accumulator from 55H.\n            STR     RF   ; Store the result to address 8200H\n            LBR     BREAK\n            END\n<\/code><\/pre>\n\n\n\n<p>Take a look at address 8200H.  You will see the value is 53H.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SDB (Subtract D With Borrow) Instruction<\/h3>\n\n\n\n<p>When dealing with values larger than 8 bits, we will need to work with multiple bytes.  Let&#8217;s consider 8200 to be our low byte, and 8201 is the high byte containing a value.  We need to do our math on each byte at a time.  First, we&#8217;ll perform a subtraction on the low byte.  After that, we&#8217;ll do our subtraction with the high byte.  Let&#8217;s say the low byte contains 00H, and the high byte contains 01H.  Therefore, our starting value is 0100H.  We will subtract 0001H from this value.  <\/p>\n\n\n\n<p>If we subtract 1 from the low byte (with SD), then we will have a borrow condition.  Our DF (Data Flag) bit will equal 0.  This is because the low byte went negative, and rolled over to FF.  When we perform our math on the high byte, we need to consider this borrow condition from the low byte.   With the SDB command we will subtract zero from the high byte, which contains 01H, and we also subtract the NOT (compliment) of the DF flag.  Therefore 01H &#8211; 00H &#8211;  (NOT DF) = 00H.  Let&#8217;s outline this below:<\/p>\n\n\n\n<p>16 bit source:    0100H<\/p>\n\n\n\n<p>we will subtract 0001H<\/p>\n\n\n\n<p>Look at the low byte first (right-most two digits)&#8230;  This will be 00H &#8211; 01H = FFH due to rollover, and DF goes to zero.<\/p>\n\n\n\n<p>Look at the high byte next (left-most two digits)&#8230;   This will be 01H &#8211; 00H &#8211; ((NOT DF) (which is 1)) = 00H<\/p>\n\n\n\n<p>Therefore our answer will be 00FFH.<\/p>\n\n\n\n<p>Let&#8217;s take a look at the logic:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LOWBYTE:    EQU     8200H \nHIGHBYTE:   EQU     8201H\nBREAK       EQU     2756H\nRE          EQU     14\nRF          EQU     15\n\n            ORG     8000H\n            LOAD    RE, LOWBYTE\n            LOAD    RF, HIGHBYTE\n            \n            LDI     00H\n            STR     RE\n            LDI     01H\n            STR     RF   ; AT THIS POINT 8201 IS 01H, AND 8200 IS 00H (1000H)\n            \n            SEX     RE\n            LDI     01H  \n            SD           ; SUBTRACT 1 FROM LOW BYTE, WE GET FF WITH BORROW (DF=0)\n            STR     RE   ; STORE FFH TO RE\n\n            SEX     RF\n            LDI     00H\n            SDB          ; SUBTRACT 01 - 00 - (NOT DF) = 0  (DF = 0)  \n            STR     RF   ; STORE 00H TO RF.  \n            LBR     BREAK  ; FINAL VALUE OF 8201 AND 8200 IS 00FFH\n            END<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">SDBI (Subtract with borrow &#8212; immediate) &#8212; COSMAC 1802 Subtract Instructions<\/h3>\n\n\n\n<p>The SDBI instruction subtracts D from an immediate value.  It also subtracts the NOT of the borrow bit (DF)  In other words, if DF is high, then it will only subtract D from the immediate value.  On the other hand, if DF is low, then the SDBI subtracts the accumulator (D) from the immediate value, and subtracts one more due to the borrow bit.<\/p>\n\n\n\n<p>We usually use this instruction to subtract integers which are larger than 8 bits.<\/p>\n\n\n\n<p>For example, let&#8217;s say the D register contains (01H)  We want to subtract this from a 16 bit value of (0100H).  When we subtract 1 from 00, we get an FF with borrow clear.  Therefore, when we subtract the high byte with borrow, the high byte will be zero.  (01H &#8211; 00h &#8211; 1)  The value we end up with will span across 2 memory calls, and will be 00FFH.<\/p>\n\n\n\n<p>This is similar to the SDB above, but with an immediate value instead of a register.  Let&#8217;s look at an example:<\/p>\n\n\n\n<p>Now, take a look at addresses 8200H and 8201H.  8201H contains 00, and 8200H contains FF.  Your final number consists of 16 bits &#8212; 00FFH.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SM &#8211; COSMAC 1802 Subtract Instructions (Memory)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">SM (Subtract Memory) Instruction<\/h3>\n\n\n\n<p>The SM instruction is very similar to the SD instruction above.  However, it subtracts memory from the accumulator (D register) instead of the other way around.  The memory location where we get data from is in a register designated by X.    Therefore, we must make sure X has the correct designation.  Here is an example of where we subtract 5H from 9H.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MYMEMORY:   EQU     8200H \nBREAK:      EQU     2756H\nRF          EQU     15\n\n            ORG     8000H\n\n            LOAD    RF, MYMEMORY\n            LDI     05H\n            STR     RF   ; LOAD THE VALUE OF 05H INTO 8200H\n            \n            LDI     09H  ; SET THE ACCUMULATOR TO THE VALUE OF 05H\n            SEX     RF\n            SM\n            STR     RF   ; STORE THE RESULT OF 04H BACK TO 8200H\n            LBR     BREAK\n            END\n            \n            <\/code><\/pre>\n\n\n\n<p>Take a look at memory cell 8200h.  You will see it contains the value of 04H.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SMI (Subtract Memory Immediate) Instruction<\/h3>\n\n\n\n<p>This instruction is fairly simple.  Let&#8217;s say we have a value in the D register such as 08H.  With the SMI instruction, we just specify what value to subtract from the accumulator.  The result goes back into the accumulator, and we can store this somewhere else in memory.  Here is an example where we subtract 5H from 8H:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MYMEMORY:   EQU     8200H \nBREAK:      EQU     2756H\nRF          EQU     15\n\n            ORG     8000H\n\n            LOAD    RF, MYMEMORY\n            LDI     08H\n            SMI     05H\n            STR     RF\n            LBR     BREAK;\n            END<\/code><\/pre>\n\n\n\n<p>Look at cell 8200H.  You will find that the value is 03H.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SMB (Subtract Memory and Borrow) Instruction<\/h3>\n\n\n\n<p>At this point, we&#8217;ll take a look at the SMB instruction.  This instruction will subtract a memory location from the D register.  If DF=0, it will also subtract an additional count.  Again, we usually will use this when we do math on large numbers.  Larger numbers span across more than a single byte.  Here, we&#8217;ll have six bytes, which will effectively be three 16 bit values.  We&#8217;ll subtract value 1 from value 2.  We will place the result into value 3.  Value 1 is 8200H and 8201H.  Similarly, value 2 is at 8202H, and 8203H.  We&#8217;ll place the result into 8204H, and 8205H.  Low bytes first.<\/p>\n\n\n\n<p>Although there are better ways to perform this logic for memory optimization, I&#8217;ll spell  this out in the logic to make it more simple to read.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LOWBYTE1:   EQU     8200H  ; will contain 03H    (VALUE 1 LOW)\nHIGHBYTE1:  EQU     8201H  ; will contain 00H    (VALUE 1 HIGH)\nLOWBYTE2:   EQU     8202H  ; will contain 00H    (VALUE 2 LOW)\nHIGHBYTE2:  EQU     8203H  ; will contain 02H    (VALUE 2 HIGH)\nLOWBYTE3:   EQU     8204H  ; store low byte      (VALUE 3 LOW)\nHIGHBYTE3:  EQU     8205H  ; store high byte     (VALUE 3  HIGH)\nBREAK:      EQU     2756H  ; \n; we'll be subtracting low and high bytes 1 from low and high bytes 2\n; the result will go to low and high bytes 3.\n\nRA          EQU     10\nRB          EQU     11\nRC          EQU     12\nRD          EQU     13\nRE          EQU     14\nRF          EQU     15\n\n            ORG     8000H\n            LOAD    RA, LOWBYTE1\n            LOAD    RB, HIGHBYTE1\n            LOAD    RC, LOWBYTE2\n            LOAD    RD, HIGHBYTE2\n            LOAD    RE, LOWBYTE3\n            LOAD    RF, HIGHBYTE3\n            \n            LDI     03H\n            STR     RA\n            LDI     00H\n            STR     RB\n            LDI     00H\n            STR     RC\n            LDI     02H\n            STR     RD\n            \n            SEX     RA  ; DEALING WITH LOW BYTES FIRST \n            LDN     RC  ; LOAD IN VALUE TO SUBTRACT \n            SM          ; SUBTRACT MEMORY RA POINTS TO FROM D \n            STR     RE  ; STORE THE RESULT TO ADDRESS RE POINTS TO\n            \n            SEX     RB  ; NOW DEALING WITH HIGH BYTES\n            LDN     RD  ; LOAD HIGH BYTE OF VALUE 2 INTO ACCUMULATOR (CONTAINS 02H)\n            SMB         ; SUBTRACT VALUE AT 820AH FROM D (WITH BORROW), SO SUBTRACT AN EXTRA 1.\n            STR     RF  ; STORE THE RESULT OF 01H TO 8204.\n            \n            \n            LBR     BREAK  ; FINAL VALUE OF 8201 AND 8200 IS 01FDH\n            END<\/code><\/pre>\n\n\n\n<p>Test your work.  Cell 8204H should contain FDH.  Likewise, cell 8205H should contain 01H.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SMBI (Subtract Memory with Borrow Immediate) Instruction &#8212; COSMAC 1802 Subtract Instructions<\/h3>\n\n\n\n<p>Finally, we&#8217;ll discuss the last subtract instruction.  The SMBI instruction subtracts a memory location from an immediate value (with borrow).  If the result is less than zero, then we have a borrow condition.  DF will be 0.  This allows us to subtract a memory location from an immediate value on the fly.  Here, we&#8217;ll simply subtract the value of 0007H from 0205H.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LOWBYTE1:   EQU     8200H  ; store the low byte here\nHIGHBYTE1:  EQU     8201H  ; store the high byte here\n\nBREAK:      EQU     2756H  ; \n; we'll be subtracting low and high bytes 1 from low and high bytes 2\n; the result will go to low and high bytes 3.\n\nRA          EQU     10\nRB          EQU     11\n\n            ORG     8000H\n            LOAD    RA, LOWBYTE1\n            LOAD    RB, HIGHBYTE1\n\n            \n            LDI     05H  ;SUBTRACT 7 FROM 5\n            SMI     07H  ;THE RESULT IS FE AND GOES TO D\n            STR     RA   ;STORE FEH\n            \n            LDI     02H  ; SUBTRACT 0 FROM 2 WITH BORROW.  DF1=0\n            SMBI    00H  ; THE RESULT WILL BE 1, AND GOES TO D\n            STR     RB   ; STORE 01H\n            \n            \n            LBR     BREAK  ; FINAL VALUE OF 8201 AND 8200 IS 01FEH\n            END<\/code><\/pre>\n\n\n\n<p>At this point, check 8200, and 8201.  8200 contains the low byte of FEH, and 8201 contains the high byte of 01H.<\/p>\n\n\n\n<p>For more information, please visit the <a href=\"https:\/\/bryceautomation.com\/index.php\/category\/vintage-computers\/cosmac\/\">COSMAC Category Page!<\/a><\/p>\n\n\n\n<p>&#8212; Ricky Bryce<\/p>\n<div id=\"bryce-4105195645\" class=\"bryce-after-content bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"4667596182\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Introduction to COSMAC 1802 Subtract Instructions COSMAC 1802 Subtract Instructions will subtract the accumulator (D Register) from an immediate value, or a memory location (or vice-versa) In this post, we&#8217;ll go over each of these instructions, and how you would use them in your logic. There are eight subtract instructions in the COSMAC: It&#8217;s important <a class=\"moretag btn btn-primary\" href=\"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/\">Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":14251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[821,727],"tags":[853,850,849,854,852,851,856,855],"class_list":{"0":"post-14233","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-cosmac","8":"category-vintage-computers","9":"tag-sd","10":"tag-sdb","11":"tag-sdbi","12":"tag-sdi","13":"tag-sm","14":"tag-smb","15":"tag-smbi","16":"tag-smi","17":"czr-hentry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>COSMAC 1802 Subtract Instructions - Bryce Automation<\/title>\n<meta name=\"description\" content=\"How to use the 8 COSMAC 1802 Subtract Instructions: SD, SDI, SDB, SDBI, SM, SMI, SMB, and SMBI with programming examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"COSMAC 1802 Subtract Instructions - Bryce Automation\" \/>\n<meta property=\"og:description\" content=\"How to use the 8 COSMAC 1802 Subtract Instructions: SD, SDI, SDB, SDBI, SM, SMI, SMB, and SMBI with programming examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/\" \/>\n<meta property=\"og:site_name\" content=\"Bryce Automation\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ricky.bryce.7\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-05T19:48:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-05T19:48:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1263\" \/>\n\t<meta property=\"og:image:height\" content=\"948\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ricky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/\"},\"author\":{\"name\":\"Ricky\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"headline\":\"COSMAC 1802 Subtract Instructions\",\"datePublished\":\"2022-11-05T19:48:26+00:00\",\"dateModified\":\"2022-11-05T19:48:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/\"},\"wordCount\":1435,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/subtract.png\",\"keywords\":[\"SD\",\"SDB\",\"SDBI\",\"SDI\",\"SM\",\"SMB\",\"SMBI\",\"SMI\"],\"articleSection\":[\"COSMAC\",\"Vintage Computers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/\",\"name\":\"COSMAC 1802 Subtract Instructions - Bryce Automation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/subtract.png\",\"datePublished\":\"2022-11-05T19:48:26+00:00\",\"dateModified\":\"2022-11-05T19:48:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"description\":\"How to use the 8 COSMAC 1802 Subtract Instructions: SD, SDI, SDB, SDBI, SM, SMI, SMB, and SMBI with programming examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/subtract.png\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/subtract.png\",\"width\":1263,\"height\":948,\"caption\":\"COSMAC 1802 Subtract Instructions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2022\\\/11\\\/05\\\/cosmac-1802-subtract-instructions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bryceautomation.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"COSMAC 1802 Subtract Instructions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/\",\"name\":\"Bryce Automation\",\"description\":\"Automating Home and Industry...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bryceautomation.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\",\"name\":\"Ricky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"caption\":\"Ricky\"},\"sameAs\":[\"http:\\\/\\\/bryceautomation.com\",\"https:\\\/\\\/www.facebook.com\\\/ricky.bryce.7\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ricky-bryce-4367a416\\\/\"],\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/author\\\/ricky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"COSMAC 1802 Subtract Instructions - Bryce Automation","description":"How to use the 8 COSMAC 1802 Subtract Instructions: SD, SDI, SDB, SDBI, SM, SMI, SMB, and SMBI with programming examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/","og_locale":"en_US","og_type":"article","og_title":"COSMAC 1802 Subtract Instructions - Bryce Automation","og_description":"How to use the 8 COSMAC 1802 Subtract Instructions: SD, SDI, SDB, SDBI, SM, SMI, SMB, and SMBI with programming examples.","og_url":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/","og_site_name":"Bryce Automation","article_author":"https:\/\/www.facebook.com\/ricky.bryce.7","article_published_time":"2022-11-05T19:48:26+00:00","article_modified_time":"2022-11-05T19:48:30+00:00","og_image":[{"width":1263,"height":948,"url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png","type":"image\/png"}],"author":"Ricky","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#article","isPartOf":{"@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/"},"author":{"name":"Ricky","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"headline":"COSMAC 1802 Subtract Instructions","datePublished":"2022-11-05T19:48:26+00:00","dateModified":"2022-11-05T19:48:30+00:00","mainEntityOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/"},"wordCount":1435,"commentCount":0,"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png","keywords":["SD","SDB","SDBI","SDI","SM","SMB","SMBI","SMI"],"articleSection":["COSMAC","Vintage Computers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/","url":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/","name":"COSMAC 1802 Subtract Instructions - Bryce Automation","isPartOf":{"@id":"https:\/\/bryceautomation.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#primaryimage"},"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png","datePublished":"2022-11-05T19:48:26+00:00","dateModified":"2022-11-05T19:48:30+00:00","author":{"@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"description":"How to use the 8 COSMAC 1802 Subtract Instructions: SD, SDI, SDB, SDBI, SM, SMI, SMB, and SMBI with programming examples.","breadcrumb":{"@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#primaryimage","url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2022\/11\/subtract.png","width":1263,"height":948,"caption":"COSMAC 1802 Subtract Instructions"},{"@type":"BreadcrumbList","@id":"https:\/\/bryceautomation.com\/index.php\/2022\/11\/05\/cosmac-1802-subtract-instructions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bryceautomation.com\/"},{"@type":"ListItem","position":2,"name":"COSMAC 1802 Subtract Instructions"}]},{"@type":"WebSite","@id":"https:\/\/bryceautomation.com\/#website","url":"https:\/\/bryceautomation.com\/","name":"Bryce Automation","description":"Automating Home and Industry...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bryceautomation.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7","name":"Ricky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","url":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","caption":"Ricky"},"sameAs":["http:\/\/bryceautomation.com","https:\/\/www.facebook.com\/ricky.bryce.7","https:\/\/www.linkedin.com\/in\/ricky-bryce-4367a416\/"],"url":"https:\/\/bryceautomation.com\/index.php\/author\/ricky\/"}]}},"_links":{"self":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/14233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/comments?post=14233"}],"version-history":[{"count":0,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/14233\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media\/14251"}],"wp:attachment":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media?parent=14233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/categories?post=14233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/tags?post=14233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}