{"id":20983955,"url":"https://github.com/itsmebriand/nicasm","last_synced_at":"2026-04-28T10:05:36.278Z","repository":{"id":106823502,"uuid":"169488908","full_name":"ItsMeBrianD/NICASM","owner":"ItsMeBrianD","description":"16-bit processor created in logisim, and the java-based assembler that enables it to work","archived":false,"fork":false,"pushed_at":"2020-10-23T17:03:43.000Z","size":6611,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-20T07:10:26.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://0c370t.github.io/NICASM/","language":"Java","has_issues":false,"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/ItsMeBrianD.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-06T22:50:18.000Z","updated_at":"2020-10-23T17:03:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"2574fe9b-4928-44a5-8a35-09c008f54d1d","html_url":"https://github.com/ItsMeBrianD/NICASM","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsMeBrianD%2FNICASM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsMeBrianD%2FNICASM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsMeBrianD%2FNICASM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsMeBrianD%2FNICASM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItsMeBrianD","download_url":"https://codeload.github.com/ItsMeBrianD/NICASM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392299,"owners_count":20283560,"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-19T05:50:55.933Z","updated_at":"2025-12-28T10:58:35.806Z","avatar_url":"https://github.com/ItsMeBrianD.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NICASM-Required-Files\nThis branch contains all files that are required to use the NICASM Simulated Processors\n\n## Credits\nWork on this project was primarily completed as follows:\n\nArchitecture Design : Nicholas Deckhut\n\nAssembler Programming : Brian Donald\n\nNICASM was loosely based on the LC3, with several changes made throughout its creation.\n\n## Instructions\nThis program works in tandem with a software called Logisim, the executable can be found [here](logisim/logisim.exe).\n\n#### Assembling a program\nThe software will run from the BetterAssembler class, and requires the following command line syntax:\n```\n  java site.projectname.Assembler [-debug] filename\n```\nExample .nic files can be found [in asmFiles](asmFiles)\n\n#### Executing a Program\n1. Open [logisim](logisim/logisim.exe)\n2. Load [Computer.circ](logisim/Computer.circ).\n3. Right click the memory object labeled \"MEM.HDD\", and select \"Load Image.\" Select the image you have assembled with BetterAssembler (Output file will be stored next to the original in a .nicp file)\n4. Ensure Simulate\u003eTicks Enabled is enabled (Keyboard Shortcut CTRL+K)\n5. Set Tick Speed to desired option Simulate\u003eTick Speed\n6. Turn the NIC on, power key is on the upper left\n7. Interact with program as needed\n   - Keyboard input is required when the ASK indicator is lit\n   - Keyboard is a white bar located in the upper-right, near the Clock and LD.READ tags, click on it to start typing, simply click elsewhere to stop\n\n## A Quick and Dirty intro to NICASM Syntax\nLike other assembly-like languages, NICASM has very rudimentary syntax, consisting of at most 3 or 4 parts per line. The most common are:\n- Command (ADD, AND, BR, JMP, etc.)\n  - Declares which operation this line performs\n  - Required on (nearly) every line.\n- Register (R0,R1,R2,R3)\n  - Refers to a value stored in a CPU Register\n  - NICASM has 8 registers available (0-7)\n- Immediate Value (#5,xF,etc.)\n  - Refers to a direct value, limits vary based on command\n- Variable ($MYVARNAME)\n  - Used to spare a headache, can be referred to by LD,LDI,LEA,ST,STI,and .FILL)\n- Label (\\*Label)\n  - Used to name a line, makes BR much simpler\n\n\n#### A not as Quick and much Dirtier intro to NICASM Syntax\n###### Commands\nGlossary\n\u003e DR   = Destination Register  \n\u003e SRX  = Source Register 0-7  \n\u003e IMMX = X-bit Immediate Value (-1\\*((2^x)/2-1) -\u003e ((2^x)/2-1)) ), can be Decimal(#) or Hexadecimal(x) (Example, IMM5 can be \\#-15 -\u003e \\#15)  \n\u003e PC   = Current memory address of program    \n\u003e PC'  = Next memory address of program (Most often PC+1)  \n```\nADD DR, SR1, [SR2|IMM5]\n\u003e Adds SR1 and [SR2|IMM5] and saves result in DR\n\u003e ADD R0 R0 R1\n\u003e ADD R0 R0 #15\n\nAND DR, SR1, [SR2|IMM5]\n\u003e Bitwise and of SR1 and [SR2|IMM5] and saves result in DR\n\u003e AND R0 R0 R1\n\u003e AND R0 R0 xF\n\nBR[n][z][p] [Label|IMM8]\n\u003e Jumps execution to line specified by Label, or line offset specified by IMM8\n\u003e n jumps if value is negative, z jumps if value is zero, p jumps if value is positive, order matters here, but they are all optional\n\u003e For Immediate Value the new PC will be PC'+IMM8\n\u003e BRn .Main\n\u003e BRp #-15 \\*Goes back 14 Lines (-15+PC' is the same as -14+PC)\\*\n\nJMP BR\n\u003e Always jumps program to line specified in BR (Base Register)\n\u003e JMP R7 \\*This command is identical to RET\\*\n\nJSR Label\n\u003e Jumps program to Label, used to create functions\n\u003e Stores current address in R7\n\u003e JSR .Main\n\nJSRR BR\n\u003e Identical to JSR, uses Register for offset rather than label\n\u003e Stores current address in R7\n\u003e JSRR R0\n\nLD DR, [Variable|IMM8]\n\u003e Loads value stored at variable or immediate value into Destination Register\n\u003e LD R0 $MyVarName\n\u003e LD R0 #127\n\nLDI DR, Variable\n\u003e Treats variable as pointer and loads that value into DR\n\u003e LDI R0 $MyVarName\n\nLDR DR, SR, IMM6\n\u003e Loads value at MEM[SR+IMM6] into DR\n\u003e LDR R0 R5 #-1\n\nLEA DR, [Variable|IMM8]\n\u003e Loads value of PC'+IMM8 or Variable into DR\n\u003e LEA R0 #-100\n\nNOT DR, SR\n\u003e Bitwise not of SR into DR\nNOT R0 R0\n\nRET\n\u003e Jumps program to address in R7, if used with JSR and JSRR it can form rudimentary functions\n\u003e RET\n\nST DR, [Variable|IMM8]\n\u003e Stores value of DR in variable, or MEM[PC'+IMM8]\n\u003e ST R0 $MyVarName\n\u003e ST R1 xF3\n\nSTI DR, Variable\n\u003e Treats variable as pointer and stores the value of DR there\n\u003e i.e. if $Pointer = x0001, and R0 = #10, then\n\u003e STI R0 $Pointer\n\u003e Would make MEM[x0001] = #10\n\nSTR DR, SR, IMM6\n\u003e Stores value in DR at MEM[SR+IMM6]\n\u003e STR R0 R1 #6\n\nTRAP\n\u003e Not used\n\n.FILL\n\u003e Fills the line with a IMM16, most commonly used for variables\n\n.BLK\n\u003e Blocks of a portion of lines as empty, good for creating space for array variables\n\u003e Shouldn't be used with large values, chunk into multiple smaller .BLKs\n\nREAD DR\n\u003e Gets a value from the user, and stores it in the given register\n\nPRINT SR\n\u003e Prints the character in the given register\n```\n###### Shorthand commands\n\nThese commands are given as a way to make common tasks much easier, because these add new lines, it is #extremely# recommended to use variables over offset values when using them in your program.\nThis is not a comprehensive list, the stack-specific shorthand commands have been left out, simply because they are not working properly at this time.\n```\n.SUB DR, SR1, SR2\n\u003e Subtracts SR2 from SR1 and stores into DR\n\n.MUL DR, SR1, [SR2|IMM5]\n\u003e Multiplies SR1 by SR2|IMM5 and stores in DR\n\n.SET DR, [IMM16|Variable]\n\u003e Sets DR to the IMM16 or Variable value\n\n.COPY DR, SR1\n\u003e Copies value from SR1 into DR\n\u003e Equivalent to ADD DR, SR1, #0, but makes code easier to read\n\n.ZERO DR\n\u003e Sets DR to 0\n\u003e Equivalent to AND DR,DR,#0, but makes code easier to read\n\n.MAIN\n\u003e Defines entry point of program\n\n.PRINTS [Variable|IMM16]\n\u003e Prints a string, stops upon reaching a negative value\n\n.READS IMM16\n\u003e Reads a string, stops reading on Return Key\n\u003e String gets stored at IMM16\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsmebriand%2Fnicasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsmebriand%2Fnicasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsmebriand%2Fnicasm/lists"}