{"id":13444573,"url":"https://github.com/mist64/cbmbasic","last_synced_at":"2025-10-21T04:49:44.831Z","repository":{"id":24261232,"uuid":"27655109","full_name":"mist64/cbmbasic","owner":"mist64","description":"cbmbasic, a portable version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64","archived":false,"fork":false,"pushed_at":"2022-12-18T18:18:28.000Z","size":1498,"stargazers_count":471,"open_issues_count":18,"forks_count":73,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-03-18T23:45:14.156Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mist64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-07T01:11:09.000Z","updated_at":"2025-03-18T08:16:17.000Z","dependencies_parsed_at":"2023-01-14T07:46:14.954Z","dependency_job_id":null,"html_url":"https://github.com/mist64/cbmbasic","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/mist64%2Fcbmbasic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mist64%2Fcbmbasic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mist64%2Fcbmbasic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mist64%2Fcbmbasic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mist64","download_url":"https://codeload.github.com/mist64/cbmbasic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244676454,"owners_count":20491828,"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-07-31T04:00:30.772Z","updated_at":"2025-10-21T04:49:39.770Z","avatar_url":"https://github.com/mist64.png","language":"C","readme":"# cbmbasic - Commodore BASIC V2 as a scripting language\n\n\"Commodore BASIC\" (cbmbasic) is a 100% compatible version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64. You can use it in interactive mode or pass a BASIC file as a command line parameter.\n\nThis source does not emulate 6502 code; all code is completely native. On a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.\n\n## Compatibility\n\nIt has been tested with\n\n* Mac OS X 10.4/10.5 i386/x86_64/ppc (GCC 3.3/4.0)\n* Debian Linux Etch (GCC 3.3/4.1)\n* Windows NT (Visual Studio 2005/2008)\n\nOther CPUs, operating systems and compilers should work, too.\n\nWindows users should also install the [Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)](\"http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-984d-389c36f85647\u0026displaylang=en\").\n\n## Usage\nYou can use cbmbasic in interactive mode by just running the binary without parameters, or you can specify an ASCII-encoded BASIC program on the command line. You can also use cbmbasic as a UNIX scripting language by adding a hashbang line to your BASIC program and making it executable.\n\n    $ ls -l hello.bas \n    -rwxr-xr-x  1 mist  staff  40  7 Apr 21:30 hello.bas\n    $ cat hello.bas \n    #!/usr/bin/env cbmbasic\n    PRINT\"HELLO WORLD!\"\n    $ ./hello.bas \n    HELLO WORLD!\n\ncbmbasic implements a small plugin system that lets developers add additional statements, functions etc. Right now, you can turn this on with \"SYS 1\" (turn off with \"SYS 0\"), and use the new statements LOCATE *y*, *x* (set cursor position), SYSTEM *string* (run command line command) and the extended WAIT *port*, *mask*, which implements the [Bill Gates easter egg](http://www.pagetable.com/?p=43).\n\n## Internals\nThe core of the BASIC interpreter is in the file `cbmbasic.c`, which is platform, endianness and bitness independent. For all I/O, it calls out into `runtime.c`, so it should be possible to adapt this project for any OS by just changing `runtime.c`.\n\nAll function calls that the core interpreter can't handle end up in kernal_dispatch() in `runtime.c`, where a switch statement dispatches these to C functions. For Commodore BASIC, `runtime.c` has to support several Commodore KERNAL library routines. Some of them are very important (CHRIN, CHROUT) and some are only used for certain BASIC statements (LOAD, SAVE, OPEN, SETTIM). `runtime.c` does not implement all functions yet.\n\n## License\nFeel free to use this project for any purpose, give credit if you like, and send back improvements to the authors, if you like, so that others can benefit from it. See source for license details.\n\n## Contact\n[Michael Steil](mailto:mist@c64.org), [James Abbatiello](mailto:abbeyj@gmail.com)\n","funding_links":[],"categories":["Dialects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmist64%2Fcbmbasic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmist64%2Fcbmbasic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmist64%2Fcbmbasic/lists"}