{"id":20375949,"url":"https://github.com/nzeemin/vilnius-basic-compiler","last_synced_at":"2025-04-12T07:36:32.193Z","repository":{"id":159289631,"uuid":"627035441","full_name":"nzeemin/vilnius-basic-compiler","owner":"nzeemin","description":"Writing cross compiler from Vilnius BASIC into MACRO11. WIP 🚧","archived":false,"fork":false,"pushed_at":"2024-08-11T10:33:50.000Z","size":390,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-26T02:51:08.352Z","etag":null,"topics":["basic","basic-compiler","basic-programming-language","compiler","retrocomputing","soviet-computer"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nzeemin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-12T16:45:45.000Z","updated_at":"2025-03-15T00:08:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"28369618-eb37-44a3-8305-ab53f747e363","html_url":"https://github.com/nzeemin/vilnius-basic-compiler","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/nzeemin%2Fvilnius-basic-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fvilnius-basic-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fvilnius-basic-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fvilnius-basic-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nzeemin","download_url":"https://codeload.github.com/nzeemin/vilnius-basic-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248535581,"owners_count":21120592,"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":["basic","basic-compiler","basic-programming-language","compiler","retrocomputing","soviet-computer"],"created_at":"2024-11-15T01:34:17.891Z","updated_at":"2025-04-12T07:36:32.157Z","avatar_url":"https://github.com/nzeemin.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vilnius-basic-compiler\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e6afa5b97cf04e169570eca8d9579c04)](https://app.codacy.com/gh/nzeemin/vilnius-basic-compiler/dashboard)\n[![CodeFactor](https://www.codefactor.io/repository/github/nzeemin/vilnius-basic-compiler/badge)](https://www.codefactor.io/repository/github/nzeemin/vilnius-basic-compiler)\n\n## Vilnius BASIC Compiler\n\n**BASIC Vilnius** is an implementation of the BASIC programming language for Soviet machines with PDP-11 architecture: DVK, BK, UKNC, Nemiga.\nThis BASIC is a semi-compiler: it converts the program text into a so-called **threaded code**,\nwhich executes faster than regular interpretation.\n\nThe aim of this project is to develop a full-fledged cross-compiler from the BASIC Vilnius language to MACRO assembly code.\nIn other words, the compiler runs on a PC (Windows, Linux, Mac) and generates a text file with the `.MAC` extension.\nThen, under the **RT-11** operating system, the `.MAC` file is compiled using the standard RT-11 MACRO assembler,\nresulting in an object file with the `.OBJ` extension. The object file is then linked with other object modules using the LINK program,\nincluding the language's runtime, and optionally, custom assembly procedures.\nAs a result, an executable file with the `.SAV` extension is produced, which can be executed under the RT-11\non the target machine.\n\nCurrent state of the project: **prototype**\n\n## Компилятор Бейсик Вильнюс\n\n**Бейсик Вильнюс** — это реализация языка BASIC для советских машин с архитектурой PDP-11: ДВК, БК, УКНЦ, Немига.\nЭтот Бейсик является полу-компилятором: он преобразует текст программы в так называемый **шитый код**,\nкоторый выполняется быстрее, чем при обычной интерпретации.\n\nДанный проект ставит целью написание полноценного кросс-компилятора с языка Бейсик Вильнюс в код для ассемблера MACRO.\nТо есть, компилятор работает на PC (Windows, Linux, Mac), генерирует текстовый файл с расширением `.MAC`.\nДалее, под операционной системой **RT-11**, `.MAC` файл компилируется стандартным для RT-11 ассемблером MACRO,\nполучается объектный файл с расширением `.OBJ`. Затем объектный файл линкуется программой LINK с другими\nобъектными модулями — это runtime языка, плюс, если нужно, свои собственные процедуры на ассемблере.\nВ результате, на выходе получается исполнимый файл с расширением `.SAV`, который может быть исполнен в среде RT-11\nна целевой машине.\n\nТекущее состояние проекта: **прототип**\n\n### Пример\n\nИсходный файл на Бейсике:\n```basic\n10 A%=23.42\n20 PRINT A%\n```\nРезультат компиляции:\n```assembler\n\t.MCALL\t.EXIT\nSTART:\n; 10 A%=23.42\nL10:\n\tMOV\t#23., VARA.I\t; assignment\n; 20 PRINT A%\nL20:\n\tMOV\tVARIA, R0\n\tCALL\tWRINT\n\tCALL\tWRCRLF\nL65536:\n\t.EXIT\n; VARIABLES\nVARIA:\t.WORD\t0\t; A%\n\t.END\tSTART\n```\n\n### Декорирование имён переменных\n\nПеременные в Бейсик Вильнюс опознаются по первым двум символам имени + тип.\n\nИмена переменных в коде для MACRO имеют вид: `VAR` + тип (`I`,`N`,`S`) + первые два символа имени переменной.\n\nПримеры декорирования:\n```\nA%                    VARIA\nB или B!              VARNB\nC$                    VARSC\nAA или AAA или AA1    VARNAA\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzeemin%2Fvilnius-basic-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnzeemin%2Fvilnius-basic-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzeemin%2Fvilnius-basic-compiler/lists"}