{"id":16528931,"url":"https://github.com/ftzi/Logiwin","last_synced_at":"2025-05-07T03:30:41.204Z","repository":{"id":115671319,"uuid":"116445424","full_name":"ftzi/Logiwin","owner":"ftzi","description":"An old Logisim project that implemented a computer from a logic circuit. Spent some years doing it. Stopped when reached the software level.","archived":false,"fork":false,"pushed_at":"2021-06-30T06:34:30.000Z","size":6463,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T06:29:39.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/ftzi.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":"2018-01-06T02:07:33.000Z","updated_at":"2024-03-22T14:29:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"3954f457-7691-4576-8bec-da4994ed3829","html_url":"https://github.com/ftzi/Logiwin","commit_stats":null,"previous_names":["hfantauzzi/logiwin","brfantauzzi/logiwin","ftzi/logiwin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftzi%2FLogiwin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftzi%2FLogiwin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftzi%2FLogiwin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftzi%2FLogiwin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ftzi","download_url":"https://codeload.github.com/ftzi/Logiwin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252806348,"owners_count":21807189,"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-10-11T17:42:16.092Z","updated_at":"2025-05-07T03:30:41.189Z","avatar_url":"https://github.com/ftzi.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+\nLogiwin Open Project\nVersion 1.1.0  - xx/05/2016\n\nStarting date of this documentation: 28/02/15 (Like a year before publishing it!)\n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n                                   # Index #\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Also try Ctrl+f\n\n    1. Introduction\n    2. Basic Explanations\n    3. Patch notes\n    4. Future updates list\n    5. Downloads links\n    6. Advanced Explanations\n    7. Console Special Codes\n    8. Clock Script\n    9. Instruction Set Descriptions\n    A. Instruction Set List\n    B. Credits, special thanks and contact\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n1.                               Introduction\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Hi!\n\n    Hello, fellow reader! This is a hobby of mine, that I have been working for some years; maybe 3, maybe 4 (EDIT 1.1.0: Now maybe 6)\n    This circuit is my interpretation of a computer, but it doesn't follow strictly any existing system.\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n2.                            Basic Explanations\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| A better introduction!\n\n    4.1)  My main idea in this project is to be an easily modified circuit by any one (with some knowledge), and you should do it. I really want a community\n for it, and this includes Programmers, Artists, JAR libraries modders (AltruismAndCake, the first one!) and Eletronics.\n    4.2)  I didn't intended to make the project look like a real CPU, computer, etc. This is my interpretation of what it should be to work \n in a single-clock and to have the fastest simulation speed as possible. When I started it, I didn't have specific knowledges about programmation, engineering, etc.\n Some stuff can work similiarly to real life. If you have better ideas for names of anything, tell me so I can correct it and make more \n common user-friendly. Most instructions I made intended to look like Assembly but there's are some differences.\n    4.3)  Most sub-circuits have explanations inside them. They might help you.\n    4.4)  Remember the propagation delays in the circuits. Some stuff are ugly to workaround it.\n    4.5)  Contact me by e-mail or in the Reddit. The information about contact is on the end of this documentation. If you share, modify \n or just really liked this project, tell me! I will be happy to know that this hobby got its fans :)\n    4.6)  The connections in this circuit can look strange, but most were intentional. Looks like the fewer wire nodes, the faster the simulation frequency will be.\n    4.7)  Many informations you may need are in this documentation. However, some of the functionalities and explanations may be missing. Contact me \n for further help..\n    4.8)  Also, there can be some misleading informations in this document, as I change stuff on the project all the time and I forget to update they info here.     \n If anything is unclear or wrong, contact me to fix it.\n    4.9)  Looking for basic help? So you should google: Hexadecimal, Logic gates, Machine Code, CPU architetures,\n Instruction sets, Assembly, etc.\n    4.A)\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n3.                                Patch notes\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| So, what's the news?\n\n    v1.1.0 - xx/06/18 Yeah, this update took some really big time. Everytime I find a big problem here I just\nget real bored just by opening Logisim and then I close it.\n\n\n    New: LASM: Logiwin Assembly. A whole notepad++ Python Script code to compile Assembly-like codes.  \n        Bin to BCD decoder intruction.\n        Find lowest/highest low/high bit instruction (FLL, FHL, FLH, FHH)\n        Compare instruction changed, it will now output Signed/Unsigned relations.\n        So, new conditional Jumps added: Jump if Above and Jump if Below (and the Equal variations), for unsigned comparations.\n        LIFO added, with Push, Pop, Call and Return instructions.\n        Random instruction.\n        Keyboard added.\n        Added and changed a lot of stuff in this Readme.\n        Store Current Address (SCA) instruction.\n        Increase and Decrease (INC \u0026 DEC) instructions.  \n        Joystick added.\n        Renamed MOV to ACC, as MOV was very ambiguos.\n        It now have 2 clocks instead of one (read 7.3).\n        The main RAM controller is now inside the CPU, got some performance buff.\n        Removed all the delayers from the Console, as I added a new Clock.\n        Changed some intructions code.\n        General perfomance boosts. Unfortunatelly, with all the new stuff, the performance has decayed.\n        General changes.\n        \n\n    Fixes: Fixed CMP clearing Acc. \n        Fixed conditional jumps.\n        Some general stuff.\n\n    v1.0.5 - 03/03/16 Added SWP and ERS instructions. JMP instructions can now jump to values stored in Address. Changed text 7-bit to 8-bit\n(easier to deal with). Some general changes. Changed some stuff in this documentation. Added a Mario in a screen for fun (and for some research).\nGreat times are coming!\n\n    v1.0.1 - 25/02/16 Fixed a small problem, NOT and NEG weren't connected on ALU.    \n\n    v1.0.0 - 25/02/16 Almost an year since the beggining of this documentation on notepad++ (but now you should open it on normal notepad for the\nformatation). Time flies! The first public Logiwin version, still very alpha, but I wanted to share the most soon as possible! Most don't work yet,\nbut it is possible to have some fun just with the memory and console on the main circuit.\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n4.                            Future updates list\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Hey, hey! What's coming next?\n\n    Mouse-Pad mod compatibility (when it exists!) - Ever wanted to touch you screen?\n    Sound (Waiting for a mod!)\n    Floating Point System\n    Programs, as Notepad, programs editor, Paint brush style program, etc etc. Already writing some.\n    An Operating System. Maybe I will call it Logiwin OS. Looks badass.\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n5.                              Downloads links\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Here's what you need to have it running. Be sure to do \"5.2)\" item. \n\n    5.1)  Logisim, the simulation program (I recommend the cornell unnoficial version). I don't like Logisim Evolution, it changes a lot of\n components, making them huge for 32 bits wide, complex and weird. Maybe on future I will port to it, however, as it is updated frequently.\n \n        Unnoficial recomended version:\n            NOTE: On my PC, to make the mods work with this unnoficial version, I had to first run the official Logisim and load them. \n            Otherwise the mods wouldn't load properly.\n            http://www.cs.cornell.edu/courses/cs3410/2015sp/logisim-2.7.2-cs3410-20140215.jar\n       \n        Official Logisim:\n            NOTE: I still recommend the unnoficial version above. With the official, you may not be able to select properly select devices\n                like the keyboard, which have a part around it.\n            https://sourceforge.net/projects/circuit/\n\n    5.2)  The mods. You MUST download this, instructions on how to install on the page, but I assure you it's pretty easy! :) \n        https://www.reddit.com/r/logisim/comments/46lrow/modding_new_mods_folder/\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n6.                           Technical Informations\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n| So you want to LEARN?\n    6.1)  \"X\" in this documentation can be even 0 or 1, sometimes changing it functionallity.\n    6.2)  NEVER EVER write anything in Address 0x000000, it WILL get buggy. Some instructions propagations delays will use it.\n        Just avoid this bad Address and everything is gonna be alright!  \n    6.3)  0xxx xxx1:\n        First bit = 1 (The last form left to right, the 1st bit)\n        Last bit = 0  (The first from left to right, the 8th bit)\n    6.4)  You can directly only use 24-bit data (like ADD #0xffffff), but it is possible to do stuff like this:\n      Have the value already written on memory, and access it when you want\n                      Or if you don't have it written\n                ACC #0xffffff (load on Accumulator the last 24 bits.)\n                SHL #0x000008 (shift left acc for 8 units)\n                ADD #0x0000aa (add the first 8 bits)\n      Now you will have a full 32-bit data on the Accumulator, and can do this\n                STO #0xXXXXXX (store this value at any place you want)\n      And finally, when you want\n                ADD 0xXXXXXX  (will use the value you stored, that will stands for 0xffffffaa (32-bit sized))\n    6.5)  \"ALU Flag\" is like a Carry Flag, but indicates if there is carry out from sum or multiplication, burrow out from substract and remain from divide.\n    6.6)  \"Out2\" from ALU outputs the remain from divide or carry out from multiplication. I will give it an instruction later.\n    6.7)  Address = 24bits\n        0000 0000 0000 0000 0000 0000\n        23-24bits for determinating the storage device (leftist ones)\n         = 00 is for the non-volatile memory, a SSD-like memory.\n         = 01 is for the volatile memory, a RAM-like memory.\n         = The other values are for now unused, maybe in the future new storage devices will be added.\n    6.8)  Deppending on your real hardware, you will get a faster or slower simulation frequency (so will be the Instructions per Second).\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n7.                          Console Special Codes\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Specials ASCII codes for the Console, the screen which outputs text.  \n\n    7.1)  Copied from the Library Reference from Logisim: \n        \"The only supported control sequences are: backspace (ASCII 8), which deletes the last character in the final row, unless the final row is already empty; \n        newline (ASCII 10), which moves the cursor to the beginning of the following line, scrolling if necessary;\n        and form-feed (ASCII 12, typed as control-L), which clears the screen.\"\n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n8.                             Clock Script\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| What happens in each part of the CPU clock cycle. Remember this concept: \n          ____      ____ _ _  1 (High)\n     ____/    \\____/    \\____ 0 (Low) \n    (  8.1   8.2   8.1   8.2)\n\n    8.1)  Rising Edge\n        a) Program Counter Increases (or jump if instructed to).\n        b) If instructed, data is be stored in the Memory, or in the Accumulator or in the LIFO.\n        c) The instruction register is cleared (to avoid propagation issues).\n        \n    8.2) Falling Edge\n        a) Instruction is loaded.\n        b) Some instructions are executed.\n        \n    8.3)  Since v1.1.0, circuit have 2 clocks, the CPU clock and the new one.\n        CPU Clock -\u003e Now by default have a Low Duration of 3 (you can change to 5,7,9...), but still have a High Duration of 1. (Read 1/3 timing)\n        It don't make the circuit work slower (for having a higher delay between clocks), as when you increase the delay, the simulation frequency increases.\n        Ex: Before, when the CPU clock was 1/1, when the Logiwin CPU was 100% on load, the Logisim simulation was ~1KHz (~500 Instructions per Second).\n        Now with 1/3 for example, in heavy usage (same circunstances), frequency displayed is on ~2KHz (still ~500 ips)\n        For the curious ones, on 1/5 Clock, the frequency was ~3KHz (Still ~500ips!).\n        As you see, this change (made to fix some issues) won't slow down the Logiwin CPU. \n        New one -\u003e The another Clock is a 1/1 timing clock, for general porpouses (like console).\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n9.                        Instruction Set Explained                     \n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Don't know how a instruction works, or what it do? Here you can learn about it.\n\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n    9.1)    General\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n \n    a) ACC = Accumulator\n        Move a value into Accumulator. If the 32nd bit is active, will take the value from the given Address, else, will store a direct value.\n        But if the 32nd bit is active, and no Address is given, it will use the value from the Address, like a pointer.\n        Ex1: Store the value 0x000010 into the Accumulator\n            ACC #0x000010\n        Ex2: Store the value of the Address 0x123321 into the Accumulator\n            ACC 0x123321\n        Ex3: Store the content of the Address given by the Accumulator into the Accumulator\n            Accumulator holds 0x00001234\n            Address 0x001234 holds 0xffffaaaa\n            ACC 0x000000\n            Now Accumulator holds 0xffffaaaa\n\n    b) STO = Store\n        Store the current value of the Accumulator on the given Address. The 32nd bit doesn't change the functionality.\n        Ex1: Store the value into the Address 0x809010\n            STO #0x809010 (or 0x809010)\n\n    c) ERS = Erase\n        Clears the selected Address (with zeroes). The same as \"ACC #0x000000; STO Y\", without messing the current value of Accumulator.\n        The 32nd bit doesn't change the functionality.\n        Ex1: Erase the Address 0x300020\n            ERS #0x300020 (or 0x300020)\n\n    d) SWP = Swap the values of Accumulator with the chosen Address. The 32nd bit doesn't change the functionality.\n        Ex1: Accumulator holds value \"100\"\n        The Address 0x000030 holds value \"359\"\n        \u003eSWP #0x000030  Now the Accumulator will hold the value \"359\", and the Address will hold the value \"100\".\n\n    e) TXT = Outputs text in console            [CONS \u003c= Y]\n        Uses the simple 7-bit ASCII code (google it, uses the same scheme), but you can group them, and send up to four digits by time.\n            (But to fit better on the 32bit system, the 7-bit ASCII is extended to 8-bit, with the last bit unused.)\n        The writing on the console is made from left to right.\n        You can use 64-bit to send the maximum of 4 characters by clock, using Address: \n            0x01 | TXT 0x00000f      = (0x9300000f) = 1001 0011 0000 0000 0000 0000 0000 1111\n            ...\n            0x0f | 0x4c6f6769                   = '0100 1100' '0110 1111' '0110 0111' '0110 1001' (the ' ' are separating the characters\")\n                                                          (L)         (o)         (g)         (i)\n             Will output \"Logi\" to the console, as you can see in the circuit.\n        Or you could just use just 32-bit of memory to send the maximum of 3 character per clock\n                0x01 | TXT #0x4c6f67     = (0x134c6f67)  Will output \"Log\" to the console\n\n        \n\n    f) KEY = Stores the current character entered on keyboard   [ACC/MEM \u003c= External Input #1]\n        If no data is given with the instruction (=0x18000000), the ASCII will be saved on the Accumulator, else, \n        the ASCII will be saved on this Address. The 32nd bit doesn't change the functionality.\n        Ex1: Stores the current key on the Accumulator\n            KEY #0x000000 (or 0x000000)\n        Ex2: Stores the current key on the Address 0x123456\n            KEY #0x123456 (or 0x123456)\n\n    g) SCA = Store Current Address on the memory or in the address\n        Ex:   This command is being readed on the memory Address 0x000030 (=0x30).\n        Ex1: 0x30 | SCA #0x000000                     The Accumulator will now hold the value 0x30.\n        Ex2: 0x30 | SCA  0x000070 (Or SCA 0x000070)   The Address 0x000070 will now hold the value 0x30.\n\n    h) SRA = Set Relative Address\n        This one is a little complex, but just think of instead using the 0x000000 Address as an start point,\n        we changed it, so you can place a code anywhere in the memory and it would work without changing anything\n        (just the SRA value, but you can create a small function to do it automatically. Tip: Use SCA).\n        Ex1: Here we won't use the SRA command. Imagine we just executed the instruction in 0x30.\n               0x40 | 0xDEADBEEF   This address just hold this value.\n               0x45 | 0xCAFEF00D   This address just hold this value.\n               \n               0x30 | ACC 0x000040 This will normally load the \"0xDEADBEEF\" into the Accumulator.\n               \n        Ex2: Here we will use the SRA command. Imagine we executed the instructions 0x30 and 0x31.\n               0x40 | 0xDEADBEEF    This address just hold this value.\n               0x45 | 0xCAFEF00D    This address just hold this value.\n               \n               0x30 | SRA #0x000005 This will make the address 0x000005 as an starting point.\n               0x31 | ACC 0x000040  This is the same command from the Ex1, but it will load the \"0xCAFEF00D\" into the Accumulator,\n                                        as you changed the starting point.\n        As you can see, if you use the SRA command, all the Addresses you consult/change will be added from the SRA value.\n        You can at anytime revert it to the normal by executing \"SCA #0x000000\").\n        You can also use values stored on Memory. Imagine we started on address 0x09.\n          Ex3: 0x07 | 0x00000003    This address just hold this value.\n               0x09 | SRA 0x000007  As you see, no \"#\". So it will use an value stored in Memory. In the end, the Relative Address will now be 0x3.\n   \n    i) RND = Random\n        This will generate a random 32 bits value, based on basic Logisim random number generator. If no data is given, the random number\n        will be stored on Accumulator, else, it will be stored on the memory. The 32nd bit doesn't change the functionality.\n        Ex1: Generate a random value to the Accumulator\n            RND #0x000000 (or 0x000000)\n        Ex2: Generate a random value to the Address 0x37\n            RND #0x000047 (or 0x000047)\n    \n    j) PSH = Push\n        This will store a 32 bits value into the LIFO (Last In First Out) memory. If the 32nd bit is active, it will store the value\n        stored in the given address, else, will store the direct value.\n        Ex1: Push the value 1000h\n            PSH #0x001000\n        Ex2: Push the value stored on the Address 0x000011\n            PSH 0x000011\n\n    k) POP = Pop\n        This will take out the last value stored on the LIFO (as the name says), and will store it on the Accumulator if no data is given, else\n        will store on the given Address. The 32nd bit doesn't change the functionality.\n        Ex1: Pop into the Accumulator\n            POP #0x000000\n        Ex2: Pop into the Address 0x947203\n            POP #0x947203 (or 0x947203)        \n|\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n    9.2)    Jumps\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| COMPFLAG = Comparative Flag\n        \n    a) CMP = Compare Accumulator and value                    [COMPFLAG = \u003c, =, \u003e = 1, 2, 4]\n        Attention: the focus is the value at Acc, ex:\n        ACC #0x000008 -\u003e Acc value is now 8.\n        CMP #0x000002 -\u003e Compare with the number 2.\n        This will result in \"\u003e\", COMPFLAG 4. Number 8 is bigger than number 2. Be careful.\n\n    b) JMP = Jump to Address                                   [ADDRESS \u003c= Y]\n        Ex1: JMP #0x000050 -\u003e will jump to the address 0x000050\n        Ex2: JMP 0x000060 -\u003e will read value from the address 0x000060 and jump to that value. In this case, will jump to 0x0000ff.\n            0x000060 = #0x0000ff\n\n    c) JZ  = Jump to adress if Accumulator is 0                [ADDRESS = Y if ACC == 0]\n    d) JNZ = Jump to adress if Accumulator is not 0            [ADDRESS = Y if ACC !== 0]\n    e) JC  = Jump to adress if ALU Flag is 1                   [ADDRESS \u003c= Y if ALUFLAG == 1]\n    f) JNC = Jump to adress if ALU Flag is 0                   [ADDRESS \u003c= Y if ALUFLAG == 0]\n    \n    g) JA  = Jump if Above             (Unsigned)\n    h) JAE = Jump if Above or Equal    (Unsigned)\n    i) JG  = Jump if Greater           (Signed)\n    j) JGE = Jump if Greater/Equal     (Signed)\n    k) JE  = Jump if Equal             (Both)\n    l) JNE = Jump if Not Equal         (Both)\n    m) JB  = Jump if Below             (Unsigned)\n    n) JBE = Jump if Below/Equal       (Unsigned)\n    o) JL  = Jump if Less              (Signed)\n    p) JLE = Jump if Less or Equal     (Signed)\n    \n    q) CAL = Store (Push) the actual Address +1 into the LIFO memory, and Jump to the given Address.\n    \n    r) RET = Return\n        Pops the last LIFO data, and use it as an Address to Jump to.\n|\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n   9.3  Mathematics (X=ACC, Y=Value)\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| The Value can be a direct value or indirect one.\n|    Ex: ADD #0x000008  -\u003e Will add the value 8 to the Accumulator.\n|    Ex: ADD  0x0000FF  -\u003e Will add the value stored on the address 0x0000FF.\n        \n    a) ADD = Add\n        Move to the Accumulator the result of Accumulator + value\n        \n    SUB = Substract\n        Move to the Accumulator the result of Accumulator - value\n        \n    MUL = Multiply\n        Move to the Accumulator the result of Accumulator * value\n        If there is a carry out, it will be stored on a auxiliar register inside the ALU, and it can be moved to the Accumulator with the AL2 instruction.\n        \n    DIV = Divide\n        Move to the Accumulator the integer result of Accumulator / value\n        If there is a remain, it will be stored on a auxiliar register inside the ALU, and it can be moved to the Accumulator with the AL2 instruction.\n        \n    INC = Increase by 1 the data hold on the selected Address. If the argument is 000000, will Increase the Accumulator value instead.\n          The 32nd bit doesn't change this instruction functionallity.\n        Ex1: ACC #0x000005      Move the value \"5\" to the Accumulator.\n             STO #0x000080      Will store the value on the Accumulator (\"5\") on the Address 0x000080.\n             INC #0x000080      The address will now hold the value \"6\" (5+1)\n             INC #0x000080      The address will now hold the value \"7\" (6+1)\n             \n        Ex2: ACC #0x000003      Move the value \"5\" to the Accumulator.\n             INC #0x000000      Now the Accumulator holds the value \"4\".\n\n    DEC = Decrease by 1 the data hold on the selected Address. If the argument is 000000, will Decrease the Accumulator value instead.\n          The 32nd bit doesn't change this instruction functionallity.\n        Ex1: ACC #0x000005    Move the value \"5\" to the Accumulator.\n             STO #0x000080    Will store the value on the Accumulator (\"5\") on the Address 0x000080.\n             DEC #0x000080    The address will now hold the value \"4\" (5-1)\n             DEC #0x000080    The address will now hold the value \"3\" (4-1)\n             \n        Ex2: ACC #0x000003      Move the value \"5\" to the Accumulator.\n             DEC #0x000000      Now the Accumulator holds the value \"2\".\n    \n    NEG = Negate Accumulator                  [X \u003c= -X]\n        Invert the signal of the content of the Accumulator.\n        Note that this instruction doesn't use any additional information. Just do \"NEG #0x000000\".\n        The 32nd bit doesn't change this instruction functionallity.\n        \n    CMP = Compare\n    \n    AL2 = ALU output 2\n        Move to the Accumulator the previous auxiliar output of Multiplication (carry out) or Division (remain).\n        The 32nd bit doesn't change this instruction functionallity.\n        \n    FLL = Find Lowest Low\n        Move to the Accumulator the position of the lowest bit of value 0 of the Accumulator value. If no low bit is found, 0 will be stored into the Accumulator.\n        Ex: ACC #0x0000FC   (ACC = 0000 0000 0000 0000 0000 0000 1111 1100)\n            FLL\n            \u003e Accumulator will now have the value 0x1\n            \n    FHL = Find Highest Low\n        Move to the Accumulator the position of the highest bit of value 0 of the Accumulator value. If no low bit is found, 0 will be stored into the Accumulator.\n        Ex: ACC #0x0000FC   (ACC = 0000 0000 0000 0000 0000 0000 1111 1100)\n            FHL\n            \u003e Accumulator will now have the value 0x20 (32 in decimal)\n            \n    FLH = Find Lowest High\n        Move to the Accumulator the position of the lowest bit of value 1 of the Accumulator value. If no high bit is found, 0 will be stored into the Accumulator.\n        Ex: ACC #0x0000FC   (ACC = 0000 0000 0000 0000 0000 0000 1111 1100)\n            FLH\n            \u003e Accumulator will now have the value 0x3\n     \n    FHH = Find Highest High\n        Move to the Accumulator the position of the highest bit of value 1 of the Accumulator value. If no high bit is found, 0 will be stored into the Accumulator.\n        Ex: ACC #0x0000FC   (ACC = 0000 0000 0000 0000 0000 0000 1111 1100)\n            FHH\n            \u003e Accumulator will now have the value 0x8\n|         \n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n   9.4  Logical\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n| \n|  These ones are self explaining, logical operations.\n|  If LSB 31 is 1, will use an Address content as argument, else, will use the direct value as argument.\n  \n    AND = Logical AND.\n    OR  = Logical OR.\n    XOR = Logical Exclusive OR.\n    NND = NAND, Logical NOT AND. Took a letter out to have just 3 letters.\n    NOR = Logical NOT OR.\n    XNR = XNOR, Logical Exclusive NOT OR. Took a letter out to have just 3 letters.\n    NOT = Logical NOT. Only affects the Accumulator. The 32nd bit doesn't change it's functionallity. Doesn't use any argument.\n        Ex: ACC #0x0000AA (ACC = 0000 0000 0000 0000 0000 0000 1010 1010)\n            NOT           Accumulator will now hold 0xFFFF55 ( = 1111 1111 1111 1111 1111 1111 0101 0101)\n|\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-   \n   9.5  Shift / Rotate \n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n|    Moves the bits of the value in the Accumulator.\n|    6th bit to 24th bit aren't used, only the least 5 significant bits, for the distance (maximum of 32)\n    \n    SHL = Shift Accumulator value left\n        Ex: ACC #0xF000F0 (ACC = 0000 0000 1111 0000 0000 0000 1111 0000)\n            SHL #0x000008 (ACC = 1111 0000 0000 0000 1111 0000 0000 0000)\n            SHL #0x000002 (ACC = 1100 0000 0000 0011 1100 0000 0000 0000)\n            \n    SHR = Shift Accumulator value right\n    \n    ROL = Rotate Accumulator value left\n        Ex: ACC #0xF000F0 (ACC = 0000 0000 1111 0000 0000 0000 1111 0000)\n            SHL #0x000008 (ACC = 1111 0000 0000 0000 1111 0000 0000 0000)\n            SHL #0x000002 (ACC = 1100 0000 0000 0011 1100 0000 0000 0011)\n            \n    ROR = Rotate Accumulator value right\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nA.                          Instruction Set List\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| A quick reference guide. Compact, simple, fast. Everything you need is in here.\n|\n|   The instructions are ordered by crescent order (the same way visible on Instructions sub-circuit).\n|   If any of these doesn't work properly, contact me to fix it.\n|   The X in the Binary means \"Don't-Care\" (https://en.wikipedia.org/wiki/Don%27t-care_term), it will not change\n|       the instruction functionality. However, to don't make confusions, in the list below it wont be listed the hexadecimal code\n|       for the indirect mode (X = 1). Do prefer the X = 0 alternative, as the X = 1 may be added in the future.\n|   The D in the Binary will usually stands for direct and indirect modes, in the Hexadecimal column, the \"#\" is Y = 0, and the \n|       \"A\" is Y = 1. To know the differences between them, read the specific instruction information in the previous section.\n|\n|   The \"#\" usually stands for the direct mode.\n|       Ex: ACC #0xBABACA, will store this value on the Accumulator.\n|\n|   The \"A\" (Address) usually stands for the indirect mode, will use the value stored in the given Address.\n|       Ex: ADD 0x000fff, will add the value stored in this address.\n|          \n|   The \"S\" stands for \"Store at given Address\".\n|       If followed by \"!\", you can if you use 0x0 as argument to these instructions, it will involve the Accumulator\n|       (usually storing something at the Accumulator). Read the instruction description.\n|   The \"-\" stands for \"Don't care\" (https://en.wikipedia.org/wiki/Don%27t-care_term); doesn't matter.\n|       This instruction doesn't have arguments. '-' instead of 'X' to facilitate the reading.\n|       To make a default, The LSB 31 = 0 is encouraged (and always used in LASM compiler).\n\n\n[Binary ][Name]  [    Hexadecimal     ]    [Quick description]\n                 [Argument prefix LASM]\n                     [#]      [None]   \n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n   A.1  GENERAL    \n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n                   \n-000 0000 NOP  \u003c\u003e  0x00 (-) - 0x80 (-)    - No Operation. Nothing will happen.\nD000 0001 ACC  \u003c\u003e  0x01 (#) - 0x81 (A)    - Move to Accumulator\n1000 0010 STO  \u003c\u003e  -------  - 0x82 (S)    - Store\n1000 0011 ERS  \u003c\u003e  -------  - 0x83 (S)    - Erase\n1000 0100 SWP  \u003c\u003e  -------  - 0x84 (S)    - Swap\n\n\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n   A.2  JUMPS\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\nD000 0111 CAL  \u003c\u003e  0x07 (#) - 0x87 (A!)   - Call\n\nD000 1000 JMP  \u003c\u003e  0x08 (#) - 0x88 (A!)   - Jump\nD000 1001 JZ   \u003c\u003e  0x09 (#) - 0x89 (A!)   - Jump if Zero\nD000 1010 JNZ  \u003c\u003e  0x0A (#) - 0x8A (A!)   - Jump if Not Zero\nD000 1011 JC   \u003c\u003e  0x0B (#) - 0x8B (A!)   - Jump if Carry flag\nD000 1100 JNC  \u003c\u003e  0x0C (#) - 0x8C (A!)   - Jump if Not Carry flag\nD000 1101 JA   \u003c\u003e  0x0D (#) - 0x8D (A!)   - Jump if Above            (Unsigned)\nD000 1110 JAE  \u003c\u003e  0x0E (#) - 0x8E (A!)   - Jump if Above or Equal   (Unsigned)\nD000 1111 JG   \u003c\u003e  0x0F (#) - 0x8F (A!)   - Jump if Greater          (Signed)\nD001 0000 JGE  \u003c\u003e  0x10 (#) - 0x90 (A!)   - Jump if Greater or Equal (Signed)\nD001 0001 JE   \u003c\u003e  0x11 (#) - 0x91 (A!)   - Jump if Equal\nD001 0010 JNE  \u003c\u003e  0x12 (#) - 0x92 (A!)   - Jump if Not Equal\nD001 0011 JB   \u003c\u003e  0x13 (#) - 0x93 (A!)   - Jump if Below            (Unsigned)\nD001 0100 JBE  \u003c\u003e  0x14 (#) - 0x94 (A!)   - Jump if Below or Equal   (Unsigned)\nD001 0101 JL   \u003c\u003e  0x15 (#) - 0x95 (A!)   - Jump if Less             (Signed)\nD001 0110 JLE  \u003c\u003e  0x16 (#) - 0x96 (A!)   - Jump if Less or Equal    (Signed)\nD001 0111 RESERVED 0x17 (#) - 0x97 (A)\nD001 1000 RESERVED 0x18 (#) - 0x98 (A)\nD001 1001 RESERVED 0x19 (#) - 0x99 (A)\nD001 1010 RESERVED 0x1A (#) - 0x9A (A)\n\n-001 1011 RET  \u003c\u003e  -------  - 0x9B (-)    - Return to Call command origin\n\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n   A.3  GENERAL2\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n1001 1100 INC  \u003c\u003e  -------  - 0x9C (S!)   - Increase (+=1) the data on Address (poderia os dois)\n1001 1101 DEC  \u003c\u003e  -------  - 0x9D (S!)   - Decrease (-=1) the data on Address\n\n1001 1110 SCA  \u003c\u003e  -------  - 0x1E (S!)   - Store Current Address\nD001 1111 SRA  \u003c\u003e  0x1F (#) - 0x9F (A)    - Set Relative Address\n1010 0000 RND  \u003c\u003e  -------  - 0x40 (S!)   - Random\nD010 0001 PSH  \u003c\u003e  0x41 (#) - 0xC1 (A!)   - Push\n1010 0010 POP  \u003c\u003e  -------  - 0x42 (S!)   - Pop\n\nD001 1110 TXT  \u003c\u003e  0x43 (#) - 0xC3 (A!)   - Outputs text to console (External Output 1)\nD001 0101 ???  \u003c\u003e  0x44 (#) - 0xC4 (A!)   - External Output 2 - to be added\nD001 0110 ???  \u003c\u003e  0x45 (#) - 0xC5 (A!)   - External Output 3 - to be added\nD001 0110 ???  \u003c\u003e  0x46 (#) - 0xC6 (A!)   - External Output 3 - to be added\n\n1001 1000 KEY  \u003c\u003e  -------  - 0x47 (S!)   - Store the ASCII entered (External Input 1)\n1001 1001 ???  \u003c\u003e  -------  - 0x48 (S!)   - To be added             (External Input 2)\n1001 1010 JOY  \u003c\u003e  -------  - 0x49 (S!)   - Store the Joystick data (External Input 3)\n1001 1011 ???  \u003c\u003e  -------  - 0x4A (S!)   - To be added             (External Input 4)\n\n\n\n\n#######X010 0001 BCD  \u003c\u003e  0x41 (#) - 0xC1 (A)    - Bin to Bcd decoder (not added yet)\n\n\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n   A.4  ARITHMETICH LOGIC UNIT (ALU)\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\nD010 0001 ADD  \u003c\u003e  0x21 (#) - 0xA1 (A!)   - Add\nD010 0010 SUB  \u003c\u003e  0x22 (#) - 0xA2 (A!)   - Substract\nD010 0011 MUL  \u003c\u003e  0x23 (#) - 0xA3 (A!)   - Multiply\nD010 0100 DIV  \u003c\u003e  0x24 (#) - 0xA4 (A!)   - Divide\n\nD010 0101 CMP  \u003c\u003e  0x25 (#) - 0xA5 (A!)   - Compare\nD010 0110 ---  \u003c\u003e  0x26 (#) - 0xA6 (A!)   - RESERVED\n\nD010 0111 AND  \u003c\u003e  0x27 (#) - 0xA7 (A!)   - And Logic\nD010 1000 OR   \u003c\u003e  0x28 (#) - 0xA8 (A!)   - Or Logic\nD010 1001 XOR  \u003c\u003e  0x29 (#) - 0xA9 (A!)   - Xor Logic\nD010 1010 NND  \u003c\u003e  0x2A (#) - 0xAA (A!)   - Nand Logic\nD010 1011 NOR  \u003c\u003e  0x2B (#) - 0xAB (A!)   - Nor Logic\nD010 1100 XNR  \u003c\u003e  0x2C (#) - 0xAC (A!)   - Xnor Logic\n\nD010 1101 SHL  \u003c\u003e  0x2D (#) - 0xAD (A!)   - Shift Left\nD010 1110 SHR  \u003c\u003e  0x2E (#) - 0xAE (A!)   - Shift Right\nD010 1111 ROL  \u003c\u003e  0x2F (#) - 0xAF (A!)   - Roll Left\nD011 0000 ROR  \u003c\u003e  0x30 (#) - 0xB0 (A!)   - Roll Right\n\n[D011 0001 ~ ?011 1000] Not used yet, feel free to add and share new instructions in this interval (floating points would be awesome)\n\n-011 1001 AL2  \u003c\u003e        0x39 (-)         - ALU output 2\n\nD011 1010 FLL  \u003c\u003e  0x3A (#) - 0xBE (A!)   - Find Lowest Low\nD011 1011 FHL  \u003c\u003e  0x3B (#) - 0xBE (A!)   - Find Highest Low\nD011 1100 FLH  \u003c\u003e  0x3C (#) - 0xBE (A!)   - Find Lowest High\nD011 1101 FHH  \u003c\u003e  0x3D (#) - 0xBE (A!)   - Find Highest High\n\nD011 1110 NOT  \u003c\u003e  0x3E (#) - 0xBE (A!)   - Not\nD011 1111 NEG  \u003c\u003e  0x3F (#) - 0xBF (A!)     Negate\n|\n|\n|\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nB.                Credits, special thanks and contact\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n|\n| Contact me!\n\n    Special thanks to:\n        AltruismAndCake - Reddit\n        armorall171     - Reddit\n\n    By Henrique Bruno Fantauzzi de Almeida, Rio de Janeiro - RJ, Brazil.\n        henrique.bruno.fa@gmail.com\n        SrBrahma (Reddit), the Logisim subreddit is: https://www.reddit.com/r/logisim/\n        Main post: https://redd.it/47lypv\n|\n|\n|\n+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftzi%2FLogiwin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fftzi%2FLogiwin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftzi%2FLogiwin/lists"}