Resource icon

    8-bit CPU 2015-04-30

    Please don't spawn this on a [public] multiplayer server.

    I'm not sure how well this will load for people - particularly given the ~2300 NOT gates it contains. Hopefully they will spawn in a known state. Also, give it a few minutes to warm up when you spawn it - premature excitation may produce unpredictable results.

    For full information on how it works, perhaps even getting it running, it's probably best you follow the demonstrations on my YouTube channel, though the instruction set is given below.
    https://www.youtube.com/channel/UCh96_mEB9Dfci56osmly8qA

    Some quirks to note:
    1. Instructions are MSB towards the display end (rear of ship) of each RAM byte.
    2. Data values are MSB towards the front of the ship.
    3. Half the RAM is negative addressed! Oops. I think that means the $PC will start working backwards from 0xff (which always reads 0x00). I haven't tested that far myself. Just something to be aware of if you have either program or data that spans this junction.
    4. Writing to oxff outputs to the screen. Screen controls are at the very end of this description.


    Also, disclaimer:
    This ship was not necessarily designed as optimally as possible. Some design decisions were purely cosmetic, or enabled easier modularisation.
    I estimate that ~15% of the logic blocks are not actually required, minus of course the extra blocks used in RAM that could be replaced with a different system in a later edition of StarMade.

    THE AUTHOR ACCEPTS NO LIABILITY FOR ANY LOSS OR DAMAGES THAT MAY OCCUR FROM THE USE OF THIS DATA, NOR IS ANY WARRANTY IMPLIED OR GIVEN. USE AT YOUR OWN RISK.


    8-bit StarMade CPU Instruction Set:

    Load/Store Commands:
    LDR $ra, $rd Load from $ra into $rd 00 [$ra:3] [$rd:3, $rd != 000]
    LDP $rd Load $PC - 1 into $rd 00 [$rd:3] 000
    STR $ra, $rd Store $rd into $ra 01 [$ra:3] [$rd:3]

    Control Commands:
    BZO $o Branch to $PC + (signed)$o if Z 10 000 [$o:3]
    BNO $o Branch to $PC + (signed)$o if N 10 001 [$o:3]
    BCO $o Branch to $PC + (signed)$o if C 10 010 [$o:3]
    BVO $o Branch to $PC + (signed)$o if V 10 011 [$o:3]
    JO $o Jump to $PC + (signed)$o 10 10 [$o:4]
    JR $r Jump to $r 10 110 [$r:3]

    ALU Commands:
    GET $r Put $RES into $r 10 111 [$r:3]
    ADD $r Add $r to $RES 11 000 [$r:3]
    SUB $r Subtract $r from $RES 11 001 [$r:3]
    // MUL $r Multipy $RES by $r 11 010 [$r:3]
    // DIV $r Divide $RES by $r 11 011 [$r:3]
    UN $r Set $RES to ~$r 11 100 [$r:3]
    AND $r AND $RES with $r 11 101 [$r:3]
    OR $r OR $RES with $r 11 110 [$r:3]
    XOR $r XOR $RES with $r 11 111 [$r:3]


    Screen Controls:
    0x00-0x09: 0-9 digits
    0x0a-0x23: A-Z letters
    0x40 | value: enable period for position
    0x80 | value: action command. This prevents accidental writes to 0xff from corrupting your screen (unless of course they include 0x80);
    0x30-0x3f: Move cursor to position 0-15. Cursor automatically moves when a data value is set.
    Author
    Chaosinflesh
    Downloads
    308
    Views
    504
    First release
    Last update
    Rating
    5.00 star(s) 2 ratings

    Latest reviews

    Question, Does this modify anything in a server? If not, Then ok, Lel
    Dude, you're the most awesome kind of nerd. Way to build.