Error 2 means that program execution ended, please check that you declare variables in "DATA" block, etc.
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.![]()
Error 2 means that program execution ended, please check that you declare variables in "DATA" block, etc.
This is the code for it, from one of the examples in the SVN:Error 2 means that program execution ended, please check that you declare variables in "DATA" block, etc.[/b]
//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)
Don't attach frequency (let it be default value)
Attach CLK of screen to your CLK button.
Ahh, that seems to have fixed it, thanksDon't attach frequency (let it be default value)
Attach CLK of screen to your CLK button.[/b]![]()
Bookmarks