{"id":158,"date":"2018-03-05T13:46:48","date_gmt":"2018-03-05T12:46:48","guid":{"rendered":"http:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/?page_id=158"},"modified":"2020-02-25T22:41:28","modified_gmt":"2020-02-25T21:41:28","slug":"wzorce-generowania-kodu","status":"publish","type":"page","link":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/?page_id=158","title":{"rendered":"Wzorce generowania kodu"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ka\u017cdy komentarz w poni\u017cszej tabeli oznacza, \u017ce w tym miejscu nale\u017cy wstawi\u0107 zawarto\u015b\u0107 odpowiedniego parametru szablonu.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wstawianie zawarto\u015bci szablonu wygl\u0105da tak: <code>&lt;tt&gt;<\/code>, gdzie <code>tt<\/code> jest nazw\u0105 parametru.<\/p>\n\n\n\n<table class=\"wp-block-advgb-table advgb-table-frontend is-style-default\" style=\"table-layout:fixed\"><thead><tr><td> <strong>Nazwa <\/strong><\/td><td><strong> Architektura rejestrowa <\/strong><\/td><td><strong> Architektura stosowa <\/strong><\/td><\/tr><\/thead><tbody><tr><td style=\"border-bottom-color:#000\">\n<ul>\n<li>Odejmowanie<\/li>\n<\/ul>\n<\/td><td style=\"border-bottom-color:#000\"><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">\/*put the code leaving result of the right argument in the A register*\/\nPUSH A\n\/*put the code leaving result of the left argument in the A register*\/\nPOP B\nSUB A,B\n<\/pre>\n<\/td><td style=\"border-bottom-color:#000\"> <pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">\/*put the code leaving result of the left argument on the stack*\/\n\/*put the code leaving result of the right argument on the stack*\/\nSUB\n<\/pre> <\/td><\/tr><tr><td>\n<ul>\n<li>Read number<\/li>\n<\/ul>\n<\/td><td><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">MOV A,#&lt;number&gt;<\/pre><\/td><td>\n<pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">PUSH\t#&lt;number&gt;<\/pre>\n<\/td><\/tr><tr><td style=\"border-top-color:#000;border-bottom-color:#000\">\n<ul>\n<li>Declare variable<\/li>\n<\/ul>\n<\/td><td style=\"border-top-color:#000;border-bottom-color:#000\"><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">  DD &lt;ID&gt; <\/pre><\/td><td style=\"border-top-color:#000;border-bottom-color:#000\"><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">  DD &lt;ID&gt;<\/pre> <\/td><\/tr><tr><td>\n<ul>\n<li>Read variable<\/li>\n<\/ul>\n<\/td><td><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">  MOV A,[&lt;ID&gt;]<\/pre> <\/td><td><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">  PUSH [&lt;ID&gt;]<\/pre> <\/td><\/tr><tr><td style=\"border-top-color:#000;border-bottom-color:#000\">\n<ul>\n<li>Write variable<\/li>\n<\/ul>\n<\/td><td style=\"border-top-color:#000;border-bottom-color:#000\"><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">  MOV [&lt;ID&gt;],A <\/pre><\/td><td style=\"border-top-color:#000;border-bottom-color:#000\"><pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">  POP [&lt;ID&gt;]<\/pre> <\/td><\/tr><tr><td style=\"border-bottom-color:#000\">\n<ul>\n<li>if<\/li>\n<\/ul>\n<p>The label must be unique for each <i>if<\/i> in the code!<\/p>\n<\/td><td style=\"border-bottom-color:#000\"> <pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">\/*put the code leaving results of the boolean expression in A and flags*\/\n JE label_else_xx \n\/*put the then code*\/\n JMP label_endif_xx label_else_xx: \n\/*put the else code*\/ \nlabel_endif_xx:\n  <\/pre><\/td><td style=\"border-bottom-color:#000\"> <pre class=\"brush: cpp; auto-links: false; title: ; notranslate\" title=\"\">\/*put the code leaving results of the boolean expression on the stack*\/\n PUSH #label_else_xx\n JE \n\/*put the then code*\/\n PUSH #label_endif_xx\n JMP label_else_xx: \n\/*put the else code*\/ \nlabel_endif_xx: <\/pre> <\/td><\/tr><\/tbody><\/table>\n\n\n\n<p class=\"wp-block-paragraph\">to be continued&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ka\u017cdy komentarz w poni\u017cszej tabeli oznacza, \u017ce w tym miejscu nale\u017cy wstawi\u0107 zawarto\u015b\u0107 odpowiedniego parametru szablonu. Wstawianie zawarto\u015bci szablonu wygl\u0105da tak: &lt;tt&gt;, gdzie tt jest nazw\u0105 parametru. to be continued&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":156,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","footnotes":""},"class_list":["post-158","page","type-page","status-publish","hentry"],"coauthors":[],"author_meta":{"author_link":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/?author=1","display_name":"Tomasz Babczy\u0144ski"},"relative_dates":{"created":"Opublikowano 9 lat temu","modified":"Zaktualizowano 7 lat temu"},"absolute_dates":{"created":"Opublikowano 05.03.2018","modified":"Zaktualizowano 25.02.2020"},"absolute_dates_time":{"created":"Opublikowano 05.03.2018 1:46 PM","modified":"Zaktualizowano 25.02.2020 10:41 PM"},"featured_img_caption":"","featured_img":false,"series_order":"","_links":{"self":[{"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/pages\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158"}],"version-history":[{"count":6,"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/pages\/158\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/pages\/158\/revisions\/470"}],"up":[{"embeddable":true,"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=\/wp\/v2\/pages\/156"}],"wp:attachment":[{"href":"https:\/\/gromit.ict.pwr.wroc.pl\/~faster\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}