{"id":21361588,"url":"https://github.com/phillbush/simpletron","last_synced_at":"2025-04-15T11:12:20.701Z","repository":{"id":133378062,"uuid":"267438820","full_name":"phillbush/simpletron","owner":"phillbush","description":"The Simpletron Simulator and The Simple Basic Compiler","archived":false,"fork":false,"pushed_at":"2020-05-27T22:35:42.000Z","size":31,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T11:12:00.311Z","etag":null,"topics":["c","deitel","simpletron"],"latest_commit_sha":null,"homepage":null,"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/phillbush.png","metadata":{"files":{"readme":"README","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-27T22:26:38.000Z","updated_at":"2024-12-30T23:56:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"13a1c175-8797-44b4-94ab-1fb9128294cb","html_url":"https://github.com/phillbush/simpletron","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/phillbush%2Fsimpletron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fsimpletron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fsimpletron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fsimpletron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phillbush","download_url":"https://codeload.github.com/phillbush/simpletron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058384,"owners_count":21205911,"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":["c","deitel","simpletron"],"created_at":"2024-11-22T06:10:26.773Z","updated_at":"2025-04-15T11:12:20.682Z","avatar_url":"https://github.com/phillbush.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"                        The Simpletron Simulator\n                                   \u0026\n                          The Simple Compiler\n\nSimpletron is a virtual machine invented by Deitel for his books.\nSimpletron runs programs written in the Simpletron Machine Language, an\nsimple Machine Language.\n\nAn instruction (and data) in the Simpletron Machine Language is a signed\nfour-digit integer, like +1009. The first two digits are the opcode, and\nthe last two digits are the operand.\n\nSimple Basic is a Basic-like programming language that compiles into\nSimpletron Machine Language.\n\n\n§ History\n\nThis software is a project done by me while reading «C: How to Program»,\nby Deitel \u0026 Deitel.\n\nThe Simpletron Simulator first appeared as a code to be reviewed in\ncodereview.stackexchange:\n\n\thttps://codereview.stackexchange.com/questions/239425\n\nThe Simple Basic Compiler first appeared as a code to be reviewed in\ncodereview.stackexchange:\n\n\thttps://codereview.stackexchange.com/questions/239616\n\n\n§ Files\n\nThe files are:\n• ./include/memory.h:        Specify the memory size and the opcodes.\n• ./simple/*:                The source code for the Simple Compiler.\n• ./simple/simple.6          The manual for the Simple Compiler.\n• ./simpletron/*:            The source code for the Simpletron Simulator.\n• ./simpletron/simpletron.6: The manual for the Simpletron Simulator.\n• ./samples/*.basic:         Sample files in simple basic to be compiled\n                             to the Simpletron Machine Language.\n\n\n§ Usage\n\nTo run a program 'file' written in the Simpletron Machine Language in\nthe simpletron simulator, use the simpletron(1) command as in.\n│ simpletron file\n\nYou can use the option ‘-c’ to do a core dump after running it, and ‘-v’\nto trace the execution and the registers of the Simpletron simulator.\n\nTo compile a source code 'file.basic' written in the SimpleBASIC\nprogramming language into a program 'a.out' in the Simpletron Machine\nLanguage, use the simple(1) compiler as in.\n│ simple file.basic\n\nYou can use the option ‘-O’ to optimize the compilation, and '-o' to\nspecify a file other than 'a.out' to compile the program into.\n\n\n§ TODO\n\nTODO for simpletron(1).\n• Extend the Simpletron Simulator's memory to contain 1000 locations to\n  enable the Simpletron to handle larger programs.\n• Modify the simulator to use hexadecimal values rather than integer\n  values to represent simpletron Machine Language instructions.\n• Modify the simulator to allow output of a newline.  This requires an\n  additional Simpletron Machine Language instruction.\n• Modify the simulator to process floating-point values in addition to\n  integer values.\n• Modify the simulator to handle string input. [Hint: Each Simpletron\n  word can be divided into two groups, each holding a two-digit integer.\n  Each two-digit integer represents the ASCI decimal equivalent of a\n  character.  Add a machine-language instruction that will input a\n  string and store it beginning at a specific Simpletron memory\n  location.  The first half of the word at that location will be a count\n  of the number of characters in the string (i'e', the length of the\n  string).  Each succeeding half word contains one ASCII character\n  expressed as two decimal digits.  The machine-language instruction\n  converts each character into its ASCII equivalent and assigns it to a\n  half word.]\n• Modify the simulator to handle output of strings stored in the format\n  specified above. [Hint: Add a machine-language instruction that prints\n  a string beginning at a specified Simpletron memory location.  The\n  first half of the word at that location is the length of the string in\n  characters.  Each succeeding half word contains one ASCII character\n  expressed as two decimal digits.  The machine-language instruction\n  checks the length and prints the string by translating each two-digit\n  number into its equivalent character.]\n\nTODO for simple(1).\n• Allow arrays of integers.\n• Allow subroutines specified by the Simple commands {gosub} and\n  {return}.  Command {gosub} passes program control to a subroutine and\n  command {return} passes control back to the statement after gosub.\n  This is similar to a function call in C.  The same subroutine can be\n  called from many {gosub} distributed throughout a program.\n\n\n§ See Also\n\nhttps://web.archive.org/web/20190819021934/http://www.deitel.com/bookresources/chtp8/CompilerExercises.pdf\n\n\n§ License\n\nThis software is in public domain and is provided AS IS, with NO WARRANTY.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillbush%2Fsimpletron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphillbush%2Fsimpletron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillbush%2Fsimpletron/lists"}