{"id":20191408,"url":"https://github.com/htfy96/smltranslator","last_synced_at":"2025-08-22T10:43:17.695Z","repository":{"id":29134669,"uuid":"32664634","full_name":"htfy96/SMLtranslator","owner":"htfy96","description":"An assembly translator for Simple Machine Language of \u003cComputer Science an Overview\u003e","archived":false,"fork":false,"pushed_at":"2015-03-22T07:17:55.000Z","size":140,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T18:52:23.114Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/htfy96.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":"2015-03-22T06:22:56.000Z","updated_at":"2015-03-22T07:18:37.000Z","dependencies_parsed_at":"2022-08-02T21:34:06.934Z","dependency_job_id":null,"html_url":"https://github.com/htfy96/SMLtranslator","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/htfy96%2FSMLtranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FSMLtranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FSMLtranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FSMLtranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/htfy96","download_url":"https://codeload.github.com/htfy96/SMLtranslator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629736,"owners_count":19993707,"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-11-14T03:48:47.134Z","updated_at":"2025-03-03T07:41:03.631Z","avatar_url":"https://github.com/htfy96.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Syntax of assembly file\n\nThe whole assembly program should be composed by following parts:\n\n##;\n`;` stands for the symbol of comment\n\n##.DATA\n`.DATA` indicates the beginning of data segment and declaration of variables\n\n##Declatation of variables\nSyntax:\n\n```\nVariableName Address\n```\n\nExamples:\n```\nX 21\nY 35\n```\n\n`VariableName` can only contain letters, numbers and _, and can't be all numbers.\n\n##.CODE\n`.CODE` stands for the beginning of code segment\n\n##.BASE\n\n`BASE Address` indicates the address where code segment start, and must be the next line of `.CODE`\n\n##Statements\nHere are the supported statements(case insensive):\n\n```\n;r s t stand for register from 0 to 7\n;lm r,xy/var = 1RXY     Read a number from address [xy/variable] to register r                  e.g lm 3,x\n;lb r,xy/var = 2RXY     Read a number [xy/variable] to register r                               e.g lb 4,15\n;mov r,xy/var = 3RXY    write a number from register r to address [xy/variable]                 e.g mov 0,y\n;mov r,s = 40RS         write a number from reg r to reg s                                      e.g mov 1,0\n;addc r,s,t = 5RST      Complement Add r=s+t\n;Addc s,t = 5SST        Another form of complement adding s=s+t\n;Addf r,s,t = 6RST      Float Add r=s+t\n;Addf s,t = 6SST        Another form of float adding ，s=s+t\n;Or r,s,t = 7RST        Operator or r=s or t\n;Or s,t = 7SST          Another form of operator or  s=s or t\n;And r,s,t = 8RST       Operator and r=s and t\n;And s,t = 8SST         Another form of operator and s=s and t\n;Xor r,s,t = 9RST       Operator xor r=s xor t\n;Xor s,t = 9SST         Another form of operator xor s=s xor t\n;Rot R,X=AR0X           Circular left shift, reg r  x bits left\n;J r,xy/label = BRXY    Jump by condition, if reg r=reg r0 then jump to address [xy/label]      e.g j 2,loopend\n;J xy/label = B0XY      Jump by all means, jump to address [xy/label]                           e.g j 0020\n;Halt = C000            Halt the program\n```\n\n##Label\nIt is disturbing to calculate address in statement `J`, then came **label**:\n\nWrite a label before a statement to mark the address of this statement:\n\ne.g\n```\nlabel:mov 2,3\n```\n\nThen you can write\n```\nj 2,label\n```\nto directly jump to the statement\n\n##.ENTRY\n`.ENTRY 00 ; Indicate the point where program start, not implemented yet`\n\n#About\nFor more details, please look up `example1.txt` as well as `example2.txt`.\n\nTranslator for Simple Machine Language by lz96@foxmail.com under MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtfy96%2Fsmltranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtfy96%2Fsmltranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtfy96%2Fsmltranslator/lists"}