OpenCores
URL https://opencores.org/ocsvn/m1_core/m1_core/trunk

Subversion Repositories m1_core

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 41 to Rev 42
    Reverse comparison

Rev 41 → Rev 42

/trunk/tests/typewriter.c
0,0 → 1,14
 
int main() {
unsigned long* text_vga_out = (unsigned long*)0xFA000000;
unsigned long* ps2_keyboard_in = (unsigned long*)0xFB000000;
unsigned long last_char;
 
while(1) {
last_char = (unsigned long)(*ps2_keyboard_in);
asm("nop");
if(last_char!=0) (*text_vga_out) = last_char;
asm("nop");
}
return 0;
}
/trunk/tests/hello.c
0,0 → 1,13
// Sample program that writes some words at a predefined address
 
int main() {
unsigned long* address = (unsigned long*)0xFABA1210;
(*address) = (unsigned long)'H';
(*address) = (unsigned long)'e';
(*address) = (unsigned long)'l';
(*address) = (unsigned long)'l';
(*address) = (unsigned long)'o';
(*address) = (unsigned long)'!';
(*address) = (unsigned long)'\n';
return 0;
}
/trunk/tests/hello.dump
0,0 → 1,48
 
hello.bin: file format elf32-tradlittlemips
 
Disassembly of section .text:
 
00000000 <main-0x10>:
0: 201d1000 addi $29,$0,4096
4: 3c1fdead lui $31,0xdead
8: 37ffbeef ori $31,$31,0xbeef
c: 00000000 sll $0,$0,0x0
 
00000010 <main>:
10: 27bdffe8 addiu $29,$29,-24
14: afbe0010 sw $30,16($29)
18: 03a0f021 addu $30,$29,$0
1c: 3c02faba lui $2,0xfaba
20: 34421210 ori $2,$2,0x1210
24: afc20008 sw $2,8($30)
28: 8fc30008 lw $3,8($30)
2c: 24020048 addiu $2,$0,72
30: ac620000 sw $2,0($3)
34: 8fc30008 lw $3,8($30)
38: 24020065 addiu $2,$0,101
3c: ac620000 sw $2,0($3)
40: 8fc30008 lw $3,8($30)
44: 2402006c addiu $2,$0,108
48: ac620000 sw $2,0($3)
4c: 8fc30008 lw $3,8($30)
50: 2402006c addiu $2,$0,108
54: ac620000 sw $2,0($3)
58: 8fc30008 lw $3,8($30)
5c: 2402006f addiu $2,$0,111
60: ac620000 sw $2,0($3)
64: 8fc30008 lw $3,8($30)
68: 24020021 addiu $2,$0,33
6c: ac620000 sw $2,0($3)
70: 8fc30008 lw $3,8($30)
74: 2402000a addiu $2,$0,10
78: ac620000 sw $2,0($3)
7c: 00001021 addu $2,$0,$0
80: 03c0e821 addu $29,$30,$0
84: 8fbe0010 lw $30,16($29)
88: 27bd0018 addiu $29,$29,24
8c: 03e00008 jr $31
90: 00000000 sll $0,$0,0x0
94: 00000000 sll $0,$0,0x0
98: 00000000 sll $0,$0,0x0
9c: 00000000 sll $0,$0,0x0
/trunk/tests/puts.c
0,0 → 1,19
// Sample program that writes some words at a predefined address
 
int main() {
char Hello[] = "Hello";
while(1) {
puts(Hello);
}
return 0;
}
 
int puts(char* string) {
unsigned long* TextOut = (unsigned long*)0xFA000000;
int i;
while(string[i]!=0) {
(*TextOut) = string[i];
i++;
}
return 0;
}
/trunk/tests/fact.c
0,0 → 1,13
// Factorial
 
int main() {
int num = 5;
int fact = fact_f(num);
return 0;
}
 
int fact_f(int n) {
if(n==1) return 1;
else return n*fact_f(n-1);
}
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.