CPU development thread

Discussion in 'General Off-Topic' started by vmlinuz, Sep 25, 2015.

  1. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    As some of you may know, I'm making my own CPU architecture. I figured I should make a thread for progress updates.

    Today I'm working on asynchronous I/O. I'm not a 5cr1p+ k1dd13, so the whole thing is being done in C rather than ECMAScript (the generic name for javascript). You may be wondering, "Linux, how are you making asynchronous I/O in a language with no support for asynchronous I/O?" Well, the answer is POSIX threads. Yes, I'm doing a multi-threaded C program. Ugh :p

    Code snippet du jour:

    void *asynctestOne(void *crap)
    {
    pthread_mutex_lock(&olock);
    printf("asunk %d times, this is test one\n", asynctests);
    asynctests++;
    pthread_mutex_unlock(&olock);
    return(NULL);
    }
    void *asynctestTwo(void *crap)
    {
    pthread_mutex_lock(&olock);
    printf("asunk %d times, this is test two\n", asynctests);
    asynctests++;
    pthread_mutex_unlock(&olock);
    return(NULL);
    }
    void *asynctestThree(void *crap)
    {
    pthread_mutex_lock(&olock);
    printf("asunk %d times, this is test three\n", asynctests);
    asynctests++;
    pthread_mutex_unlock(&olock);
    return(NULL);
    }
     
  2. DerpSheep

    DerpSheep
    Expand Collapse

    Joined:
    Nov 22, 2014
    Messages:
    116
    Can you post info on hardware? I find it alot more interesting, especially for a CPU architecture. I have just started working on my own architecture modelled off a real computer (northbridge, southbridge etc.), and not just a bunch off logic gates that add numbers. (well i guess thats all computers do...... So whatever) sorry if i make no sense, I am tired and trying to type with a phone.
     
  3. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    It's implemented entirely in software.
     
  4. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,958
    On this note, I've just got TIS-100, such a clever little game
     
  5. DerpSheep

    DerpSheep
    Expand Collapse

    Joined:
    Nov 22, 2014
    Messages:
    116
    So you are simulating it?
     
  6. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    Yes, it is a simulator. Unfortunately it has my real name on it, and as such, it will not be distributed on this forum :(
     
  7. DerpSheep

    DerpSheep
    Expand Collapse

    Joined:
    Nov 22, 2014
    Messages:
    116
    I totally understand.
     
  8. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    I call upon the people of this forum to assist me in my asynchronous I/O quest. PM me if interested. You must know C or C++.

    Thank you :cool:
     
  9. DerpSheep

    DerpSheep
    Expand Collapse

    Joined:
    Nov 22, 2014
    Messages:
    116
  10. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    Only input will be asynchronous. This is because output does not need to wait; it can be triggered whenever and it will run immediately. Input will be done in blocks, like the mainframes of old.

    Code snippet du jour:

    Code:
    //vmz/mrl32 assembly code
    _entry:
    
    LSP 4096D
    LDA &string
    PSA
    CLO &strPut
    HLT
    
    string: $'Hello World\n'
    
    strPut:
    
    XAS
    DEC
    XAS
    PPA
    XAS
    ADD 2D
    XAS
    XAI
    
    DCA <&strPut - 1>
    
    getWord:
    
    LDI <&strPut - 1>
    XAI
    LDR
    
    XAI
    LDI <&strput - 2>
    SBT 4
    JZ &incrementWordCounter
    
    BTI <&strPut - 2>
    
    JZ &exit
    
    DCA 65535
    IOC 1
    
    LDI <&strPut - 2>
    INC
    DCA <&strPut - 2>
    JMP &getWord
    
    incrementWordCounter:
    
    DCA <&strPut - 2>
    LDI <&strPut - 1>
    INC
    DCA <&strPut - 1>
    JMP &getWord
    
    exit:
    
    RET
    
     
    #10 vmlinuz, Sep 27, 2015
    Last edited: Sep 27, 2015
  11. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    Terminal input is now complete (for now). I wrote a program for the MRL32 that repeats whatever you type, then exits.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice