Translation components API.

See the Weblate's Web API documentation for detailed description of the API.

GET /api/translations/freebsd-doc/boooks_developers-handbook/en/units/?format=api
HTTP 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 2274,
    "next": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/units/?format=api&page=2",
    "previous": null,
    "results": [
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%include\t'system.inc'\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\nbuffer\tdb\t0, 0, ' '\n\nsection\t.text\nglobal\t_start\n_start:\n\t; read a byte from stdin\n\tpush\tdword 1\n\tpush\tdword buffer\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tor\teax, eax\n\tje\t.done\n\n\t; convert it to hex\n\tmovzx\teax, byte [buffer]\n\tmov\tedx, eax\n\tshr\tdl, 4\n\tmov\tdl, [hex+edx]\n\tmov\t[buffer], dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tmov\t[buffer+1], al\n\n\t; print it\n\tpush\tdword 3\n\tpush\tdword buffer\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tjmp\tshort _start\n\n.done:\n\tpush\tdword 0\n\tsys.exit"
            ],
            "previous_source": "",
            "target": [
                "%include\t'system.inc'\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\nbuffer\tdb\t0, 0, ' '\n\nsection\t.text\nglobal\t_start\n_start:\n\t; read a byte from stdin\n\tpush\tdword 1\n\tpush\tdword buffer\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tor\teax, eax\n\tje\t.done\n\n\t; convert it to hex\n\tmovzx\teax, byte [buffer]\n\tmov\tedx, eax\n\tshr\tdl, 4\n\tmov\tdl, [hex+edx]\n\tmov\t[buffer], dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tmov\t[buffer+1], al\n\n\t; print it\n\tpush\tdword 3\n\tpush\tdword buffer\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tjmp\tshort _start\n\n.done:\n\tpush\tdword 0\n\tsys.exit"
            ],
            "id_hash": -6563012658962450379,
            "content_hash": -6563012658962450379,
            "location": "book.translate.xml:10161",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1704,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 98,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92213/?format=api",
            "priority": 100,
            "id": 92213,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=24eb7ec24e26b835",
            "url": "https://translate-dev.freebsd.org/api/units/92213/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:23.875501Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%include\t'system.inc'\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\nbuffer\tdb\t0, 0, ' '\n\nsection\t.text\nglobal\t_start\n_start:\n\tmov\tcl, ' '\n\n.loop:\n\t; read a byte from stdin\n\tpush\tdword 1\n\tpush\tdword buffer\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tor\teax, eax\n\tje\t.done\n\n\t; convert it to hex\n\tmovzx\teax, byte [buffer]\n\tmov\t[buffer+2], cl\n\tcmp\tal, 0Ah\n\tjne\t.hex\n\tmov\t[buffer+2], al\n\n.hex:\n\tmov\tedx, eax\n\tshr\tdl, 4\n\tmov\tdl, [hex+edx]\n\tmov\t[buffer], dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tmov\t[buffer+1], al\n\n\t; print it\n\tpush\tdword 3\n\tpush\tdword buffer\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tjmp\tshort .loop\n\n.done:\n\tpush\tdword 0\n\tsys.exit"
            ],
            "previous_source": "",
            "target": [
                "%include\t'system.inc'\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\nbuffer\tdb\t0, 0, ' '\n\nsection\t.text\nglobal\t_start\n_start:\n\tmov\tcl, ' '\n\n.loop:\n\t; read a byte from stdin\n\tpush\tdword 1\n\tpush\tdword buffer\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tor\teax, eax\n\tje\t.done\n\n\t; convert it to hex\n\tmovzx\teax, byte [buffer]\n\tmov\t[buffer+2], cl\n\tcmp\tal, 0Ah\n\tjne\t.hex\n\tmov\t[buffer+2], al\n\n.hex:\n\tmov\tedx, eax\n\tshr\tdl, 4\n\tmov\tdl, [hex+edx]\n\tmov\t[buffer], dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tmov\t[buffer+1], al\n\n\t; print it\n\tpush\tdword 3\n\tpush\tdword buffer\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tjmp\tshort .loop\n\n.done:\n\tpush\tdword 0\n\tsys.exit"
            ],
            "id_hash": -552679820599041996,
            "content_hash": -552679820599041996,
            "location": "book.translate.xml:10274",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1716,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 115,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92214/?format=api",
            "priority": 100,
            "id": 92214,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=78547ca1a2aae034",
            "url": "https://translate-dev.freebsd.org/api/units/92214/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:23.906639Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nglobal\t_start\n_start:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; convert it to hex\n\tmov\tdl, al\n\tshr\tal, 4\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, ' '\n\tcmp\tdl, 0Ah\n\tjne\t.put\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tjmp\tshort .loop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n\tret"
            ],
            "previous_source": "",
            "target": [
                "%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nglobal\t_start\n_start:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; convert it to hex\n\tmov\tdl, al\n\tshr\tal, 4\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, ' '\n\tcmp\tdl, 0Ah\n\tjne\t.put\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tjmp\tshort .loop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n\tret"
            ],
            "id_hash": -8598141787277080810,
            "content_hash": -8598141787277080810,
            "location": "book.translate.xml:10372",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1726,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 192,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92215/?format=api",
            "priority": 100,
            "id": 92215,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=08ad439970e84716",
            "url": "https://translate-dev.freebsd.org/api/units/92215/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:23.932032Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nglobal\t_start\n_start:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; convert it to hex\n\tmov\tdl, al\n\tshr\tal, 4\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, ' '\n\tcmp\tdl, 0Ah\n\tjne\t.put\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n>\tcmp\tal, 0Ah\n>\tjne\t.loop\n>\tcall\twrite\n\tjmp\tshort .loop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n\tret"
            ],
            "previous_source": "",
            "target": [
                "%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nhex\tdb\t'0123456789ABCDEF'\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nglobal\t_start\n_start:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; convert it to hex\n\tmov\tdl, al\n\tshr\tal, 4\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, ' '\n\tcmp\tdl, 0Ah\n\tjne\t.put\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n>\tcmp\tal, 0Ah\n>\tjne\t.loop\n>\tcall\twrite\n\tjmp\tshort .loop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword stdin\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword stdout\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n\tret"
            ],
            "id_hash": 5036145711746062312,
            "content_hash": 5036145711746062312,
            "location": "book.translate.xml:10507",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1733,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 202,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92216/?format=api",
            "priority": 100,
            "id": 92216,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=c5e3fbd799bb17e8",
            "url": "https://translate-dev.freebsd.org/api/units/92216/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:23.951547Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "mov\tal, [esi]\n\tinc\tesi"
            ],
            "previous_source": "",
            "target": [
                "mov\tal, [esi]\n\tinc\tesi"
            ],
            "id_hash": 909580563455865610,
            "content_hash": 909580563455865610,
            "location": "book.translate.xml:10679",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1747,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92217/?format=api",
            "priority": 100,
            "id": 92217,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=8c9f7ab40b62f30a",
            "url": "https://translate-dev.freebsd.org/api/units/92217/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:23.977626Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "ungetc:\n\tdec\tesi\n\tinc\tebx\n\tret"
            ],
            "previous_source": "",
            "target": [
                "ungetc:\n\tdec\tesi\n\tinc\tebx\n\tret"
            ],
            "id_hash": -5493803864766407371,
            "content_hash": -5493803864766407371,
            "location": "book.translate.xml:10690",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1749,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 6,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92218/?format=api",
            "priority": 100,
            "id": 92218,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=33c2167e0eee1d35",
            "url": "https://translate-dev.freebsd.org/api/units/92218/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:23.986933Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "section\t.bss\n\tresb\t16\t; or whatever the value you came up with\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE"
            ],
            "previous_source": "",
            "target": [
                "section\t.bss\n\tresb\t16\t; or whatever the value you came up with\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE"
            ],
            "id_hash": -2380197124361714707,
            "content_hash": -2380197124361714707,
            "location": "book.translate.xml:10730",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1756,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 19,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92219/?format=api",
            "priority": 100,
            "id": 92219,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=5ef7d753830383ed",
            "url": "https://translate-dev.freebsd.org/api/units/92219/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.010837Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "ungetc:\n\tdec\tesi\n\tinc\tebx\n\tmov\t[esi], al\n\tret"
            ],
            "previous_source": "",
            "target": [
                "ungetc:\n\tdec\tesi\n\tinc\tebx\n\tmov\t[esi], al\n\tret"
            ],
            "id_hash": -2227107473759845522,
            "content_hash": -2227107473759845522,
            "location": "book.translate.xml:10738",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1758,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 9,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92220/?format=api",
            "priority": 100,
            "id": 92220,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=6117b98d65ed436e",
            "url": "https://translate-dev.freebsd.org/api/units/92220/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.020000Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%define\tSYS_open\t5\n%define\tSYS_close\t6"
            ],
            "previous_source": "",
            "target": [
                "%define\tSYS_open\t5\n%define\tSYS_close\t6"
            ],
            "id_hash": -2611912348410857990,
            "content_hash": -2611912348410857990,
            "location": "book.translate.xml:10800",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1769,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 6,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92221/?format=api",
            "priority": 100,
            "id": 92221,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=5bc09f8ec083b5fa",
            "url": "https://translate-dev.freebsd.org/api/units/92221/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.049246Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%macro\tsys.open\t0\n\tsystem\tSYS_open\n%endmacro\n\n%macro\tsys.close\t0\n\tsystem\tSYS_close\n%endmacro"
            ],
            "previous_source": "",
            "target": [
                "%macro\tsys.open\t0\n\tsystem\tSYS_open\n%endmacro\n\n%macro\tsys.close\t0\n\tsystem\tSYS_close\n%endmacro"
            ],
            "id_hash": -9181551585411346102,
            "content_hash": -9181551585411346102,
            "location": "book.translate.xml:10805",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1771,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 12,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92222/?format=api",
            "priority": 100,
            "id": 92222,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=0094937aa0a1d14a",
            "url": "https://translate-dev.freebsd.org/api/units/92222/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.062619Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nhex\tdb\t'0123456789ABCDEF'\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nalign 4\nerr:\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\n\tpop\tecx\n\tjecxz\t.init\t\t; no more arguments\n\n\t; ECX contains the path to input file\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\terr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\n\tpop\tecx\n\tjecxz\t.init\t\t; no more arguments\n\n\t; ECX contains the path to output file\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\terr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n.loop:\n\t; read a byte from input file or stdin\n\tcall\tgetchar\n\n\t; convert it to hex\n\tmov\tdl, al\n\tshr\tal, 4\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, ' '\n\tcmp\tdl, 0Ah\n\tjne\t.put\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tcmp\tal, dl\n\tjne\t.loop\n\tcall\twrite\n\tjmp\tshort .loop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n\tret"
            ],
            "previous_source": "",
            "target": [
                "%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nhex\tdb\t'0123456789ABCDEF'\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nalign 4\nerr:\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\n\tpop\tecx\n\tjecxz\t.init\t\t; no more arguments\n\n\t; ECX contains the path to input file\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\terr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\n\tpop\tecx\n\tjecxz\t.init\t\t; no more arguments\n\n\t; ECX contains the path to output file\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\terr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n.loop:\n\t; read a byte from input file or stdin\n\tcall\tgetchar\n\n\t; convert it to hex\n\tmov\tdl, al\n\tshr\tal, 4\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, dl\n\tand\tal, 0Fh\n\tmov\tal, [hex+eax]\n\tcall\tputchar\n\n\tmov\tal, ' '\n\tcmp\tdl, 0Ah\n\tjne\t.put\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tcmp\tal, dl\n\tjne\t.loop\n\tcall\twrite\n\tjmp\tshort .loop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n\tret"
            ],
            "id_hash": -6472611567857624774,
            "content_hash": -6472611567857624774,
            "location": "book.translate.xml:10815",
            "context": "",
            "note": "(itstool) path: sect1/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1773,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 329,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92223/?format=api",
            "priority": 100,
            "id": 92223,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=262caa1288c3193a",
            "url": "https://translate-dev.freebsd.org/api/units/92223/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.084567Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "CGI: a Quick Overview"
            ],
            "previous_source": "",
            "target": [
                "CGI: a Quick Overview"
            ],
            "id_hash": -211122992921846397,
            "content_hash": -211122992921846397,
            "location": "book.translate.xml:11086",
            "context": "",
            "note": "(itstool) path: sect3/title",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1797,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 4,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92224/?format=api",
            "priority": 100,
            "id": 92224,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=7d11f0c1aaf9dd83",
            "url": "https://translate-dev.freebsd.org/api/units/92224/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.129746Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                ";;;;;;; webvars.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Copyright (c) 2000 G. Adam Stanislav\n; All rights reserved.\n;\n; Redistribution and use in source and binary forms, with or without\n; modification, are permitted provided that the following conditions\n; are met:\n; 1. Redistributions of source code must retain the above copyright\n;    notice, this list of conditions and the following disclaimer.\n; 2. Redistributions in binary form must reproduce the above copyright\n;    notice, this list of conditions and the following disclaimer in the\n;    documentation and/or other materials provided with the distribution.\n;\n; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n; SUCH DAMAGE.\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Version 1.0\n;\n; Started:\t 8-Dec-2000\n; Updated:\t 8-Dec-2000\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n%include\t'system.inc'\n\nsection\t.data\nhttp\tdb\t'Content-type: text/html', 0Ah, 0Ah\n\tdb\t'<?xml version=\"1.0\" encoding=\"utf-8\"?>', 0Ah\n\tdb\t'<!DOCTYPE html PUBLIC \"-//W3C/DTD XHTML Strict//EN\" '\n\tdb\t'\"DTD/xhtml1-strict.dtd\">', 0Ah\n\tdb\t'<html xmlns=\"http://www.w3.org/1999/xhtml\" '\n\tdb\t'xml.lang=\"en\" lang=\"en\">', 0Ah\n\tdb\t'<head>', 0Ah\n\tdb\t'<title>Web Environment</title>', 0Ah\n\tdb\t'<meta name=\"author\" content=\"G. Adam Stanislav\" />', 0Ah\n\tdb\t'</head>', 0Ah, 0Ah\n\tdb\t'<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#0000ff\" '\n\tdb\t'vlink=\"#840084\" alink=\"#0000ff\">', 0Ah\n\tdb\t'<div class=\"webvars\">', 0Ah\n\tdb\t'<h1>Web Environment</h1>', 0Ah\n\tdb\t'<p>The following <b>environment variables</b> are defined '\n\tdb\t'on this web server:</p>', 0Ah, 0Ah\n\tdb\t'<table align=\"center\" width=\"80\" border=\"0\" cellpadding=\"10\" '\n\tdb\t'cellspacing=\"0\" class=\"webvars\">', 0Ah\nhttplen\tequ\t$-http\nleft\tdb\t'<tr>', 0Ah\n\tdb\t'<td class=\"name\"><tt>'\nleftlen\tequ\t$-left\nmiddle\tdb\t'</tt></td>', 0Ah\n\tdb\t'<td class=\"value\"><tt><b>'\nmidlen\tequ\t$-middle\nundef\tdb\t'<i>(undefined)</i>'\nundeflen\tequ\t$-undef\nright\tdb\t'</b></tt></td>', 0Ah\n\tdb\t'</tr>', 0Ah\nrightlen\tequ\t$-right\nwrap\tdb\t'</table>', 0Ah\n\tdb\t'</div>', 0Ah\n\tdb\t'</body>', 0Ah\n\tdb\t'</html>', 0Ah, 0Ah\nwraplen\tequ\t$-wrap\n\nsection\t.text\nglobal\t_start\n_start:\n\t; First, send out all the http and xhtml stuff that is\n\t; needed before we start showing the environment\n\tpush\tdword httplen\n\tpush\tdword http\n\tpush\tdword stdout\n\tsys.write\n\n\t; Now find how far on the stack the environment pointers\n\t; are. We have 12 bytes we have pushed before \"argc\"\n\tmov\teax, [esp+12]\n\n\t; We need to remove the following from the stack:\n\t;\n\t;\tThe 12 bytes we pushed for sys.write\n\t;\tThe  4 bytes of argc\n\t;\tThe EAX*4 bytes of argv\n\t;\tThe  4 bytes of the NULL after argv\n\t;\n\t; Total:\n\t;\t20 + eax * 4\n\t;\n\t; Because stack grows down, we need to ADD that many bytes\n\t; to ESP.\n\tlea\tesp, [esp+20+eax*4]\n\tcld\t\t; This should already be the case, but let's be sure.\n\n\t; Loop through the environment, printing it out\n.loop:\n\tpop\tedi\n\tor\tedi, edi\t; Done yet?\n\tje\tnear .wrap\n\n\t; Print the left part of HTML\n\tpush\tdword leftlen\n\tpush\tdword left\n\tpush\tdword stdout\n\tsys.write\n\n\t; It may be tempting to search for the '=' in the env string next.\n\t; But it is possible there is no '=', so we search for the\n\t; terminating NUL first.\n\tmov\tesi, edi\t; Save start of string\n\tsub\tecx, ecx\n\tnot\tecx\t\t; ECX = FFFFFFFF\n\tsub\teax, eax\nrepne\tscasb\n\tnot\tecx\t\t; ECX = string length + 1\n\tmov\tebx, ecx\t; Save it in EBX\n\n\t; Now is the time to find '='\n\tmov\tedi, esi\t; Start of string\n\tmov\tal, '='\nrepne\tscasb\n\tnot\tecx\n\tadd\tecx, ebx\t; Length of name\n\n\tpush\tecx\n\tpush\tesi\n\tpush\tdword stdout\n\tsys.write\n\n\t; Print the middle part of HTML table code\n\tpush\tdword midlen\n\tpush\tdword middle\n\tpush\tdword stdout\n\tsys.write\n\n\t; Find the length of the value\n\tnot\tecx\n\tlea\tebx, [ebx+ecx-1]\n\n\t; Print \"undefined\" if 0\n\tor\tebx, ebx\n\tjne\t.value\n\n\tmov\tebx, undeflen\n\tmov\tedi, undef\n\n.value:\n\tpush\tebx\n\tpush\tedi\n\tpush\tdword stdout\n\tsys.write\n\n\t; Print the right part of the table row\n\tpush\tdword rightlen\n\tpush\tdword right\n\tpush\tdword stdout\n\tsys.write\n\n\t; Get rid of the 60 bytes we have pushed\n\tadd\tesp, byte 60\n\n\t; Get the next variable\n\tjmp\t.loop\n\n.wrap:\n\t; Print the rest of HTML\n\tpush\tdword wraplen\n\tpush\tdword wrap\n\tpush\tdword stdout\n\tsys.write\n\n\t; Return success\n\tpush\tdword 0\n\tsys.exit"
            ],
            "previous_source": "",
            "target": [
                ";;;;;;; webvars.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Copyright (c) 2000 G. Adam Stanislav\n; All rights reserved.\n;\n; Redistribution and use in source and binary forms, with or without\n; modification, are permitted provided that the following conditions\n; are met:\n; 1. Redistributions of source code must retain the above copyright\n;    notice, this list of conditions and the following disclaimer.\n; 2. Redistributions in binary form must reproduce the above copyright\n;    notice, this list of conditions and the following disclaimer in the\n;    documentation and/or other materials provided with the distribution.\n;\n; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n; SUCH DAMAGE.\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Version 1.0\n;\n; Started:\t 8-Dec-2000\n; Updated:\t 8-Dec-2000\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n%include\t'system.inc'\n\nsection\t.data\nhttp\tdb\t'Content-type: text/html', 0Ah, 0Ah\n\tdb\t'<?xml version=\"1.0\" encoding=\"utf-8\"?>', 0Ah\n\tdb\t'<!DOCTYPE html PUBLIC \"-//W3C/DTD XHTML Strict//EN\" '\n\tdb\t'\"DTD/xhtml1-strict.dtd\">', 0Ah\n\tdb\t'<html xmlns=\"http://www.w3.org/1999/xhtml\" '\n\tdb\t'xml.lang=\"en\" lang=\"en\">', 0Ah\n\tdb\t'<head>', 0Ah\n\tdb\t'<title>Web Environment</title>', 0Ah\n\tdb\t'<meta name=\"author\" content=\"G. Adam Stanislav\" />', 0Ah\n\tdb\t'</head>', 0Ah, 0Ah\n\tdb\t'<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#0000ff\" '\n\tdb\t'vlink=\"#840084\" alink=\"#0000ff\">', 0Ah\n\tdb\t'<div class=\"webvars\">', 0Ah\n\tdb\t'<h1>Web Environment</h1>', 0Ah\n\tdb\t'<p>The following <b>environment variables</b> are defined '\n\tdb\t'on this web server:</p>', 0Ah, 0Ah\n\tdb\t'<table align=\"center\" width=\"80\" border=\"0\" cellpadding=\"10\" '\n\tdb\t'cellspacing=\"0\" class=\"webvars\">', 0Ah\nhttplen\tequ\t$-http\nleft\tdb\t'<tr>', 0Ah\n\tdb\t'<td class=\"name\"><tt>'\nleftlen\tequ\t$-left\nmiddle\tdb\t'</tt></td>', 0Ah\n\tdb\t'<td class=\"value\"><tt><b>'\nmidlen\tequ\t$-middle\nundef\tdb\t'<i>(undefined)</i>'\nundeflen\tequ\t$-undef\nright\tdb\t'</b></tt></td>', 0Ah\n\tdb\t'</tr>', 0Ah\nrightlen\tequ\t$-right\nwrap\tdb\t'</table>', 0Ah\n\tdb\t'</div>', 0Ah\n\tdb\t'</body>', 0Ah\n\tdb\t'</html>', 0Ah, 0Ah\nwraplen\tequ\t$-wrap\n\nsection\t.text\nglobal\t_start\n_start:\n\t; First, send out all the http and xhtml stuff that is\n\t; needed before we start showing the environment\n\tpush\tdword httplen\n\tpush\tdword http\n\tpush\tdword stdout\n\tsys.write\n\n\t; Now find how far on the stack the environment pointers\n\t; are. We have 12 bytes we have pushed before \"argc\"\n\tmov\teax, [esp+12]\n\n\t; We need to remove the following from the stack:\n\t;\n\t;\tThe 12 bytes we pushed for sys.write\n\t;\tThe  4 bytes of argc\n\t;\tThe EAX*4 bytes of argv\n\t;\tThe  4 bytes of the NULL after argv\n\t;\n\t; Total:\n\t;\t20 + eax * 4\n\t;\n\t; Because stack grows down, we need to ADD that many bytes\n\t; to ESP.\n\tlea\tesp, [esp+20+eax*4]\n\tcld\t\t; This should already be the case, but let's be sure.\n\n\t; Loop through the environment, printing it out\n.loop:\n\tpop\tedi\n\tor\tedi, edi\t; Done yet?\n\tje\tnear .wrap\n\n\t; Print the left part of HTML\n\tpush\tdword leftlen\n\tpush\tdword left\n\tpush\tdword stdout\n\tsys.write\n\n\t; It may be tempting to search for the '=' in the env string next.\n\t; But it is possible there is no '=', so we search for the\n\t; terminating NUL first.\n\tmov\tesi, edi\t; Save start of string\n\tsub\tecx, ecx\n\tnot\tecx\t\t; ECX = FFFFFFFF\n\tsub\teax, eax\nrepne\tscasb\n\tnot\tecx\t\t; ECX = string length + 1\n\tmov\tebx, ecx\t; Save it in EBX\n\n\t; Now is the time to find '='\n\tmov\tedi, esi\t; Start of string\n\tmov\tal, '='\nrepne\tscasb\n\tnot\tecx\n\tadd\tecx, ebx\t; Length of name\n\n\tpush\tecx\n\tpush\tesi\n\tpush\tdword stdout\n\tsys.write\n\n\t; Print the middle part of HTML table code\n\tpush\tdword midlen\n\tpush\tdword middle\n\tpush\tdword stdout\n\tsys.write\n\n\t; Find the length of the value\n\tnot\tecx\n\tlea\tebx, [ebx+ecx-1]\n\n\t; Print \"undefined\" if 0\n\tor\tebx, ebx\n\tjne\t.value\n\n\tmov\tebx, undeflen\n\tmov\tedi, undef\n\n.value:\n\tpush\tebx\n\tpush\tedi\n\tpush\tdword stdout\n\tsys.write\n\n\t; Print the right part of the table row\n\tpush\tdword rightlen\n\tpush\tdword right\n\tpush\tdword stdout\n\tsys.write\n\n\t; Get rid of the 60 bytes we have pushed\n\tadd\tesp, byte 60\n\n\t; Get the next variable\n\tjmp\t.loop\n\n.wrap:\n\t; Print the rest of HTML\n\tpush\tdword wraplen\n\tpush\tdword wrap\n\tpush\tdword stdout\n\tsys.write\n\n\t; Return success\n\tpush\tdword 0\n\tsys.exit"
            ],
            "id_hash": 2170118971763590391,
            "content_hash": 2170118971763590391,
            "location": "book.translate.xml:11139",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1807,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 792,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92225/?format=api",
            "priority": 100,
            "id": 92225,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=9e1dcfb5004e04f7",
            "url": "https://translate-dev.freebsd.org/api/units/92225/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.163772Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "Our text file converter can be designer as a <emphasis>finite state machine</emphasis> with three possible states. We could call them states 0-2, but it will make our life easier if we give them symbolic names:"
            ],
            "previous_source": "",
            "target": [
                "Our text file converter can be designer as a <emphasis>finite state machine</emphasis> with three possible states. We could call them states 0-2, but it will make our life easier if we give them symbolic names:"
            ],
            "id_hash": 6844073632306016363,
            "content_hash": 6844073632306016363,
            "location": "book.translate.xml:11451",
            "context": "",
            "note": "(itstool) path: sect2/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1834,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 35,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92226/?format=api",
            "priority": 100,
            "id": 92226,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=defb08b50637b06b",
            "url": "https://translate-dev.freebsd.org/api/units/92226/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.216407Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "<symbol>ordinary</symbol>"
            ],
            "previous_source": "",
            "target": [
                "<symbol>ordinary</symbol>"
            ],
            "id_hash": 4798774946958918585,
            "content_hash": 4798774946958918585,
            "location": "book.translate.xml:11458",
            "context": "",
            "note": "(itstool) path: listitem/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1835,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92227/?format=api",
            "priority": 100,
            "id": 92227,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=c298ac63a687c3b9",
            "url": "https://translate-dev.freebsd.org/api/units/92227/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.229565Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "<symbol>cr</symbol>"
            ],
            "previous_source": "",
            "target": [
                "<symbol>cr</symbol>"
            ],
            "id_hash": 3323570649289481154,
            "content_hash": 3323570649289481154,
            "location": "book.translate.xml:11462",
            "context": "",
            "note": "(itstool) path: listitem/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1836,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92228/?format=api",
            "priority": 100,
            "id": 92228,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=ae1fb1e580d05bc2",
            "url": "https://translate-dev.freebsd.org/api/units/92228/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.247490Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "<symbol>lf</symbol>"
            ],
            "previous_source": "",
            "target": [
                "<symbol>lf</symbol>"
            ],
            "id_hash": 2979521932847689957,
            "content_hash": 2979521932847689957,
            "location": "book.translate.xml:11466",
            "context": "",
            "note": "(itstool) path: listitem/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1837,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92229/?format=api",
            "priority": 100,
            "id": 92229,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=a959636967df30e5",
            "url": "https://translate-dev.freebsd.org/api/units/92229/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.282291Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "switch (state) {\n\tdefault:\n\tcase REGULAR:\n\t\tregular(inputchar);\n\t\tbreak;\n\tcase CR:\n\t\tcr(inputchar);\n\t\tbreak;\n\tcase LF:\n\t\tlf(inputchar);\n\t\tbreak;\n\t}"
            ],
            "previous_source": "",
            "target": [
                "switch (state) {\n\tdefault:\n\tcase REGULAR:\n\t\tregular(inputchar);\n\t\tbreak;\n\tcase CR:\n\t\tcr(inputchar);\n\t\tbreak;\n\tcase LF:\n\t\tlf(inputchar);\n\t\tbreak;\n\t}"
            ],
            "id_hash": -5369933596883724238,
            "content_hash": -5369933596883724238,
            "location": "book.translate.xml:11602",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1859,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 17,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92230/?format=api",
            "priority": 100,
            "id": 92230,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=357a29d8424f5832",
            "url": "https://translate-dev.freebsd.org/api/units/92230/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.336512Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "(output[state])(inputchar);"
            ],
            "previous_source": "",
            "target": [
                "(output[state])(inputchar);"
            ],
            "id_hash": -6161055900249833488,
            "content_hash": -6161055900249833488,
            "location": "book.translate.xml:11618",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1861,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92231/?format=api",
            "priority": 100,
            "id": 92231,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=2a7f884d2848bff0",
            "url": "https://translate-dev.freebsd.org/api/units/92231/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.356544Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "(*state)(inputchar);"
            ],
            "previous_source": "",
            "target": [
                "(*state)(inputchar);"
            ],
            "id_hash": 3866093265037492871,
            "content_hash": 3866093265037492871,
            "location": "book.translate.xml:11624",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1863,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92232/?format=api",
            "priority": 100,
            "id": 92232,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=b5a71f5753170287",
            "url": "https://translate-dev.freebsd.org/api/units/92232/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.374029Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "call\tebx"
            ],
            "previous_source": "",
            "target": [
                "call\tebx"
            ],
            "id_hash": 6554761135131984123,
            "content_hash": 6554761135131984123,
            "location": "book.translate.xml:11632",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1865,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 2,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92233/?format=api",
            "priority": 100,
            "id": 92233,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=daf73086171400fb",
            "url": "https://translate-dev.freebsd.org/api/units/92233/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.395840Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "The <filename>syscalls.master</filename> lists the <acronym><trademark class=\"registered\">POSIX</trademark></acronym> version like this:"
            ],
            "previous_source": "",
            "target": [
                "The <filename>syscalls.master</filename> lists the <acronym><trademark class=\"registered\">POSIX</trademark></acronym> version like this:"
            ],
            "id_hash": 4454453113633949185,
            "content_hash": 4454453113633949185,
            "location": "book.translate.xml:11685",
            "context": "",
            "note": "(itstool) path: sect2/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1873,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 9,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92234/?format=api",
            "priority": 100,
            "id": 92234,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=bdd1658192c8c601",
            "url": "https://translate-dev.freebsd.org/api/units/92234/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.432286Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "197\tSTD\tBSD\t{ caddr_t mmap(caddr_t addr, size_t len, int prot, \\\n\t\t\t    int flags, int fd, long pad, off_t pos); }"
            ],
            "previous_source": "",
            "target": [
                "197\tSTD\tBSD\t{ caddr_t mmap(caddr_t addr, size_t len, int prot, \\\n\t\t\t    int flags, int fd, long pad, off_t pos); }"
            ],
            "id_hash": -1002781182293110745,
            "content_hash": -1002781182293110745,
            "location": "book.translate.xml:11688",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1874,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 21,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92235/?format=api",
            "priority": 100,
            "id": 92235,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=721567d3e1f91027",
            "url": "https://translate-dev.freebsd.org/api/units/92235/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.451659Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "189\tSTD\tPOSIX\t{ int fstat(int fd, struct stat *sb); }"
            ],
            "previous_source": "",
            "target": [
                "189\tSTD\tPOSIX\t{ int fstat(int fd, struct stat *sb); }"
            ],
            "id_hash": -8270634182088130517,
            "content_hash": -8270634182088130517,
            "location": "book.translate.xml:11729",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1883,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 11,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92236/?format=api",
            "priority": 100,
            "id": 92236,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=0d38ce07f56f002b",
            "url": "https://translate-dev.freebsd.org/api/units/92236/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.502866Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "201\tSTD\tBSD\t{ int ftruncate(int fd, int pad, off_t length); }"
            ],
            "previous_source": "",
            "target": [
                "201\tSTD\tBSD\t{ int ftruncate(int fd, int pad, off_t length); }"
            ],
            "id_hash": 968198887015733970,
            "content_hash": 968198887015733970,
            "location": "book.translate.xml:11763",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1890,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 12,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92237/?format=api",
            "priority": 100,
            "id": 92237,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=8d6fbbc20c805ad2",
            "url": "https://translate-dev.freebsd.org/api/units/92237/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.535634Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                ";;;;;;; open flags\n%define\tO_RDONLY\t0\n%define\tO_WRONLY\t1\n%define\tO_RDWR\t2\n\n;;;;;;; mmap flags\n%define\tPROT_NONE\t0\n%define\tPROT_READ\t1\n%define\tPROT_WRITE\t2\n%define\tPROT_EXEC\t4\n;;\n%define\tMAP_SHARED\t0001h\n%define\tMAP_PRIVATE\t0002h\n\n;;;;;;; stat structure\nstruc\tstat\nst_dev\t\tresd\t1\t; = 0\nst_ino\t\tresd\t1\t; = 4\nst_mode\t\tresw\t1\t; = 8, size is 16 bits\nst_nlink\tresw\t1\t; = 10, ditto\nst_uid\t\tresd\t1\t; = 12\nst_gid\t\tresd\t1\t; = 16\nst_rdev\t\tresd\t1\t; = 20\nst_atime\tresd\t1\t; = 24\nst_atimensec\tresd\t1\t; = 28\nst_mtime\tresd\t1\t; = 32\nst_mtimensec\tresd\t1\t; = 36\nst_ctime\tresd\t1\t; = 40\nst_ctimensec\tresd\t1\t; = 44\nst_size\t\tresd\t2\t; = 48, size is 64 bits\nst_blocks\tresd\t2\t; = 56, ditto\nst_blksize\tresd\t1\t; = 64\nst_flags\tresd\t1\t; = 68\nst_gen\t\tresd\t1\t; = 72\nst_lspare\tresd\t1\t; = 76\nst_qspare\tresd\t4\t; = 80\nendstruc"
            ],
            "previous_source": "",
            "target": [
                ";;;;;;; open flags\n%define\tO_RDONLY\t0\n%define\tO_WRONLY\t1\n%define\tO_RDWR\t2\n\n;;;;;;; mmap flags\n%define\tPROT_NONE\t0\n%define\tPROT_READ\t1\n%define\tPROT_WRITE\t2\n%define\tPROT_EXEC\t4\n;;\n%define\tMAP_SHARED\t0001h\n%define\tMAP_PRIVATE\t0002h\n\n;;;;;;; stat structure\nstruc\tstat\nst_dev\t\tresd\t1\t; = 0\nst_ino\t\tresd\t1\t; = 4\nst_mode\t\tresw\t1\t; = 8, size is 16 bits\nst_nlink\tresw\t1\t; = 10, ditto\nst_uid\t\tresd\t1\t; = 12\nst_gid\t\tresd\t1\t; = 16\nst_rdev\t\tresd\t1\t; = 20\nst_atime\tresd\t1\t; = 24\nst_atimensec\tresd\t1\t; = 28\nst_mtime\tresd\t1\t; = 32\nst_mtimensec\tresd\t1\t; = 36\nst_ctime\tresd\t1\t; = 40\nst_ctimensec\tresd\t1\t; = 44\nst_size\t\tresd\t2\t; = 48, size is 64 bits\nst_blocks\tresd\t2\t; = 56, ditto\nst_blksize\tresd\t1\t; = 64\nst_flags\tresd\t1\t; = 68\nst_gen\t\tresd\t1\t; = 72\nst_lspare\tresd\t1\t; = 76\nst_qspare\tresd\t4\t; = 80\nendstruc"
            ],
            "id_hash": -5777596810859417530,
            "content_hash": -5777596810859417530,
            "location": "book.translate.xml:11778",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1894,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 170,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92238/?format=api",
            "priority": 100,
            "id": 92238,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=2fd1da4fc14b7046",
            "url": "https://translate-dev.freebsd.org/api/units/92238/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.561023Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%define\tSYS_mmap\t197\n%define\tSYS_munmap\t73\n%define\tSYS_fstat\t189\n%define\tSYS_ftruncate\t201"
            ],
            "previous_source": "",
            "target": [
                "%define\tSYS_mmap\t197\n%define\tSYS_munmap\t73\n%define\tSYS_fstat\t189\n%define\tSYS_ftruncate\t201"
            ],
            "id_hash": 3028689285499883460,
            "content_hash": 3028689285499883460,
            "location": "book.translate.xml:11818",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1896,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 12,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92239/?format=api",
            "priority": 100,
            "id": 92239,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=aa0810dbc5408fc4",
            "url": "https://translate-dev.freebsd.org/api/units/92239/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.584114Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "%macro\tsys.mmap\t0\n\tsystem\tSYS_mmap\n%endmacro\n\n%macro\tsys.munmap\t0\n\tsystem\tSYS_munmap\n%endmacro\n\n%macro\tsys.ftruncate\t0\n\tsystem\tSYS_ftruncate\n%endmacro\n\n%macro\tsys.fstat\t0\n\tsystem\tSYS_fstat\n%endmacro"
            ],
            "previous_source": "",
            "target": [
                "%macro\tsys.mmap\t0\n\tsystem\tSYS_mmap\n%endmacro\n\n%macro\tsys.munmap\t0\n\tsystem\tSYS_munmap\n%endmacro\n\n%macro\tsys.ftruncate\t0\n\tsystem\tSYS_ftruncate\n%endmacro\n\n%macro\tsys.fstat\t0\n\tsystem\tSYS_fstat\n%endmacro"
            ],
            "id_hash": 8327737663026326704,
            "content_hash": 8327737663026326704,
            "location": "book.translate.xml:11825",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1898,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 24,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92240/?format=api",
            "priority": 100,
            "id": 92240,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=f392114843536cb0",
            "url": "https://translate-dev.freebsd.org/api/units/92240/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.610420Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                ";;;;;;; Fast Text-to-Unix Conversion (ftuc.asm) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Started:\t21-Dec-2000\n;; Updated:\t22-Dec-2000\n;;\n;; Copyright 2000 G. Adam Stanislav.\n;; All rights reserved.\n;;\n;;;;;;; v.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n%include\t'system.inc'\n\nsection\t.data\n\tdb\t'Copyright 2000 G. Adam Stanislav.', 0Ah\n\tdb\t'All rights reserved.', 0Ah\nusg\tdb\t'Usage: ftuc filename', 0Ah\nusglen\tequ\t$-usg\nco\tdb\t\"ftuc: Can't open file.\", 0Ah\ncolen\tequ\t$-co\nfae\tdb\t'ftuc: File access error.', 0Ah\nfaelen\tequ\t$-fae\nftl\tdb\t'ftuc: File too long, use regular tuc instead.', 0Ah\nftllen\tequ\t$-ftl\nmae\tdb\t'ftuc: Memory allocation error.', 0Ah\nmaelen\tequ\t$-mae\n\nsection\t.text\n\nalign 4\nmemerr:\n\tpush\tdword maelen\n\tpush\tdword mae\n\tjmp\tshort error\n\nalign 4\ntoolong:\n\tpush\tdword ftllen\n\tpush\tdword ftl\n\tjmp\tshort error\n\nalign 4\nfacerr:\n\tpush\tdword faelen\n\tpush\tdword fae\n\tjmp\tshort error\n\nalign 4\ncantopen:\n\tpush\tdword colen\n\tpush\tdword co\n\tjmp\tshort error\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\nerror:\n\tpush\tdword stderr\n\tsys.write\n\n\tpush\tdword 1\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tpop\teax\t\t; argc\n\tpop\teax\t\t; program name\n\tpop\tecx\t\t; file to convert\n\tjecxz\tusage\n\n\tpop\teax\n\tor\teax, eax\t; Too many arguments?\n\tjne\tusage\n\n\t; Open the file\n\tpush\tdword O_RDWR\n\tpush\tecx\n\tsys.open\n\tjc\tcantopen\n\n\tmov\tebp, eax\t; Save fd\n\n\tsub\tesp, byte stat_size\n\tmov\tebx, esp\n\n\t; Find file size\n\tpush\tebx\n\tpush\tebp\t\t; fd\n\tsys.fstat\n\tjc\tfacerr\n\n\tmov\tedx, [ebx + st_size + 4]\n\n\t; File is too long if EDX != 0 ...\n\tor\tedx, edx\n\tjne\tnear toolong\n\tmov\tecx, [ebx + st_size]\n\t; ... or if it is above 2 GB\n\tor\tecx, ecx\n\tjs\tnear toolong\n\n\t; Do nothing if the file is 0 bytes in size\n\tjecxz\t.quit\n\n\t; Map the entire file in memory\n\tpush\tedx\n\tpush\tedx\t\t; starting at offset 0\n\tpush\tedx\t\t; pad\n\tpush\tebp\t\t; fd\n\tpush\tdword MAP_SHARED\n\tpush\tdword PROT_READ | PROT_WRITE\n\tpush\tecx\t\t; entire file size\n\tpush\tedx\t\t; let system decide on the address\n\tsys.mmap\n\tjc\tnear memerr\n\n\tmov\tedi, eax\n\tmov\tesi, eax\n\tpush\tecx\t\t; for SYS_munmap\n\tpush\tedi\n\n\t; Use EBX for state machine\n\tmov\tebx, ordinary\n\tmov\tah, 0Ah\n\tcld\n\n.loop:\n\tlodsb\n\tcall\tebx\n\tloop\t.loop\n\n\tcmp\tebx, ordinary\n\tje\t.filesize\n\n\t; Output final lf\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\n.filesize:\n\t; truncate file to new size\n\tpush\tdword 0\t\t; high dword\n\tpush\tedx\t\t; low dword\n\tpush\teax\t\t; pad\n\tpush\tebp\n\tsys.ftruncate\n\n\t; close it (ebp still pushed)\n\tsys.close\n\n\tadd\tesp, byte 16\n\tsys.munmap\n\n.quit:\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nordinary:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, cr\n\tret\n\nalign 4\n.lf:\n\tmov\tebx, lf\n\tret\n\nalign 4\ncr:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\nlf:\n\tcmp\tal, ah\n\tje\t.lf\n\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, ordinary\n\tmov\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tret"
            ],
            "previous_source": "",
            "target": [
                ";;;;;;; Fast Text-to-Unix Conversion (ftuc.asm) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Started:\t21-Dec-2000\n;; Updated:\t22-Dec-2000\n;;\n;; Copyright 2000 G. Adam Stanislav.\n;; All rights reserved.\n;;\n;;;;;;; v.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n%include\t'system.inc'\n\nsection\t.data\n\tdb\t'Copyright 2000 G. Adam Stanislav.', 0Ah\n\tdb\t'All rights reserved.', 0Ah\nusg\tdb\t'Usage: ftuc filename', 0Ah\nusglen\tequ\t$-usg\nco\tdb\t\"ftuc: Can't open file.\", 0Ah\ncolen\tequ\t$-co\nfae\tdb\t'ftuc: File access error.', 0Ah\nfaelen\tequ\t$-fae\nftl\tdb\t'ftuc: File too long, use regular tuc instead.', 0Ah\nftllen\tequ\t$-ftl\nmae\tdb\t'ftuc: Memory allocation error.', 0Ah\nmaelen\tequ\t$-mae\n\nsection\t.text\n\nalign 4\nmemerr:\n\tpush\tdword maelen\n\tpush\tdword mae\n\tjmp\tshort error\n\nalign 4\ntoolong:\n\tpush\tdword ftllen\n\tpush\tdword ftl\n\tjmp\tshort error\n\nalign 4\nfacerr:\n\tpush\tdword faelen\n\tpush\tdword fae\n\tjmp\tshort error\n\nalign 4\ncantopen:\n\tpush\tdword colen\n\tpush\tdword co\n\tjmp\tshort error\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\nerror:\n\tpush\tdword stderr\n\tsys.write\n\n\tpush\tdword 1\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tpop\teax\t\t; argc\n\tpop\teax\t\t; program name\n\tpop\tecx\t\t; file to convert\n\tjecxz\tusage\n\n\tpop\teax\n\tor\teax, eax\t; Too many arguments?\n\tjne\tusage\n\n\t; Open the file\n\tpush\tdword O_RDWR\n\tpush\tecx\n\tsys.open\n\tjc\tcantopen\n\n\tmov\tebp, eax\t; Save fd\n\n\tsub\tesp, byte stat_size\n\tmov\tebx, esp\n\n\t; Find file size\n\tpush\tebx\n\tpush\tebp\t\t; fd\n\tsys.fstat\n\tjc\tfacerr\n\n\tmov\tedx, [ebx + st_size + 4]\n\n\t; File is too long if EDX != 0 ...\n\tor\tedx, edx\n\tjne\tnear toolong\n\tmov\tecx, [ebx + st_size]\n\t; ... or if it is above 2 GB\n\tor\tecx, ecx\n\tjs\tnear toolong\n\n\t; Do nothing if the file is 0 bytes in size\n\tjecxz\t.quit\n\n\t; Map the entire file in memory\n\tpush\tedx\n\tpush\tedx\t\t; starting at offset 0\n\tpush\tedx\t\t; pad\n\tpush\tebp\t\t; fd\n\tpush\tdword MAP_SHARED\n\tpush\tdword PROT_READ | PROT_WRITE\n\tpush\tecx\t\t; entire file size\n\tpush\tedx\t\t; let system decide on the address\n\tsys.mmap\n\tjc\tnear memerr\n\n\tmov\tedi, eax\n\tmov\tesi, eax\n\tpush\tecx\t\t; for SYS_munmap\n\tpush\tedi\n\n\t; Use EBX for state machine\n\tmov\tebx, ordinary\n\tmov\tah, 0Ah\n\tcld\n\n.loop:\n\tlodsb\n\tcall\tebx\n\tloop\t.loop\n\n\tcmp\tebx, ordinary\n\tje\t.filesize\n\n\t; Output final lf\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\n.filesize:\n\t; truncate file to new size\n\tpush\tdword 0\t\t; high dword\n\tpush\tedx\t\t; low dword\n\tpush\teax\t\t; pad\n\tpush\tebp\n\tsys.ftruncate\n\n\t; close it (ebp still pushed)\n\tsys.close\n\n\tadd\tesp, byte 16\n\tsys.munmap\n\n.quit:\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nordinary:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, cr\n\tret\n\nalign 4\n.lf:\n\tmov\tebx, lf\n\tret\n\nalign 4\ncr:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\nlf:\n\tcmp\tal, ah\n\tje\t.lf\n\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, ordinary\n\tmov\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tret"
            ],
            "id_hash": 5754640110954855985,
            "content_hash": 5754640110954855985,
            "location": "book.translate.xml:11843",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1900,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 552,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92241/?format=api",
            "priority": 100,
            "id": 92241,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=cfdc96b107adbe31",
            "url": "https://translate-dev.freebsd.org/api/units/92241/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.639799Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                ";;;;;;; csv.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Convert a comma-separated file to a something-else separated file.\n;\n; Started:\t31-May-2001\n; Updated:\t 1-Jun-2001\n;\n; Copyright (c) 2001 G. Adam Stanislav\n; All rights reserved.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nusg\tdb\t'Usage: csv [-t&lt;delim&gt;] [-c&lt;comma&gt;] [-p] [-o &lt;outfile&gt;] [-i &lt;infile&gt;]', 0Ah\nusglen\tequ\t$-usg\niemsg\tdb\t\"csv: Can't open input file\", 0Ah\niemlen\tequ\t$-iemsg\noemsg\tdb\t\"csv: Can't create output file\", 0Ah\noemlen\tequ\t$-oemsg\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nalign 4\nierr:\n\tpush\tdword iemlen\n\tpush\tdword iemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\noerr:\n\tpush\tdword oemlen\n\tpush\tdword oemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 2\n\tsys.exit\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 3\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\tmov\tedx, (',' &lt;&lt; 8) | 9\n\n.arg:\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear .init\t\t; no more arguments\n\n\t; ECX contains the pointer to an argument\n\tcmp\tbyte [ecx], '-'\n\tjne\tusage\n\n\tinc\tecx\n\tmov\tax, [ecx]\n\n.o:\n\tcmp\tal, 'o'\n\tjne\t.i\n\n\t; Make sure we are not asked for the output file twice\n\tcmp\tdword [fd.out], stdout\n\tjne\tusage\n\n\t; Find the path to output file - it is either at [ECX+1],\n\t; i.e., -ofile --\n\t; or in the next argument,\n\t; i.e., -o file\n\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openoutput\n\tpop\tecx\n\tjecxz\tusage\n\n.openoutput:\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear oerr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\tjmp\tshort .arg\n\n.i:\n\tcmp\tal, 'i'\n\tjne\t.p\n\n\t; Make sure we are not asked twice\n\tcmp\tdword [fd.in], stdin\n\tjne\tnear usage\n\n\t; Find the path to the input file\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openinput\n\tpop\tecx\n\tor\tecx, ecx\n\tje near usage\n\n.openinput:\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear ierr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\tjmp\t.arg\n\n.p:\n\tcmp\tal, 'p'\n\tjne\t.t\n\tor\tah, ah\n\tjne\tnear usage\n\tor\tedx, 1 &lt;&lt; 31\n\tjmp\t.arg\n\n.t:\n\tcmp\tal, 't'\t\t; redefine output delimiter\n\tjne\t.c\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdl, ah\n\tjmp\t.arg\n\n.c:\n\tcmp\tal, 'c'\n\tjne\tnear usage\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdh, ah\n\tjmp\t.arg\n\nalign 4\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n\t; See if we are to preserve the first line\n\tor\tedx, edx\n\tjs\t.loop\n\n.firstline:\n\t; get rid of the first line\n\tcall\tgetchar\n\tcmp\tal, 0Ah\n\tjne\t.firstline\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; is it a comma (or whatever the user asked for)?\n\tcmp\tal, dh\n\tjne\t.quote\n\n\t; Replace the comma with a tab (or whatever the user wants)\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tjmp\tshort .loop\n\n.quote:\n\tcmp\tal, '\"'\n\tjne\t.put\n\n\t; Print everything until you get another quote or EOL. If it\n\t; is a quote, skip it. If it is EOL, print it.\n.qloop:\n\tcall\tgetchar\n\tcmp\tal, '\"'\n\tje\t.loop\n\n\tcmp\tal, 0Ah\n\tje\t.put\n\n\tcall\tputchar\n\tjmp\tshort .qloop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tjecxz\t.read\n\tcall\twrite\n\n.read:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tjecxz\t.ret\t; nothing to write\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n.ret:\n\tret"
            ],
            "previous_source": "",
            "target": [
                ";;;;;;; csv.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Convert a comma-separated file to a something-else separated file.\n;\n; Started:\t31-May-2001\n; Updated:\t 1-Jun-2001\n;\n; Copyright (c) 2001 G. Adam Stanislav\n; All rights reserved.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nusg\tdb\t'Usage: csv [-t&lt;delim&gt;] [-c&lt;comma&gt;] [-p] [-o &lt;outfile&gt;] [-i &lt;infile&gt;]', 0Ah\nusglen\tequ\t$-usg\niemsg\tdb\t\"csv: Can't open input file\", 0Ah\niemlen\tequ\t$-iemsg\noemsg\tdb\t\"csv: Can't create output file\", 0Ah\noemlen\tequ\t$-oemsg\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nalign 4\nierr:\n\tpush\tdword iemlen\n\tpush\tdword iemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\noerr:\n\tpush\tdword oemlen\n\tpush\tdword oemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 2\n\tsys.exit\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 3\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\tmov\tedx, (',' &lt;&lt; 8) | 9\n\n.arg:\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear .init\t\t; no more arguments\n\n\t; ECX contains the pointer to an argument\n\tcmp\tbyte [ecx], '-'\n\tjne\tusage\n\n\tinc\tecx\n\tmov\tax, [ecx]\n\n.o:\n\tcmp\tal, 'o'\n\tjne\t.i\n\n\t; Make sure we are not asked for the output file twice\n\tcmp\tdword [fd.out], stdout\n\tjne\tusage\n\n\t; Find the path to output file - it is either at [ECX+1],\n\t; i.e., -ofile --\n\t; or in the next argument,\n\t; i.e., -o file\n\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openoutput\n\tpop\tecx\n\tjecxz\tusage\n\n.openoutput:\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear oerr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\tjmp\tshort .arg\n\n.i:\n\tcmp\tal, 'i'\n\tjne\t.p\n\n\t; Make sure we are not asked twice\n\tcmp\tdword [fd.in], stdin\n\tjne\tnear usage\n\n\t; Find the path to the input file\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openinput\n\tpop\tecx\n\tor\tecx, ecx\n\tje near usage\n\n.openinput:\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear ierr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\tjmp\t.arg\n\n.p:\n\tcmp\tal, 'p'\n\tjne\t.t\n\tor\tah, ah\n\tjne\tnear usage\n\tor\tedx, 1 &lt;&lt; 31\n\tjmp\t.arg\n\n.t:\n\tcmp\tal, 't'\t\t; redefine output delimiter\n\tjne\t.c\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdl, ah\n\tjmp\t.arg\n\n.c:\n\tcmp\tal, 'c'\n\tjne\tnear usage\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdh, ah\n\tjmp\t.arg\n\nalign 4\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n\t; See if we are to preserve the first line\n\tor\tedx, edx\n\tjs\t.loop\n\n.firstline:\n\t; get rid of the first line\n\tcall\tgetchar\n\tcmp\tal, 0Ah\n\tjne\t.firstline\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; is it a comma (or whatever the user asked for)?\n\tcmp\tal, dh\n\tjne\t.quote\n\n\t; Replace the comma with a tab (or whatever the user wants)\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tjmp\tshort .loop\n\n.quote:\n\tcmp\tal, '\"'\n\tjne\t.put\n\n\t; Print everything until you get another quote or EOL. If it\n\t; is a quote, skip it. If it is EOL, print it.\n.qloop:\n\tcall\tgetchar\n\tcmp\tal, '\"'\n\tje\t.loop\n\n\tcmp\tal, 0Ah\n\tje\t.put\n\n\tcall\tputchar\n\tjmp\tshort .qloop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tjecxz\t.read\n\tcall\twrite\n\n.read:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tjecxz\t.ret\t; nothing to write\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n.ret:\n\tret"
            ],
            "id_hash": -8182750035476127133,
            "content_hash": -8182750035476127133,
            "location": "book.translate.xml:12236",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1934,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 696,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92242/?format=api",
            "priority": 100,
            "id": 92242,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=0e71083261a16263",
            "url": "https://translate-dev.freebsd.org/api/units/92242/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.722327Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                ".loop:\n\tcall\tgetchar\n\tnot\tal\t\t; Create a negative\n\tcall\tputchar\n\tjmp\tshort .loop"
            ],
            "previous_source": "",
            "target": [
                ".loop:\n\tcall\tgetchar\n\tnot\tal\t\t; Create a negative\n\tcall\tputchar\n\tjmp\tshort .loop"
            ],
            "id_hash": -4614635096083212615,
            "content_hash": -4614635096083212615,
            "location": "book.translate.xml:12547",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1942,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 14,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92243/?format=api",
            "priority": 100,
            "id": 92243,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=3ff585d459e8d6b9",
            "url": "https://translate-dev.freebsd.org/api/units/92243/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.755169Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "80 00 00 00 00 00 01 23 45 67"
            ],
            "previous_source": "",
            "target": [
                "80 00 00 00 00 00 01 23 45 67"
            ],
            "id_hash": 4257480877362303045,
            "content_hash": 4257480877362303045,
            "location": "book.translate.xml:12762",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1982,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 10,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92244/?format=api",
            "priority": 100,
            "id": 92244,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=bb159c4d0532d045",
            "url": "https://translate-dev.freebsd.org/api/units/92244/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.856408Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "67 45 23 01 00 00 00 00 00 80"
            ],
            "previous_source": "",
            "target": [
                "67 45 23 01 00 00 00 00 00 80"
            ],
            "id_hash": -6814448192950528907,
            "content_hash": -6814448192950528907,
            "location": "book.translate.xml:12771",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1985,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 10,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92245/?format=api",
            "priority": 100,
            "id": 92245,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=216e377916e19475",
            "url": "https://translate-dev.freebsd.org/api/units/92245/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.895920Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "D = PC * sqrt(FL)"
            ],
            "previous_source": "",
            "target": [
                "D = PC * sqrt(FL)"
            ],
            "id_hash": -973291066956308545,
            "content_hash": -973291066956308545,
            "location": "book.translate.xml:12849",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2001,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92246/?format=api",
            "priority": 100,
            "id": 92246,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=727e2cee6b021fbf",
            "url": "https://translate-dev.freebsd.org/api/units/92246/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.957732Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "The f–number is a very useful measure of how much light reaches the film. A light meter can determine that, for example, to expose a film of specific sensitivity with f5.6 mkay require the exposure to last 1/1000 sec."
            ],
            "previous_source": "",
            "target": [
                "The f–number is a very useful measure of how much light reaches the film. A light meter can determine that, for example, to expose a film of specific sensitivity with f5.6 mkay require the exposure to last 1/1000 sec."
            ],
            "id_hash": 7671784346225881900,
            "content_hash": 7671784346225881900,
            "location": "book.translate.xml:12866",
            "context": "",
            "note": "(itstool) path: sect3/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2004,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 39,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92247/?format=api",
            "priority": 100,
            "id": 92247,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=ea77a7374e32332c",
            "url": "https://translate-dev.freebsd.org/api/units/92247/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:24.992732Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "F = FL / D"
            ],
            "previous_source": "",
            "target": [
                "F = FL / D"
            ],
            "id_hash": -2461969592773891990,
            "content_hash": -2461969592773891990,
            "location": "book.translate.xml:12879",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2007,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92248/?format=api",
            "priority": 100,
            "id": 92248,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=5dd553b30ee6286a",
            "url": "https://translate-dev.freebsd.org/api/units/92248/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.016689Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "t * (B / A)²"
            ],
            "previous_source": "",
            "target": [
                "t * (B / A)²"
            ],
            "id_hash": -8513961542311573451,
            "content_hash": -8513961542311573451,
            "location": "book.translate.xml:12895",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2010,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92249/?format=api",
            "priority": 100,
            "id": 92249,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=09d855160f2e8835",
            "url": "https://translate-dev.freebsd.org/api/units/92249/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.041909Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "A more recently made camera may offer f–numbers of 2.8, 4, 5.6, 8, 11, 16, 22, and 32 (as well as others). These numbers were not chosen arbitrarily: They all are powers of the square root of 2, though they may be rounded somewha."
            ],
            "previous_source": "",
            "target": [
                "A more recently made camera may offer f–numbers of 2.8, 4, 5.6, 8, 11, 16, 22, and 32 (as well as others). These numbers were not chosen arbitrarily: They all are powers of the square root of 2, though they may be rounded somewha."
            ],
            "id_hash": 7699736890500657139,
            "content_hash": 7699736890500657139,
            "location": "book.translate.xml:12917",
            "context": "",
            "note": "(itstool) path: sect3/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2015,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 44,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92250/?format=api",
            "priority": 100,
            "id": 92250,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=eadaf5e82e432ff3",
            "url": "https://translate-dev.freebsd.org/api/units/92250/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.069859Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "<userinput>What is the best pinhole diameter for the\n\t    focal length of 150?</userinput>"
            ],
            "previous_source": "",
            "target": [
                "<userinput>What is the best pinhole diameter for the\n\t    focal length of 150?</userinput>"
            ],
            "id_hash": -9215921858638288051,
            "content_hash": -9215921858638288051,
            "location": "book.translate.xml:13018",
            "context": "",
            "note": "(itstool) path: sect3/screen",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2033,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 12,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92251/?format=api",
            "priority": 100,
            "id": 92251,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=001a77e5ca1b6b4d",
            "url": "https://translate-dev.freebsd.org/api/units/92251/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.107902Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "fmul\tst0, st0\n\tfld1\n\tfld\tst1\n\tfyl2x\n\tfrndint\n\tfld1\n\tfscale\n\tfsqrt\n\tfstp\tst1"
            ],
            "previous_source": "",
            "target": [
                "fmul\tst0, st0\n\tfld1\n\tfld\tst1\n\tfyl2x\n\tfrndint\n\tfld1\n\tfscale\n\tfsqrt\n\tfstp\tst1"
            ],
            "id_hash": -4091184502679007504,
            "content_hash": -4091184502679007504,
            "location": "book.translate.xml:13488",
            "context": "",
            "note": "(itstool) path: sect3/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2122,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 13,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92252/?format=api",
            "priority": 100,
            "id": 92252,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=4739315eef3c0ef0",
            "url": "https://translate-dev.freebsd.org/api/units/92252/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.237245Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "\tfld1\t\t\t; TOS =  1\n\tfadd\tst0, st0\t; TOS =  2\n\tfadd\tst0, st0\t; TOS =  4\n\tfld1\t\t\t; TOS =  1\n\tfaddp\tst1, st0\t; TOS =  5\n\tfchs\t\t\t; TOS = -5"
            ],
            "previous_source": "",
            "target": [
                "\tfld1\t\t\t; TOS =  1\n\tfadd\tst0, st0\t; TOS =  2\n\tfadd\tst0, st0\t; TOS =  4\n\tfld1\t\t\t; TOS =  1\n\tfaddp\tst1, st0\t; TOS =  5\n\tfchs\t\t\t; TOS = -5"
            ],
            "id_hash": -1868010080821691878,
            "content_hash": -1868010080821691878,
            "location": "book.translate.xml:13751",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2165,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 36,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92253/?format=api",
            "priority": 100,
            "id": 92253,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=66137eba87c63a1a",
            "url": "https://translate-dev.freebsd.org/api/units/92253/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.315384Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                ";;;;;;; pinhole.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Find various parameters of a pinhole camera construction and use\n;\n; Started:\t 9-Jun-2001\n; Updated:\t10-Jun-2001\n;\n; Copyright (c) 2001 G. Adam Stanislav\n; All rights reserved.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nalign 4\nten\tdd\t10\nthousand\tdd\t1000\ntthou\tdd\t10000\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nenvar\tdb\t'PINHOLE='\t; Exactly 8 bytes, or 2 dwords long\npinhole\tdb\t'04,', \t\t; Bender's constant (0.04)\nconnors\tdb\t'037', 0Ah\t; Connors' constant\nusg\tdb\t'Usage: pinhole [-b] [-c] [-e] [-p &lt;value&gt;] [-o &lt;outfile&gt;] [-i &lt;infile&gt;]', 0Ah\nusglen\tequ\t$-usg\niemsg\tdb\t\"pinhole: Can't open input file\", 0Ah\niemlen\tequ\t$-iemsg\noemsg\tdb\t\"pinhole: Can't create output file\", 0Ah\noemlen\tequ\t$-oemsg\npinmsg\tdb\t\"pinhole: The PINHOLE constant must not be 0\", 0Ah\npinlen\tequ\t$-pinmsg\ntoobig\tdb\t\"pinhole: The PINHOLE constant may not exceed 18 decimal places\", 0Ah\nbiglen\tequ\t$-toobig\nhuhmsg\tdb\t9, '???'\nsepar\tdb\t9, '???'\nsep2\tdb\t9, '???'\nsep3\tdb\t9, '???'\nsep4\tdb\t9, '???', 0Ah\nhuhlen\tequ\t$-huhmsg\nheader\tdb\t'focal length in millimeters,pinhole diameter in microns,'\n\tdb\t'F-number,normalized F-number,F-5.6 multiplier,stops '\n\tdb\t'from F-5.6', 0Ah\nheadlen\tequ\t$-header\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\ndbuffer\tresb\t20\t\t; decimal input buffer\nbbuffer\tresb\t10\t\t; BCD buffer\n\nsection\t.text\nalign 4\nhuh:\n\tcall\twrite\n\tpush\tdword huhlen\n\tpush\tdword huhmsg\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tret\n\nalign 4\nperr:\n\tpush\tdword pinlen\n\tpush\tdword pinmsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 4\t\t; return failure\n\tsys.exit\n\nalign 4\nconsttoobig:\n\tpush\tdword biglen\n\tpush\tdword toobig\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 5\t\t; return failure\n\tsys.exit\n\nalign 4\nierr:\n\tpush\tdword iemlen\n\tpush\tdword iemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\noerr:\n\tpush\tdword oemlen\n\tpush\tdword oemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 2\n\tsys.exit\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 3\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\tsub\tesi, esi\n\n.arg:\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear .getenv\t\t; no more arguments\n\n\t; ECX contains the pointer to an argument\n\tcmp\tbyte [ecx], '-'\n\tjne\tusage\n\n\tinc\tecx\n\tmov\tax, [ecx]\n\tinc\tecx\n\n.o:\n\tcmp\tal, 'o'\n\tjne\t.i\n\n\t; Make sure we are not asked for the output file twice\n\tcmp\tdword [fd.out], stdout\n\tjne\tusage\n\n\t; Find the path to output file - it is either at [ECX+1],\n\t; i.e., -ofile --\n\t; or in the next argument,\n\t; i.e., -o file\n\n\tor\tah, ah\n\tjne\t.openoutput\n\tpop\tecx\n\tjecxz\tusage\n\n.openoutput:\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear oerr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\tjmp\tshort .arg\n\n.i:\n\tcmp\tal, 'i'\n\tjne\t.p\n\n\t; Make sure we are not asked twice\n\tcmp\tdword [fd.in], stdin\n\tjne\tnear usage\n\n\t; Find the path to the input file\n\tor\tah, ah\n\tjne\t.openinput\n\tpop\tecx\n\tor\tecx, ecx\n\tje near usage\n\n.openinput:\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear ierr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\tjmp\t.arg\n\n.p:\n\tcmp\tal, 'p'\n\tjne\t.c\n\tor\tah, ah\n\tjne\t.pcheck\n\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear usage\n\n\tmov\tah, [ecx]\n\n.pcheck:\n\tcmp\tah, '0'\n\tjl\tnear usage\n\tcmp\tah, '9'\n\tja\tnear usage\n\tmov\tesi, ecx\n\tjmp\t.arg\n\n.c:\n\tcmp\tal, 'c'\n\tjne\t.b\n\tor\tah, ah\n\tjne\tnear usage\n\tmov\tesi, connors\n\tjmp\t.arg\n\n.b:\n\tcmp\tal, 'b'\n\tjne\t.e\n\tor\tah, ah\n\tjne\tnear usage\n\tmov\tesi, pinhole\n\tjmp\t.arg\n\n.e:\n\tcmp\tal, 'e'\n\tjne\tnear usage\n\tor\tah, ah\n\tjne\tnear usage\n\tmov\tal, ','\n\tmov\t[huhmsg], al\n\tmov\t[separ], al\n\tmov\t[sep2], al\n\tmov\t[sep3], al\n\tmov\t[sep4], al\n\tjmp\t.arg\n\nalign 4\n.getenv:\n\t; If ESI = 0, we did not have a -p argument,\n\t; and need to check the environment for \"PINHOLE=\"\n\tor\tesi, esi\n\tjne\t.init\n\n\tsub\tecx, ecx\n\n.nextenv:\n\tpop\tesi\n\tor\tesi, esi\n\tje\t.default\t; no PINHOLE envar found\n\n\t; check if this envar starts with 'PINHOLE='\n\tmov\tedi, envar\n\tmov\tcl, 2\t\t; 'PINHOLE=' is 2 dwords long\nrep\tcmpsd\n\tjne\t.nextenv\n\n\t; Check if it is followed by a digit\n\tmov\tal, [esi]\n\tcmp\tal, '0'\n\tjl\t.default\n\tcmp\tal, '9'\n\tjbe\t.init\n\t; fall through\n\nalign 4\n.default:\n\t; We got here because we had no -p argument,\n\t; and did not find the PINHOLE envar.\n\tmov\tesi, pinhole\n\t; fall through\n\nalign 4\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tsub\tedx, edx\n\tmov\tedi, dbuffer+1\n\tmov\tbyte [dbuffer], '0'\n\n\t; Convert the pinhole constant to real\n.constloop:\n\tlodsb\n\tcmp\tal, '9'\n\tja\t.setconst\n\tcmp\tal, '0'\n\tje\t.processconst\n\tjb\t.setconst\n\n\tinc\tdl\n\n.processconst:\n\tinc\tcl\n\tcmp\tcl, 18\n\tja\tnear consttoobig\n\tstosb\n\tjmp\tshort .constloop\n\nalign 4\n.setconst:\n\tor\tdl, dl\n\tje\tnear perr\n\n\tfinit\n\tfild\tdword [tthou]\n\n\tfld1\n\tfild\tdword [ten]\n\tfdivp\tst1, st0\n\n\tfild\tdword [thousand]\n\tmov\tedi, obuffer\n\n\tmov\tebp, ecx\n\tcall\tbcdload\n\n.constdiv:\n\tfmul\tst0, st2\n\tloop\t.constdiv\n\n\tfld1\n\tfadd\tst0, st0\n\tfadd\tst0, st0\n\tfld1\n\tfaddp\tst1, st0\n\tfchs\n\n\t; If we are creating a CSV file,\n\t; print header\n\tcmp\tbyte [separ], ','\n\tjne\t.bigloop\n\n\tpush\tdword headlen\n\tpush\tdword header\n\tpush\tdword [fd.out]\n\tsys.write\n\n.bigloop:\n\tcall\tgetchar\n\tjc\tnear done\n\n\t; Skip to the end of the line if you got '#'\n\tcmp\tal, '#'\n\tjne\t.num\n\tcall\tskiptoeol\n\tjmp\tshort .bigloop\n\n.num:\n\t; See if you got a number\n\tcmp\tal, '0'\n\tjl\t.bigloop\n\tcmp\tal, '9'\n\tja\t.bigloop\n\n\t; Yes, we have a number\n\tsub\tebp, ebp\n\tsub\tedx, edx\n\n.number:\n\tcmp\tal, '0'\n\tje\t.number0\n\tmov\tdl, 1\n\n.number0:\n\tor\tdl, dl\t\t; Skip leading 0's\n\tje\t.nextnumber\n\tpush\teax\n\tcall\tputchar\n\tpop\teax\n\tinc\tebp\n\tcmp\tebp, 19\n\tjae\t.nextnumber\n\tmov\t[dbuffer+ebp], al\n\n.nextnumber:\n\tcall\tgetchar\n\tjc\t.work\n\tcmp\tal, '#'\n\tje\t.ungetc\n\tcmp\tal, '0'\n\tjl\t.work\n\tcmp\tal, '9'\n\tja\t.work\n\tjmp\tshort .number\n\n.ungetc:\n\tdec\tesi\n\tinc\tebx\n\n.work:\n\t; Now, do all the work\n\tor\tdl, dl\n\tje\tnear .work0\n\n\tcmp\tebp, 19\n\tjae\tnear .toobig\n\n\tcall\tbcdload\n\n\t; Calculate pinhole diameter\n\n\tfld\tst0\t; save it\n\tfsqrt\n\tfmul\tst0, st3\n\tfld\tst0\n\tfmul\tst5\n\tsub\tebp, ebp\n\n\t; Round off to 4 significant digits\n.diameter:\n\tfcom\tst0, st7\n\tfstsw\tax\n\tsahf\n\tjb\t.printdiameter\n\tfmul\tst0, st6\n\tinc\tebp\n\tjmp\tshort .diameter\n\n.printdiameter:\n\tcall\tprintnumber\t; pinhole diameter\n\n\t; Calculate F-number\n\n\tfdivp\tst1, st0\n\tfld\tst0\n\n\tsub\tebp, ebp\n\n.fnumber:\n\tfcom\tst0, st6\n\tfstsw\tax\n\tsahf\n\tjb\t.printfnumber\n\tfmul\tst0, st5\n\tinc\tebp\n\tjmp\tshort .fnumber\n\n.printfnumber:\n\tcall\tprintnumber\t; F number\n\n\t; Calculate normalized F-number\n\tfmul\tst0, st0\n\tfld1\n\tfld\tst1\n\tfyl2x\n\tfrndint\n\tfld1\n\tfscale\n\tfsqrt\n\tfstp\tst1\n\n\tsub\tebp, ebp\n\tcall\tprintnumber\n\n\t; Calculate time multiplier from F-5.6\n\n\tfscale\n\tfld\tst0\n\n\t; Round off to 4 significant digits\n.fmul:\n\tfcom\tst0, st6\n\tfstsw\tax\n\tsahf\n\n\tjb\t.printfmul\n\tinc\tebp\n\tfmul\tst0, st5\n\tjmp\tshort .fmul\n\n.printfmul:\n\tcall\tprintnumber\t; F multiplier\n\n\t; Calculate F-stops from 5.6\n\n\tfld1\n\tfxch\tst1\n\tfyl2x\n\n\tsub\tebp, ebp\n\tcall\tprintnumber\n\n\tmov\tal, 0Ah\n\tcall\tputchar\n\tjmp\t.bigloop\n\n.work0:\n\tmov\tal, '0'\n\tcall\tputchar\n\nalign 4\n.toobig:\n\tcall\thuh\n\tjmp\t.bigloop\n\nalign 4\ndone:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\tfinit\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nskiptoeol:\n\t; Keep reading until you come to cr, lf, or eof\n\tcall\tgetchar\n\tjc\tdone\n\tcmp\tal, 0Ah\n\tjne\t.cr\n\tret\n\n.cr:\n\tcmp\tal, 0Dh\n\tjne\tskiptoeol\n\tret\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tclc\n\tret\n\nread:\n\tjecxz\t.read\n\tcall\twrite\n\n.read:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.empty\n\tsub\teax, eax\n\tret\n\nalign 4\n.empty:\n\tadd\tesp, byte 4\n\tstc\n\tret\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tjecxz\t.ret\t; nothing to write\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n.ret:\n\tret\n\nalign 4\nbcdload:\n\t; EBP contains the number of chars in dbuffer\n\tpush\tecx\n\tpush\tesi\n\tpush\tedi\n\n\tlea\tecx, [ebp+1]\n\tlea\tesi, [dbuffer+ebp-1]\n\tshr\tecx, 1\n\n\tstd\n\n\tmov\tedi, bbuffer\n\tsub\teax, eax\n\tmov\t[edi], eax\n\tmov\t[edi+4], eax\n\tmov\t[edi+2], ax\n\n.loop:\n\tlodsw\n\tsub\tax, 3030h\n\tshl\tal, 4\n\tor\tal, ah\n\tmov\t[edi], al\n\tinc\tedi\n\tloop\t.loop\n\n\tfbld\t[bbuffer]\n\n\tcld\n\tpop\tedi\n\tpop\tesi\n\tpop\tecx\n\tsub\teax, eax\n\tret\n\nalign 4\nprintnumber:\n\tpush\tebp\n\tmov\tal, [separ]\n\tcall\tputchar\n\n\t; Print the integer at the TOS\n\tmov\tebp, bbuffer+9\n\tfbstp\t[bbuffer]\n\n\t; Check the sign\n\tmov\tal, [ebp]\n\tdec\tebp\n\tor\tal, al\n\tjns\t.leading\n\n\t; We got a negative number (should never happen)\n\tmov\tal, '-'\n\tcall\tputchar\n\n.leading:\n\t; Skip leading zeros\n\tmov\tal, [ebp]\n\tdec\tebp\n\tor\tal, al\n\tjne\t.first\n\tcmp\tebp, bbuffer\n\tjae\t.leading\n\n\t; We are here because the result was 0.\n\t; Print '0' and return\n\tmov\tal, '0'\n\tjmp\tputchar\n\n.first:\n\t; We have found the first non-zero.\n\t; But it is still packed\n\ttest\tal, 0F0h\n\tjz\t.second\n\tpush\teax\n\tshr\tal, 4\n\tadd\tal, '0'\n\tcall\tputchar\n\tpop\teax\n\tand\tal, 0Fh\n\n.second:\n\tadd\tal, '0'\n\tcall\tputchar\n\n.next:\n\tcmp\tebp, bbuffer\n\tjb\t.done\n\n\tmov\tal, [ebp]\n\tpush\teax\n\tshr\tal, 4\n\tadd\tal, '0'\n\tcall\tputchar\n\tpop\teax\n\tand\tal, 0Fh\n\tadd\tal, '0'\n\tcall\tputchar\n\n\tdec\tebp\n\tjmp\tshort .next\n\n.done:\n\tpop\tebp\n\tor\tebp, ebp\n\tje\t.ret\n\n.zeros:\n\tmov\tal, '0'\n\tcall\tputchar\n\tdec\tebp\n\tjne\t.zeros\n\n.ret:\n\tret"
            ],
            "previous_source": "",
            "target": [
                ";;;;;;; pinhole.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Find various parameters of a pinhole camera construction and use\n;\n; Started:\t 9-Jun-2001\n; Updated:\t10-Jun-2001\n;\n; Copyright (c) 2001 G. Adam Stanislav\n; All rights reserved.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nalign 4\nten\tdd\t10\nthousand\tdd\t1000\ntthou\tdd\t10000\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nenvar\tdb\t'PINHOLE='\t; Exactly 8 bytes, or 2 dwords long\npinhole\tdb\t'04,', \t\t; Bender's constant (0.04)\nconnors\tdb\t'037', 0Ah\t; Connors' constant\nusg\tdb\t'Usage: pinhole [-b] [-c] [-e] [-p &lt;value&gt;] [-o &lt;outfile&gt;] [-i &lt;infile&gt;]', 0Ah\nusglen\tequ\t$-usg\niemsg\tdb\t\"pinhole: Can't open input file\", 0Ah\niemlen\tequ\t$-iemsg\noemsg\tdb\t\"pinhole: Can't create output file\", 0Ah\noemlen\tequ\t$-oemsg\npinmsg\tdb\t\"pinhole: The PINHOLE constant must not be 0\", 0Ah\npinlen\tequ\t$-pinmsg\ntoobig\tdb\t\"pinhole: The PINHOLE constant may not exceed 18 decimal places\", 0Ah\nbiglen\tequ\t$-toobig\nhuhmsg\tdb\t9, '???'\nsepar\tdb\t9, '???'\nsep2\tdb\t9, '???'\nsep3\tdb\t9, '???'\nsep4\tdb\t9, '???', 0Ah\nhuhlen\tequ\t$-huhmsg\nheader\tdb\t'focal length in millimeters,pinhole diameter in microns,'\n\tdb\t'F-number,normalized F-number,F-5.6 multiplier,stops '\n\tdb\t'from F-5.6', 0Ah\nheadlen\tequ\t$-header\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\ndbuffer\tresb\t20\t\t; decimal input buffer\nbbuffer\tresb\t10\t\t; BCD buffer\n\nsection\t.text\nalign 4\nhuh:\n\tcall\twrite\n\tpush\tdword huhlen\n\tpush\tdword huhmsg\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tret\n\nalign 4\nperr:\n\tpush\tdword pinlen\n\tpush\tdword pinmsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 4\t\t; return failure\n\tsys.exit\n\nalign 4\nconsttoobig:\n\tpush\tdword biglen\n\tpush\tdword toobig\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 5\t\t; return failure\n\tsys.exit\n\nalign 4\nierr:\n\tpush\tdword iemlen\n\tpush\tdword iemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\noerr:\n\tpush\tdword oemlen\n\tpush\tdword oemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 2\n\tsys.exit\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 3\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\tsub\tesi, esi\n\n.arg:\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear .getenv\t\t; no more arguments\n\n\t; ECX contains the pointer to an argument\n\tcmp\tbyte [ecx], '-'\n\tjne\tusage\n\n\tinc\tecx\n\tmov\tax, [ecx]\n\tinc\tecx\n\n.o:\n\tcmp\tal, 'o'\n\tjne\t.i\n\n\t; Make sure we are not asked for the output file twice\n\tcmp\tdword [fd.out], stdout\n\tjne\tusage\n\n\t; Find the path to output file - it is either at [ECX+1],\n\t; i.e., -ofile --\n\t; or in the next argument,\n\t; i.e., -o file\n\n\tor\tah, ah\n\tjne\t.openoutput\n\tpop\tecx\n\tjecxz\tusage\n\n.openoutput:\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear oerr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\tjmp\tshort .arg\n\n.i:\n\tcmp\tal, 'i'\n\tjne\t.p\n\n\t; Make sure we are not asked twice\n\tcmp\tdword [fd.in], stdin\n\tjne\tnear usage\n\n\t; Find the path to the input file\n\tor\tah, ah\n\tjne\t.openinput\n\tpop\tecx\n\tor\tecx, ecx\n\tje near usage\n\n.openinput:\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear ierr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\tjmp\t.arg\n\n.p:\n\tcmp\tal, 'p'\n\tjne\t.c\n\tor\tah, ah\n\tjne\t.pcheck\n\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear usage\n\n\tmov\tah, [ecx]\n\n.pcheck:\n\tcmp\tah, '0'\n\tjl\tnear usage\n\tcmp\tah, '9'\n\tja\tnear usage\n\tmov\tesi, ecx\n\tjmp\t.arg\n\n.c:\n\tcmp\tal, 'c'\n\tjne\t.b\n\tor\tah, ah\n\tjne\tnear usage\n\tmov\tesi, connors\n\tjmp\t.arg\n\n.b:\n\tcmp\tal, 'b'\n\tjne\t.e\n\tor\tah, ah\n\tjne\tnear usage\n\tmov\tesi, pinhole\n\tjmp\t.arg\n\n.e:\n\tcmp\tal, 'e'\n\tjne\tnear usage\n\tor\tah, ah\n\tjne\tnear usage\n\tmov\tal, ','\n\tmov\t[huhmsg], al\n\tmov\t[separ], al\n\tmov\t[sep2], al\n\tmov\t[sep3], al\n\tmov\t[sep4], al\n\tjmp\t.arg\n\nalign 4\n.getenv:\n\t; If ESI = 0, we did not have a -p argument,\n\t; and need to check the environment for \"PINHOLE=\"\n\tor\tesi, esi\n\tjne\t.init\n\n\tsub\tecx, ecx\n\n.nextenv:\n\tpop\tesi\n\tor\tesi, esi\n\tje\t.default\t; no PINHOLE envar found\n\n\t; check if this envar starts with 'PINHOLE='\n\tmov\tedi, envar\n\tmov\tcl, 2\t\t; 'PINHOLE=' is 2 dwords long\nrep\tcmpsd\n\tjne\t.nextenv\n\n\t; Check if it is followed by a digit\n\tmov\tal, [esi]\n\tcmp\tal, '0'\n\tjl\t.default\n\tcmp\tal, '9'\n\tjbe\t.init\n\t; fall through\n\nalign 4\n.default:\n\t; We got here because we had no -p argument,\n\t; and did not find the PINHOLE envar.\n\tmov\tesi, pinhole\n\t; fall through\n\nalign 4\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tsub\tedx, edx\n\tmov\tedi, dbuffer+1\n\tmov\tbyte [dbuffer], '0'\n\n\t; Convert the pinhole constant to real\n.constloop:\n\tlodsb\n\tcmp\tal, '9'\n\tja\t.setconst\n\tcmp\tal, '0'\n\tje\t.processconst\n\tjb\t.setconst\n\n\tinc\tdl\n\n.processconst:\n\tinc\tcl\n\tcmp\tcl, 18\n\tja\tnear consttoobig\n\tstosb\n\tjmp\tshort .constloop\n\nalign 4\n.setconst:\n\tor\tdl, dl\n\tje\tnear perr\n\n\tfinit\n\tfild\tdword [tthou]\n\n\tfld1\n\tfild\tdword [ten]\n\tfdivp\tst1, st0\n\n\tfild\tdword [thousand]\n\tmov\tedi, obuffer\n\n\tmov\tebp, ecx\n\tcall\tbcdload\n\n.constdiv:\n\tfmul\tst0, st2\n\tloop\t.constdiv\n\n\tfld1\n\tfadd\tst0, st0\n\tfadd\tst0, st0\n\tfld1\n\tfaddp\tst1, st0\n\tfchs\n\n\t; If we are creating a CSV file,\n\t; print header\n\tcmp\tbyte [separ], ','\n\tjne\t.bigloop\n\n\tpush\tdword headlen\n\tpush\tdword header\n\tpush\tdword [fd.out]\n\tsys.write\n\n.bigloop:\n\tcall\tgetchar\n\tjc\tnear done\n\n\t; Skip to the end of the line if you got '#'\n\tcmp\tal, '#'\n\tjne\t.num\n\tcall\tskiptoeol\n\tjmp\tshort .bigloop\n\n.num:\n\t; See if you got a number\n\tcmp\tal, '0'\n\tjl\t.bigloop\n\tcmp\tal, '9'\n\tja\t.bigloop\n\n\t; Yes, we have a number\n\tsub\tebp, ebp\n\tsub\tedx, edx\n\n.number:\n\tcmp\tal, '0'\n\tje\t.number0\n\tmov\tdl, 1\n\n.number0:\n\tor\tdl, dl\t\t; Skip leading 0's\n\tje\t.nextnumber\n\tpush\teax\n\tcall\tputchar\n\tpop\teax\n\tinc\tebp\n\tcmp\tebp, 19\n\tjae\t.nextnumber\n\tmov\t[dbuffer+ebp], al\n\n.nextnumber:\n\tcall\tgetchar\n\tjc\t.work\n\tcmp\tal, '#'\n\tje\t.ungetc\n\tcmp\tal, '0'\n\tjl\t.work\n\tcmp\tal, '9'\n\tja\t.work\n\tjmp\tshort .number\n\n.ungetc:\n\tdec\tesi\n\tinc\tebx\n\n.work:\n\t; Now, do all the work\n\tor\tdl, dl\n\tje\tnear .work0\n\n\tcmp\tebp, 19\n\tjae\tnear .toobig\n\n\tcall\tbcdload\n\n\t; Calculate pinhole diameter\n\n\tfld\tst0\t; save it\n\tfsqrt\n\tfmul\tst0, st3\n\tfld\tst0\n\tfmul\tst5\n\tsub\tebp, ebp\n\n\t; Round off to 4 significant digits\n.diameter:\n\tfcom\tst0, st7\n\tfstsw\tax\n\tsahf\n\tjb\t.printdiameter\n\tfmul\tst0, st6\n\tinc\tebp\n\tjmp\tshort .diameter\n\n.printdiameter:\n\tcall\tprintnumber\t; pinhole diameter\n\n\t; Calculate F-number\n\n\tfdivp\tst1, st0\n\tfld\tst0\n\n\tsub\tebp, ebp\n\n.fnumber:\n\tfcom\tst0, st6\n\tfstsw\tax\n\tsahf\n\tjb\t.printfnumber\n\tfmul\tst0, st5\n\tinc\tebp\n\tjmp\tshort .fnumber\n\n.printfnumber:\n\tcall\tprintnumber\t; F number\n\n\t; Calculate normalized F-number\n\tfmul\tst0, st0\n\tfld1\n\tfld\tst1\n\tfyl2x\n\tfrndint\n\tfld1\n\tfscale\n\tfsqrt\n\tfstp\tst1\n\n\tsub\tebp, ebp\n\tcall\tprintnumber\n\n\t; Calculate time multiplier from F-5.6\n\n\tfscale\n\tfld\tst0\n\n\t; Round off to 4 significant digits\n.fmul:\n\tfcom\tst0, st6\n\tfstsw\tax\n\tsahf\n\n\tjb\t.printfmul\n\tinc\tebp\n\tfmul\tst0, st5\n\tjmp\tshort .fmul\n\n.printfmul:\n\tcall\tprintnumber\t; F multiplier\n\n\t; Calculate F-stops from 5.6\n\n\tfld1\n\tfxch\tst1\n\tfyl2x\n\n\tsub\tebp, ebp\n\tcall\tprintnumber\n\n\tmov\tal, 0Ah\n\tcall\tputchar\n\tjmp\t.bigloop\n\n.work0:\n\tmov\tal, '0'\n\tcall\tputchar\n\nalign 4\n.toobig:\n\tcall\thuh\n\tjmp\t.bigloop\n\nalign 4\ndone:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\tfinit\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nskiptoeol:\n\t; Keep reading until you come to cr, lf, or eof\n\tcall\tgetchar\n\tjc\tdone\n\tcmp\tal, 0Ah\n\tjne\t.cr\n\tret\n\n.cr:\n\tcmp\tal, 0Dh\n\tjne\tskiptoeol\n\tret\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tclc\n\tret\n\nread:\n\tjecxz\t.read\n\tcall\twrite\n\n.read:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.empty\n\tsub\teax, eax\n\tret\n\nalign 4\n.empty:\n\tadd\tesp, byte 4\n\tstc\n\tret\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tjecxz\t.ret\t; nothing to write\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n.ret:\n\tret\n\nalign 4\nbcdload:\n\t; EBP contains the number of chars in dbuffer\n\tpush\tecx\n\tpush\tesi\n\tpush\tedi\n\n\tlea\tecx, [ebp+1]\n\tlea\tesi, [dbuffer+ebp-1]\n\tshr\tecx, 1\n\n\tstd\n\n\tmov\tedi, bbuffer\n\tsub\teax, eax\n\tmov\t[edi], eax\n\tmov\t[edi+4], eax\n\tmov\t[edi+2], ax\n\n.loop:\n\tlodsw\n\tsub\tax, 3030h\n\tshl\tal, 4\n\tor\tal, ah\n\tmov\t[edi], al\n\tinc\tedi\n\tloop\t.loop\n\n\tfbld\t[bbuffer]\n\n\tcld\n\tpop\tedi\n\tpop\tesi\n\tpop\tecx\n\tsub\teax, eax\n\tret\n\nalign 4\nprintnumber:\n\tpush\tebp\n\tmov\tal, [separ]\n\tcall\tputchar\n\n\t; Print the integer at the TOS\n\tmov\tebp, bbuffer+9\n\tfbstp\t[bbuffer]\n\n\t; Check the sign\n\tmov\tal, [ebp]\n\tdec\tebp\n\tor\tal, al\n\tjns\t.leading\n\n\t; We got a negative number (should never happen)\n\tmov\tal, '-'\n\tcall\tputchar\n\n.leading:\n\t; Skip leading zeros\n\tmov\tal, [ebp]\n\tdec\tebp\n\tor\tal, al\n\tjne\t.first\n\tcmp\tebp, bbuffer\n\tjae\t.leading\n\n\t; We are here because the result was 0.\n\t; Print '0' and return\n\tmov\tal, '0'\n\tjmp\tputchar\n\n.first:\n\t; We have found the first non-zero.\n\t; But it is still packed\n\ttest\tal, 0F0h\n\tjz\t.second\n\tpush\teax\n\tshr\tal, 4\n\tadd\tal, '0'\n\tcall\tputchar\n\tpop\teax\n\tand\tal, 0Fh\n\n.second:\n\tadd\tal, '0'\n\tcall\tputchar\n\n.next:\n\tcmp\tebp, bbuffer\n\tjb\t.done\n\n\tmov\tal, [ebp]\n\tpush\teax\n\tshr\tal, 4\n\tadd\tal, '0'\n\tcall\tputchar\n\tpop\teax\n\tand\tal, 0Fh\n\tadd\tal, '0'\n\tcall\tputchar\n\n\tdec\tebp\n\tjmp\tshort .next\n\n.done:\n\tpop\tebp\n\tor\tebp, ebp\n\tje\t.ret\n\n.zeros:\n\tmov\tal, '0'\n\tcall\tputchar\n\tdec\tebp\n\tjne\t.zeros\n\n.ret:\n\tret"
            ],
            "id_hash": -5460198032763687273,
            "content_hash": -5460198032763687273,
            "location": "book.translate.xml:13774",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2169,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1662,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92254/?format=api",
            "priority": 100,
            "id": 92254,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=34397ad18dd56e97",
            "url": "https://translate-dev.freebsd.org/api/units/92254/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.361615Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "Everything else in this code should be quit eclear, providing you have read the entire chapter that precedes it."
            ],
            "previous_source": "",
            "target": [
                "Everything else in this code should be quit eclear, providing you have read the entire chapter that precedes it."
            ],
            "id_hash": -4253621096745808654,
            "content_hash": -4253621096745808654,
            "location": "book.translate.xml:14574",
            "context": "",
            "note": "(itstool) path: sect2/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2187,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 19,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92255/?format=api",
            "priority": 100,
            "id": 92255,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=44f81a262f5bccf2",
            "url": "https://translate-dev.freebsd.org/api/units/92255/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.402293Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "#! /bin/sh"
            ],
            "previous_source": "",
            "target": [
                "#! /bin/sh"
            ],
            "id_hash": -1434816266093792768,
            "content_hash": -1434816266093792768,
            "location": "book.translate.xml:14644",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2199,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 2,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92256/?format=api",
            "priority": 100,
            "id": 92256,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=6c1682353d86f200",
            "url": "https://translate-dev.freebsd.org/api/units/92256/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.434882Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "#!/bin/sh"
            ],
            "previous_source": "",
            "target": [
                "#!/bin/sh"
            ],
            "id_hash": -391901552249288753,
            "content_hash": -391901552249288753,
            "location": "book.translate.xml:14648",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2201,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92257/?format=api",
            "priority": 100,
            "id": 92257,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=7a8faf9d5741c7cf",
            "url": "https://translate-dev.freebsd.org/api/units/92257/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.449810Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "#! /usr/local/bin/pinhole -b -i\n# Find the best pinhole diameter\n# for the 120 film\n\n### Standard\n80\n\n### Wide angle\n30, 40, 50, 60, 70\n\n### Telephoto\n100, 120, 140"
            ],
            "previous_source": "",
            "target": [
                "#! /usr/local/bin/pinhole -b -i\n# Find the best pinhole diameter\n# for the 120 film\n\n### Standard\n80\n\n### Wide angle\n30, 40, 50, 60, 70\n\n### Telephoto\n100, 120, 140"
            ],
            "id_hash": -3051695231245900627,
            "content_hash": -3051695231245900627,
            "location": "book.translate.xml:14667",
            "context": "",
            "note": "(itstool) path: sect2/programlisting",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2206,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 31,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92258/?format=api",
            "priority": 100,
            "id": 92258,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=55a6335b12d5a4ad",
            "url": "https://translate-dev.freebsd.org/api/units/92258/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.492407Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "<emphasis><trademark class=\"registered\">UNIX</trademark> is an abstraction!</emphasis>"
            ],
            "previous_source": "",
            "target": [
                "<emphasis><trademark class=\"registered\">UNIX</trademark> is an abstraction!</emphasis>"
            ],
            "id_hash": -5705730748398477082,
            "content_hash": -5705730748398477082,
            "location": "book.translate.xml:14793",
            "context": "",
            "note": "(itstool) path: sect2/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2231,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92259/?format=api",
            "priority": 100,
            "id": 92259,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=30d12c1d55af60e6",
            "url": "https://translate-dev.freebsd.org/api/units/92259/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.575862Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "Thomas M. Sommers opened the door for me . His <link xlink:href=\"https://web.archive.org/web/20090914064615/http://www.codebreakers-journal.com/content/view/262/27\">How do I write \"Hello, world\" in FreeBSD assembler?</link> web page was my first encounter with an example of assembly language programming under FreeBSD."
            ],
            "previous_source": "",
            "target": [
                "Thomas M. Sommers opened the door for me . His <link xlink:href=\"https://web.archive.org/web/20090914064615/http://www.codebreakers-journal.com/content/view/262/27\">How do I write \"Hello, world\" in FreeBSD assembler?</link> web page was my first encounter with an example of assembly language programming under FreeBSD."
            ],
            "id_hash": -4725883961977777343,
            "content_hash": -4725883961977777343,
            "location": "book.translate.xml:14876",
            "context": "",
            "note": "(itstool) path: sect1/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2244,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 35,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92260/?format=api",
            "priority": 100,
            "id": 92260,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=3e6a49934c995341",
            "url": "https://translate-dev.freebsd.org/api/units/92260/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2019-11-02T20:37:25.623636Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "<prompt>%</prompt> <userinput>cd head/contrib/<replaceable>foo</replaceable></userinput>\n<prompt>%</prompt> <userinput>svn merge --record-only ^/vendor/<replaceable>foo</replaceable>/dist@<replaceable>12345678</replaceable> .</userinput>\n<prompt>%</prompt> <userinput>svn commit</userinput>"
            ],
            "previous_source": "",
            "target": [
                "<prompt>%</prompt> <userinput>cd head/contrib/<replaceable>foo</replaceable></userinput>\n<prompt>%</prompt> <userinput>svn merge --record-only ^/vendor/<replaceable>foo</replaceable>/dist@<replaceable>12345678</replaceable> .</userinput>\n<prompt>%</prompt> <userinput>svn commit</userinput>"
            ],
            "id_hash": -4263860557121870142,
            "content_hash": -4263860557121870142,
            "location": "book.translate.xml:4050",
            "context": "",
            "note": "(itstool) path: step/screen",
            "flags": "no-wrap",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 675,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": true,
            "num_words": 12,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92971/?format=api",
            "priority": 100,
            "id": 92971,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=44d3b96a08f3a6c2",
            "url": "https://translate-dev.freebsd.org/api/units/92971/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2020-01-12T21:53:22.856061Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
            "source": [
                "With some shells, the <literal>^</literal> in the above command may need to be escaped with a backslash."
            ],
            "previous_source": "",
            "target": [
                "With some shells, the <literal>^</literal> in the above command may need to be escaped with a backslash."
            ],
            "id_hash": -5484123976920845567,
            "content_hash": -5484123976920845567,
            "location": "book.translate.xml:4054",
            "context": "",
            "note": "(itstool) path: step/para",
            "flags": "",
            "labels": [],
            "state": 100,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 676,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 17,
            "source_unit": "https://translate-dev.freebsd.org/api/units/92972/?format=api",
            "priority": 100,
            "id": 92972,
            "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=33e47a4c936e3301",
            "url": "https://translate-dev.freebsd.org/api/units/92972/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2020-01-12T21:53:22.881434Z"
        }
    ]
}