{ "info": { "author": "Juan J. Martinez", "author_email": "jjm@usebox.net", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development" ], "description": "# z80count\n\nThis is a simple tool that parses Z80 assembler using regular expressions (I know!)\nand adds comments to the code with the cycles used by the instruction.\n\nIt needs testing and probably a proper Z80 parser, but it works for me and the\nZ80 assembler syntax I use.\n\n![Demo with vim](https://github.com/reidrac/z80count/raw/master//etc/demo-vim.gif)\n\n## Install\n\n`z80count` requires Python 3.\n\nTo install for production you can use `pip`:\n\n pip3 install --user z80count\n\nOr you can download the package from [z80count's releases\ntab](https://github.com/reidrac/z80count/releases), unpack and run:\n\n python3 setup.py install\n\nTo install for development run:\n\n git clone https://github.com/reidrac/z80count.git\n cd z80count\n pip3 install -e \".[dev]\"\n\n## Usage\n\nYou can use it with:\n\n z80count < file.asm > file_c.asm\n\nOr inside `vim` you can:\n\n :% !z80count -s\n\nWith `-s` the tool adds a subtotal.\n\nBy default `z80count` will try to update comments replacing existing annotations.\n\nComments added by `z80count` are aligned to the column given in the `-c`\n(`--column`) option (50 by default). By default the comments are aligned using\nspaces, if you prefer tabs instead use the `-t` option. In order to compute the\npadding `z80count` assumes that a `TAB` equals 8 spaces. Use the\noption `-T` to override this.\n\nExample:\n```asm\n\tpush hl\n\tpop bc\n\tld hl, $5800\n\n\tld e, 7\n.fade_out_all_loop0\n\tpush hl\n\tpush bc\n\n\thalt\n.fade_out_all_loop1\n\tld a, (hl)\n\tand 7\n\tjr z, no_fade_all_ink\n\tdec a\n.no_fade_all_ink\n\n\tld d, a\n\n\tld a, (hl)\n\tand $38\n\tjr z, no_fade_all_paper\n\tsub 8\n.no_fade_all_paper\n\n\tor d\n\tld d, a\n\n\tld a, (hl)\n\tand $c0\n\tor d\n\n\tld (hl), a\n\tinc hl\n\n\tdec bc\n\tld a, b\n\tor c\n\tjr nz, fade_out_all_loop1\n\n\tpop bc\n\tpop hl\n\tdec e\n\tjr nz, fade_out_all_loop0\n```\n\nProcessed with `z80count.py -s` results in:\n```asm\n push hl ; [11 .. 11]\n pop bc ; [10 .. 21]\n ld hl, $5800 ; [10 .. 31]\n\n ld e, 7 ; [7 .. 38]\n.fade_out_all_loop0\n push hl ; [11 .. 49]\n push bc ; [11 .. 60]\n\n halt ; [4 .. 64]\n.fade_out_all_loop1\n ld a, (hl) ; [7 .. 71]\n and 7 ; [7 .. 78]\n jr z, no_fade_all_ink ; [12/7 .. 90/85]\n dec a ; [4 .. 89]\n.no_fade_all_ink\n\n ld d, a ; [4 .. 93]\n\n ld a, (hl) ; [7 .. 100]\n and $38 ; [7 .. 107]\n jr z, no_fade_all_paper ; [12/7 .. 119/114]\n sub 8 ; [7 .. 121]\n.no_fade_all_paper\n\n or d ; [4 .. 125]\n ld d, a ; [4 .. 129]\n\n ld a, (hl) ; [7 .. 136]\n and $c0 ; [7 .. 143]\n or d ; [4 .. 147]\n\n ld (hl), a ; [7 .. 154]\n inc hl ; [6 .. 160]\n\n dec bc ; [6 .. 166]\n ld a, b ; [4 .. 170]\n or c ; [4 .. 174]\n jr nz, fade_out_all_loop1 ; [12/7 .. 186/181]\n\n pop bc ; [10 .. 191]\n pop hl ; [10 .. 201]\n dec e ; [4 .. 205]\n jr nz, fade_out_all_loop0 ; [12/7 .. 217/212]\n```\n\nComments show subtotals, and there are two types:\n - `[A .. T0]`\n - `[B/A .. T1/T0]`\n\nWhere A, B, T0 and T1 are:\n - A is the number of cycles of current instruction. In case of a conditional\n instruction, this is the value when the condition is not met.\n - B is the number of cycles of current instruction when the condition is met.\n - T0 is the subtotal when the conditional is not met.\n - T1 is the subtotal when the conditional is met.\n\n## Config file\n\n`z80count` will look for a config file in the following places, in order:\n\n- the file given in the environment variable `Z80COUNT_RC`.\n\n- a file `z80countrc` in the directory given in the environment variable\n `XDG_DEFAULT_HOME` or, if this variable is undefined or empty, in\n the directory `~/.config`.\n\n- a file `.z80countrc` in the home directory.\n\nExample:\n\n```\n[z80count]\n# Column to align newly added comments\n# column = 50\n\n# Enable debug (show the matched case)\n# debug = no\n\n# Include subtotals\n# subtotals = no\n\n# Number of spaces for each tab\n# tab width = 8\n\n# Keep previous cycle annotations in the comment\n# keep cycles = no\n\n# Use tabs to align newly added comments instead of spaces\n# use tabs = yes\n```\n\n## Editor support\n\n- [z80count-el](https://github.com/patxoca/z80count-el), emacs\n\n## Troubleshooting\n\nHere be dragons!\n\nUse `-d` flag if you think one instruction is not correctly parsed.\n\nFeel free to open a PR if you find a bug!\n\n## Authors\n\n - Juan J. Martinez \n - Alexis Roda https://github.com/patxoca\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/reidrac/z80count", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "z80count", "package_url": "https://pypi.org/project/z80count/", "platform": "", "project_url": "https://pypi.org/project/z80count/", "project_urls": { "Homepage": "https://github.com/reidrac/z80count" }, "release_url": "https://pypi.org/project/z80count/0.8.1/", "requires_dist": [ "pytest ; extra == 'dev'", "tox ; extra == 'dev'" ], "requires_python": "", "summary": "A tool to annotate Z80 assembler with cycle counts.", "version": "0.8.1" }, "last_serial": 5683969, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "4b55554ad9bec3028b098a99adc0dfc3", "sha256": "b9c89db1129c41d0d81512a9bbb5fb710b7b09feaa2f1d1123ce32b064361374" }, "downloads": -1, "filename": "z80count-0.5.0-py2-none-any.whl", "has_sig": false, "md5_digest": "4b55554ad9bec3028b098a99adc0dfc3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17263, "upload_time": "2019-07-27T10:01:35", "url": "https://files.pythonhosted.org/packages/00/d2/c0f9a5a5a2477654684fd5486013effb929b2d61b3812632ed568b22488e/z80count-0.5.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "726fc54bb7d7746911e8e02040d8ed3b", "sha256": "0379e22359848d7a85b094b90921e8ff9d5b431b0d3bb73045497f4e8c12eabd" }, "downloads": -1, "filename": "z80count-0.5.0.tar.gz", "has_sig": false, "md5_digest": "726fc54bb7d7746911e8e02040d8ed3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1426045, "upload_time": "2019-07-27T10:01:50", "url": "https://files.pythonhosted.org/packages/52/49/51a7d44d11da73af71e633ea889837f81f7cfa1caa25cc3cf000b4b24b05/z80count-0.5.0.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "892713c1f344b988b1d610c197945698", "sha256": "a719e5d9e4c158953760a7d59e4ff348cafc889456c048cb32a8cf14c1dfb56f" }, "downloads": -1, "filename": "z80count-0.5.3-py2-none-any.whl", "has_sig": false, "md5_digest": "892713c1f344b988b1d610c197945698", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17260, "upload_time": "2019-07-27T10:43:16", "url": "https://files.pythonhosted.org/packages/b5/2b/49d6b5c7b8a4390791b69579ae6a74b448c7752e94df3b20915c7f8c311d/z80count-0.5.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7f6eb8c2ef52426d1223c968f2aa224", "sha256": "e7747727b0e7890e851b1deb0e3012dca5ba51168bcfbd930892502b73550f2f" }, "downloads": -1, "filename": "z80count-0.5.3.tar.gz", "has_sig": false, "md5_digest": "a7f6eb8c2ef52426d1223c968f2aa224", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1426042, "upload_time": "2019-07-27T10:43:38", "url": "https://files.pythonhosted.org/packages/13/22/fc304631202c438bd2a2cd0b9461d045fd27d7e594e42aae8fc56d6445ae/z80count-0.5.3.tar.gz" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "f90107c5cb5f77b108cae90b0b861723", "sha256": "15306992b22238ac83eb4177497272d16d87660147c6ae14a8c920e58df3668b" }, "downloads": -1, "filename": "z80count-0.5.4-py2-none-any.whl", "has_sig": false, "md5_digest": "f90107c5cb5f77b108cae90b0b861723", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17268, "upload_time": "2019-07-27T10:52:56", "url": "https://files.pythonhosted.org/packages/ba/d5/9098a64e907f058694e5b4f1726254d5a2d6a60309db61013e6c6560ddd4/z80count-0.5.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c723e89044008115f95e4995db0d501", "sha256": "60eee0c8276263a8fca60e922c38ee5c60cb435ea9ce4b1a7a69d251faac624f" }, "downloads": -1, "filename": "z80count-0.5.4-py3-none-any.whl", "has_sig": false, "md5_digest": "0c723e89044008115f95e4995db0d501", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17268, "upload_time": "2019-07-27T10:56:36", "url": "https://files.pythonhosted.org/packages/64/bd/ec56fced6399f2de445c7a3815a9a0886b782359dd3d4bb7708265091f36/z80count-0.5.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56214c028fb033d558d24eddec495d35", "sha256": "798d0956a0c9477d42c5814a897445c2e3c0745899788a06c769e405cf3bdb98" }, "downloads": -1, "filename": "z80count-0.5.4.tar.gz", "has_sig": false, "md5_digest": "56214c028fb033d558d24eddec495d35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1426068, "upload_time": "2019-07-27T10:53:11", "url": "https://files.pythonhosted.org/packages/2e/dd/ce993d28f169a488105e80293966e7918d5faa5cc8c5295483d6bfc40bc7/z80count-0.5.4.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "82208ddca3401e2a1469ed02ff0433ff", "sha256": "0acf5ce67e27f565637f5e88d9a0840c09af968526c2bf120cfd0fee2a39033d" }, "downloads": -1, "filename": "z80count-0.6.0-py2-none-any.whl", "has_sig": false, "md5_digest": "82208ddca3401e2a1469ed02ff0433ff", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17295, "upload_time": "2019-08-01T15:56:11", "url": "https://files.pythonhosted.org/packages/0b/8a/5c629da4935a72cc82e0a524d3a9e4ce0772fe6842a53d4edd30be771799/z80count-0.6.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c1716b6ed0e980998e3b16c294d9538", "sha256": "31a70e565cfbb9a563b215fb264fb5a82135e41abd7a1ba2d7a98638810e58b2" }, "downloads": -1, "filename": "z80count-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0c1716b6ed0e980998e3b16c294d9538", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17296, "upload_time": "2019-08-01T15:56:13", "url": "https://files.pythonhosted.org/packages/43/5b/fa699e526bed703c458e68e5383734e0b17382aab4c2da519708fe3ba34d/z80count-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9b40d948b14e010df42f0dccbdd6d24d", "sha256": "cdd51a918c81f5af6ab152cea93ede0bce83bb84bdc2a4222ecb2cd3f733ecef" }, "downloads": -1, "filename": "z80count-0.6.0.tar.gz", "has_sig": false, "md5_digest": "9b40d948b14e010df42f0dccbdd6d24d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1426173, "upload_time": "2019-08-01T15:56:27", "url": "https://files.pythonhosted.org/packages/27/ed/49617de349fec42dc9f144a6f66d1cae2fbf38507158706e6e28a57b9b07/z80count-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "0a3118bf34ab5f273d7ee8d3b7e33bc2", "sha256": "957165dfdf2592da724c4054c72cc3a308a3ef8d557b3f3667f68223e258204b" }, "downloads": -1, "filename": "z80count-0.7.0-py2-none-any.whl", "has_sig": false, "md5_digest": "0a3118bf34ab5f273d7ee8d3b7e33bc2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18288, "upload_time": "2019-08-06T20:10:15", "url": "https://files.pythonhosted.org/packages/6e/00/e832e080ea93d2a6c57f21e23925e398c0b62879013ecf24dd509e918db3/z80count-0.7.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1fa0d6ac9f64b77028b3ca960a24fe52", "sha256": "7370ac1d98876e8e2d1ef356eb37bc23a6d7ad2f664d8464c4690db14770ddd9" }, "downloads": -1, "filename": "z80count-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1fa0d6ac9f64b77028b3ca960a24fe52", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18289, "upload_time": "2019-08-06T20:10:16", "url": "https://files.pythonhosted.org/packages/cc/57/64aaba4eeb4451355075d2f9aaae378c415638374736148d148fc8102361/z80count-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e34c7dc745637153f86c6f0b532d537", "sha256": "e15559163f904e621c553fcf02ba1ca04d067369e4f9c5a5eb2f1ccf4cc46007" }, "downloads": -1, "filename": "z80count-0.7.0.tar.gz", "has_sig": false, "md5_digest": "9e34c7dc745637153f86c6f0b532d537", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1428725, "upload_time": "2019-08-06T20:10:30", "url": "https://files.pythonhosted.org/packages/9f/4a/a4cff5513a53cad7095d96f9831b342c4cc409193e38b5e5db0344221d13/z80count-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "5c5e722f63155d349a76e58dc86c7299", "sha256": "62f5d492f341b212c459e2f02cdde8701c1a49a8d721be52abc4a2f32caab38e" }, "downloads": -1, "filename": "z80count-0.7.1-py2-none-any.whl", "has_sig": false, "md5_digest": "5c5e722f63155d349a76e58dc86c7299", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18358, "upload_time": "2019-08-07T05:53:05", "url": "https://files.pythonhosted.org/packages/be/d3/365fa0b99020e44d57c9d4b58189eb2b84f9a1d72028db44270fc17b7531/z80count-0.7.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a14d593d976e1382a51f73fb9af72aea", "sha256": "958b3364d735c2192a25dc5b5ff741ac7f3d0c637878c4ff2193a16b9e3fe153" }, "downloads": -1, "filename": "z80count-0.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a14d593d976e1382a51f73fb9af72aea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18358, "upload_time": "2019-08-07T05:53:07", "url": "https://files.pythonhosted.org/packages/7b/88/0504e89259041f8b5e33461e65ad357ebd3e4a20c830482b151a832e2c40/z80count-0.7.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be2c334c47c0d2f272cc8ff58ad539d8", "sha256": "5a476af4038be92e080a6c44b896acb58f433c558593a3fa020c4576a3c6d725" }, "downloads": -1, "filename": "z80count-0.7.1.tar.gz", "has_sig": false, "md5_digest": "be2c334c47c0d2f272cc8ff58ad539d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1429082, "upload_time": "2019-08-07T05:53:22", "url": "https://files.pythonhosted.org/packages/c4/45/debbff67fae966673deb80e72e08207b0c3b3c3b97c49dcab8601f1d061b/z80count-0.7.1.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "50113077f55214de8b6e0a691c651b53", "sha256": "51688858310f6cc03b4862e577fe976e3901b511308dd4149ea546b22ec3a222" }, "downloads": -1, "filename": "z80count-0.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "50113077f55214de8b6e0a691c651b53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20006, "upload_time": "2019-08-15T19:18:12", "url": "https://files.pythonhosted.org/packages/f6/28/802be302c27d3658c7e93fa553b3a650e4f61bf1e7b1767120a0e5824ccd/z80count-0.8.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bca4b41312031d730a7e0dc1b45a75a9", "sha256": "f11022476ff878f9843a4676717e3937f10577251567d810c0ed6fcfb186124c" }, "downloads": -1, "filename": "z80count-0.8.0.tar.gz", "has_sig": false, "md5_digest": "bca4b41312031d730a7e0dc1b45a75a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2205712, "upload_time": "2019-08-15T19:18:32", "url": "https://files.pythonhosted.org/packages/9f/6f/433fee82334c818fd881d1fe668346d258d820be7d140c985c1ed62fb6dc/z80count-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "8ba5713efdd869bff4d95f367c5ace20", "sha256": "d6533900d270e89e93410076f0905700421b992722bb191a3ce20a9e6a1496ac" }, "downloads": -1, "filename": "z80count-0.8.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ba5713efdd869bff4d95f367c5ace20", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20022, "upload_time": "2019-08-15T19:59:31", "url": "https://files.pythonhosted.org/packages/41/1e/9209308a04bf156ee6215ee346429e6043947bf43569b39fc548adbdb327/z80count-0.8.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1c4a409be9904e9b10cb8cae23df60b3", "sha256": "5ecabcea384572851ad020b0005147a9101f8582f294f64c0289cce3ea311957" }, "downloads": -1, "filename": "z80count-0.8.1.tar.gz", "has_sig": false, "md5_digest": "1c4a409be9904e9b10cb8cae23df60b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2205738, "upload_time": "2019-08-15T19:59:53", "url": "https://files.pythonhosted.org/packages/c2/d5/b80a81238310fd36f9ab87390b7c4565bb7d07f83e556d0956eb008acc9f/z80count-0.8.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8ba5713efdd869bff4d95f367c5ace20", "sha256": "d6533900d270e89e93410076f0905700421b992722bb191a3ce20a9e6a1496ac" }, "downloads": -1, "filename": "z80count-0.8.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ba5713efdd869bff4d95f367c5ace20", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20022, "upload_time": "2019-08-15T19:59:31", "url": "https://files.pythonhosted.org/packages/41/1e/9209308a04bf156ee6215ee346429e6043947bf43569b39fc548adbdb327/z80count-0.8.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1c4a409be9904e9b10cb8cae23df60b3", "sha256": "5ecabcea384572851ad020b0005147a9101f8582f294f64c0289cce3ea311957" }, "downloads": -1, "filename": "z80count-0.8.1.tar.gz", "has_sig": false, "md5_digest": "1c4a409be9904e9b10cb8cae23df60b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2205738, "upload_time": "2019-08-15T19:59:53", "url": "https://files.pythonhosted.org/packages/c2/d5/b80a81238310fd36f9ab87390b7c4565bb7d07f83e556d0956eb008acc9f/z80count-0.8.1.tar.gz" } ] }