{"id":13782896,"url":"https://github.com/MrDetonia/pzab","last_synced_at":"2025-05-11T16:33:24.834Z","repository":{"id":25746004,"uuid":"29183799","full_name":"MrDetonia/pzab","owner":"MrDetonia","description":"The PZAB interpreter in C","archived":false,"fork":false,"pushed_at":"2015-01-13T11:55:11.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T18:16:57.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://esolangs.org/wiki/PZAB","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrDetonia.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-13T09:59:39.000Z","updated_at":"2015-01-13T13:50:26.000Z","dependencies_parsed_at":"2022-08-23T11:11:06.898Z","dependency_job_id":null,"html_url":"https://github.com/MrDetonia/pzab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrDetonia%2Fpzab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrDetonia%2Fpzab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrDetonia%2Fpzab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrDetonia%2Fpzab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrDetonia","download_url":"https://codeload.github.com/MrDetonia/pzab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253596016,"owners_count":21933495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:01:47.444Z","updated_at":"2025-05-11T16:33:24.601Z","avatar_url":"https://github.com/MrDetonia.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"PZAB Interpreter -Version 0.1a\n================\nInterpreter for the PZAB programming language written in C.\nDesigned to be fast and portable.\n\nCopyright (C) 2015 Zac Herd \u003czacjherd@gmail.com\u003e\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n\nCONTENTS\n========\n1. What is PZAB?\n2. The PZAB Instruction Set\n3. Building/Using the Interpreter\n4. Getting Involved\n\n\n1. What is PZAB?\n================\n\nOverview:\n---------\nPZAB is an esoteric programming language designed by Zac Herd in 2013.\nIt forces the programmer to think in terms of bits rather than integral\nvalues (or any other data types for that matter).\nThe programmer manipulates a bounded-storage machine with 256 bytes of memory,\nand 5 registers of varying sizes by using single ASCII characters as\ninstructions to the interpreter.\n\n\nThe PZAB Machine Architecture:\n------------------------------\nAs previously stated, the PZAB machine is a bounded-storage machine that has\n256 bytes of memory available.\nThere are 5 registers: P0, P1, Z, A, and B.\n\nP0 is 8 bits in size and points to a location in the machine's memory.\nIf P0 had the value of 0x16, for example, we would be referencing memory cell\n0x16.\n\nP1 is 3 bits in size and references a bit in the memory cell pointed to by P0.\nIf P0 had the value 0x16, and P1 had the value 0x3, we would be referencing\nbit 0x3 of memory cell 0x16.\n\nZ is 1 bit in size. It is used as an accumulator for the logical operations\nthe PZAB interpreter can perform. Z cannot be assigned to directly; only through\nsuch operations can it be assigned a value.\nZ can however, write values to bits in memory pointed to by P0 and P1, as well\nas to the A and B registers.\n\nA and B are both 1 bit in size. They can be assigned values from memory, or from\nthe Z register. Both registers are used in logical operations, the results of\nwhich are then stored in Z. A and B cannot write values to memory.\n\nAll memory and registers are initialised to 0x00;\n\n\n2. The PZAB Instruction Set\n===========================\n\nOverview:\n---------\nPZAB instructions are single ASCII characters. Any 'non-PZAB' characters found\nin scripts are ignored by the interpreter.\n\nWhen writing a PZAB script file, the preferred extension is .pzab\n\n\nInstructions:\n------------\n+   - Increment P0\n-   - Decrement P0\n\u003c   - Increment P1\n\u003e   - Decrement P1\nA   - Assign bit P1 of cell P0 to A\nB   - Assign bit P1 of cell P0 to B\na   - Assign Z to A\nb   - Assign Z to B\nZ   - Assign Z to bit P1 of cell P0\n!   - Perform logic NOT on Z\n\u0026   - Perform logic AND on A and B, result stored in Z\n|   - Perform logic OR on A and B, result stored in Z\n_   - Perform logic XOR on A and B, result stored in Z\n.   - Get integer input and store in cell P0\n,   - Get ASCII character input and store in cell P0\n:   - Output cell P0 as integer\n;   - Output cell P0 as ASCII character\n?   - Only executes code up to matching '~' if Z is 0\n~   - See '~'\n1-9 - Executes code up to matching '0' this many times (1 loops infinitely)\n0   - See '1-9'\n\n\n3. Building/Using the PZAB Interpreter\n======================================\n\nGeneral Build Information:\n--------------------------\nThe Makefile for the PZAB interpreter is arranged so that variables which will\nlikely be modified are near the top.\nBy default, the -g compiler option is set (see CFLAGS). This is intended for\na debug build, and to get a faster execution time, it is recommended that you\nchange this to -O3\n\nThe PZAB interpreter uses no external libraries, so the only dependencies are\nthe standard C libraries.\n\nTargets are:\n    all         - default 'make' target, builds pzab\n    install     - installs pzab to selected folder (default=/usr/local/bin)\n    uninstall   - removes pzab from selected folder\n    clean       - removes all compiled binary files in bin and obj\n\n\nBuilding on Linux:\n------------------\nThe Makefile is already configured to compile using gcc.\nJust run 'make' in the root pzab directory.\n\n\nBuilding on Windows:\n--------------------\nWindows users will likely need to change several settings in the Makefile to\nbuild:\nThe target should have an .exe extension appended in order to execute.\nThe compiler must be changed accordingly (likely 'mingw-gcc' or 'msvc').\nThe install dir must be changed to a valid windows folder.\n\nAfter changing makefile settings according to your system, use your C compiler\nto build (if you do not have one, I recommend either MinGW or Cygwin).\n\n\nTroubleshooting:\n----------------\nIf after following the instructions above, and checking your compiler's manual,\nyou are still having problems building the PZAB interpreter, feel free to\ncontact me using zacjherd@gmail.com and I will do my best to help.\n\nRemember, Google is your friend. ;)\n\n\nRunning the Interpreter:\n------------------------\nOnce built, running the interpreter is as simple as:\n$'pzab script.pzab'\n\nWhere pzab is the built executable, and script.pzab is the script you want the\ninterpreter to run.\n\n\n4. Getting Involved\n===================\nIf you have any experience with C programming, and want to add new features or\nimprove existing code, feel free to clone this repo and make your changes; I\nwill respond to pull requests as quickly as I can.\n\nYou may also improve the wiki at:\nhttps://esolangs.org/wiki/PZAB\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrDetonia%2Fpzab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMrDetonia%2Fpzab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrDetonia%2Fpzab/lists"}