{"id":379,"date":"2022-02-17T17:28:21","date_gmt":"2022-02-17T16:28:21","guid":{"rendered":"https:\/\/www.dev-tronic.de\/?p=379"},"modified":"2022-02-17T17:28:21","modified_gmt":"2022-02-17T16:28:21","slug":"z80-binaerumrechnung","status":"publish","type":"post","link":"https:\/\/www.dev-tronic.de\/?p=379","title":{"rendered":"Z80 \u2013 Bin\u00e4rumrechnung"},"content":{"rendered":"\n<p>Der folgende Code rechnet eine bis zu 16 Bit gro\u00dfe Zahl in eine Bin\u00e4rzahl um und gibt diese aus. Die Ausgaberoutine ist nicht Teil des Codeschnipsels.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:z80 decode:true \" >                    ; HL enth\u00e4lt die bis zu 16 Bit gro\u00dfe Zahl\n                    ; Hier am Beispiel der Zahl 500\n                    ld hl,500\n                    call binary\n\n                    halt\n\n                    ; Convert to binary\n                    ; The OUT(0x0A),A command does the output to an device\nbinary:             push hl\n                    push bc\n                    ld c,0x00\n                    call gobin\n                    ld h,l\n                    call gobin\n                    pop bc\n                    pop hl\n                    ret\n\ngobin:              ld b,0x08\n\nbitloop:  ld a,h\n                    bit 7,h\n                    jr nz,one\nzero:               ld a,c\n                    or a\n                    jr z,end1\n                    ld a,\"0\"\n                    out (0x0a),a\n                    jr end1\n\none:                ld a,\"1\"\n                    ld c,0x01\n                    out (0x0a),a\n\nend1:               ld a,h\n                    rlca\n                    ld h,a\n                    djnz bitloop\n\n                    ret<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Der folgende Code rechnet eine bis zu 16 Bit gro\u00dfe Zahl in eine Bin\u00e4rzahl um und gibt diese aus. Die Ausgaberoutine ist nicht Teil des Codeschnipsels.<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[41,28,11],"class_list":["post-379","post","type-post","status-publish","format-standard","hentry","category-z80codeschnipsel","tag-binaer","tag-umrechnung","tag-z80"],"_links":{"self":[{"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=379"}],"version-history":[{"count":1,"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions\/380"}],"wp:attachment":[{"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-tronic.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}