{"id":23522060,"url":"https://github.com/alhimik45/asm_bf","last_synced_at":"2026-04-27T11:31:42.116Z","repository":{"id":15655973,"uuid":"18393323","full_name":"alhimik45/asm_bf","owner":"alhimik45","description":"Assembler to Brainfuck translator","archived":false,"fork":false,"pushed_at":"2014-04-09T07:31:13.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T03:43:05.777Z","etag":null,"topics":["assembler","brainfuck-translator","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alhimik45.png","metadata":{"files":{"readme":"README.md","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":"2014-04-03T06:24:39.000Z","updated_at":"2025-02-20T23:41:12.000Z","dependencies_parsed_at":"2022-09-12T22:00:42.593Z","dependency_job_id":null,"html_url":"https://github.com/alhimik45/asm_bf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alhimik45/asm_bf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alhimik45%2Fasm_bf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alhimik45%2Fasm_bf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alhimik45%2Fasm_bf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alhimik45%2Fasm_bf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alhimik45","download_url":"https://codeload.github.com/alhimik45/asm_bf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alhimik45%2Fasm_bf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["assembler","brainfuck-translator","ruby"],"created_at":"2024-12-25T17:15:01.808Z","updated_at":"2026-04-27T11:31:42.089Z","avatar_url":"https://github.com/alhimik45.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Assembler to Brainfuck translator\n======\n\nRunning:\n--------\n\n```bash\ncat input.asm | ruby asm_bf.rb \u003e out.bf\n```\n\nSupported:\n----------\n\n - Registers\n - Stack(like C-string, can't store 0)\n - Strings and arrays\n\nBasic types:\n-----------------\n\n - Registers:\n```nasm\nmov ax 5 // ax = 5\nmov bx 6 // bx = 6\nsub ax bx // ax = 5 - 6 (mod 256) = 255\n\nmov cx 12\nmov dx 2 \nmul cx dx // cx = 12 * 2 = 24\n\nmov dx 10\ndiv cx dx // division with remainder:  cx = 24 \\ 10 = 2, dx = 24 % 10 = 4\n```\n - Stack:\n```nasm\nmov ax 1\npush ax\npush 5\npop bx\npop cx // bx = 5, cx = 1 now\n\npush 0 // wrong! undefined behaviour\n```\n - Arrays:\n```nasm\narray test 10 // like C's : unsigned char test[10];\nset test 0 42 // test[0] = 42\nget test 0 ax // ax = test[0]\n```\nAlso, register can be index of array, but then you can access only first 256 elements.\n\n - Strings:\n```nasm\nstring hello \"Hello, World!\" // like C's: unsigned char hello[] = \"Hello, World!\";\nputs hello // print string\n```\nStrings are arrays too:\n```nasm\nget hello 0 ax // ax = 'H'\nput ax // prints 'H'\n```\n Basic operations:\n----------------------\n - IO:\n```nasm\ntake ax // like C's: ax = getchar();\nput ax // prints char in 'ax'\nputs str // prints string in str variable\n```\n - Loop:\n```nasm\nwhile ax // in while used one of registers\n\t// do smth.\nendwhile\n```\n - Comparing:\n```nasm\nmov ax 2\nmov bx 1\ncmp ax bx // compare, and now:\n\nne // not equal\n    // actions in case registers are not equal\nend\n\nnl // not less\n    // actions\nend\n\nng // not greater\n    // actions\nend\n\neq // equal\n    // actions\nend\n\nlt // less\n    // actions\nend\n\ngt // greater\n    // actions\nend\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falhimik45%2Fasm_bf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falhimik45%2Fasm_bf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falhimik45%2Fasm_bf/lists"}