+ Reply to Thread
Results 1 to 5 of 5

Thread: Problems running CPU

  1. #1
    andy1976uk
    Guest andy1976uk's Avatar

    Default

    Hi, I've started playing with the CPU but it's not going very well so far, wondering if someone had some insight into it. Can't get any of the example programs working. Am I right in thinking Error 2 on the CPU means successful compilation? I keep getting that, however, nothing appears on screens or debug watches.

    I've got these inputs when using helloworld.txt:

    Clk + Reset: 2 buttons (1 toggle, 1 non-toggle)
    Frequency: have tried 5000, 2000, 1000, 500, 100 and not setting it all.
    Membus: Have it connected to console screen

    In desperation I also tried wiring the screen's Clk and Reset inputs to the buttons I'm using for Clk and Reset although my suspicion is it get's those values from CPU's membus. Screen just remains black with no text.

  2. #2
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Error 2 means that program execution ended, please check that you declare variables in "DATA" block, etc.
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  3. #3
    andy1976uk
    Guest andy1976uk's Avatar

    Default

    Error 2 means that program execution ended, please check that you declare variables in "DATA" block, etc.[/b]
    This is the code for it, from one of the examples in the SVN:

    //Wired Hello World!
    //Connect CPU membus input to console screen
    //Connect CPUs CLK input to button (toggle)
    //Notice how you can store your
    //subroutines/calls in DATA area
    DATA;
    message:
    db 'Hello World!',0;
    WriteString: //ESI - String pointer, EDX - Param
    mov eax,65536;
    AWriteLoop:
    cmp #esi,0; //Terminate on char 0
    je AEnd;
    mov #eax,#esi; //Output char
    inc eax;
    mov #eax,edx; //Output char param
    inc eax;
    inc esi;
    jmp AWriteLoop;
    AEnd:
    ret //Return from call

    CODE;
    mov esi,message;
    mov edx,000999; //White foreground on black background
    call WriteString;

    //More about colors:
    //Lower 3 digits are foreground,
    //and higher 3 digits are background
    //Each of 3 digits shows amount of
    //RED, GREEN, and BLUE (in order)
    //Each color has 10 shades - from 0 to 9
    //
    //For example, 999044 will be dark yellow (044) on
    //a white background (999)
    //
    //Experiment with colors!
    //
    //Also, the 7th digit (if its not equal to 0) will
    //cause the character to blink by changing foreground and
    //background places (actual data in memory wont change)

  4. #4
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Don't attach frequency (let it be default value)
    Attach CLK of screen to your CLK button.
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  5. #5
    andy1976uk
    Guest andy1976uk's Avatar

    Default

    Don't attach frequency (let it be default value)
    Attach CLK of screen to your CLK button.[/b]
    Ahh, that seems to have fixed it, thanks

+ Reply to Thread

Similar Threads

  1. Running console commands with wire
    By System Paradox in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 7
    Last Post: 09-18-2008, 10:17 PM
  2. Problem running my first compare...
    By Xandaros in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 21
    Last Post: 07-05-2008, 05:51 PM
  3. People RUNNING servers with latest SVN
    By cheeze in forum Installation and Malfunctions Support
    Replies: 6
    Last Post: 11-01-2007, 02:49 PM
  4. Fourstroke V8 running on semi-realistic firing order
    By TestECull in forum Finished contraptions
    Replies: 3
    Last Post: 10-09-2007, 02:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots