examples updated
This commit is contained in:
		
							parent
							
								
									11fae01cba
								
							
						
					
					
						commit
						9961f080c9
					
				|  | @ -37,3 +37,4 @@ Log.txt | |||
| helper.ods | ||||
| *.swp | ||||
| RISCV_TLM | ||||
| dump | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| TARGET   = trace | ||||
| TARGET   = forloop | ||||
| 
 | ||||
| TARGET_ARCH=riscv32 | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ TARGET_ARCH=riscv32 | |||
| 
 | ||||
| CC       = riscv32-unknown-linux-gnu-gcc | ||||
| # compiling flags here
 | ||||
| #CFLAGS   = -Wall -I. -O0 -nostartfiles  -march=rv32i -mabi=ilp32
 | ||||
| CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 | ||||
| 
 | ||||
| LINKER   = riscv32-unknown-linux-gnu-gcc | ||||
|  |  | |||
|  | @ -1,12 +1,10 @@ | |||
| #define TRACE (*(unsigned char *)0x40000000) | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| void main(void) { | ||||
|   char msg[] = "Hello world\n"; | ||||
|   char msg[] = "abcdefg\n"; | ||||
|   int i; | ||||
| 
 | ||||
|   for (i=0; msg[i] != '\0'; i++) { | ||||
|   for (i=0; i<5; i++) { | ||||
|     TRACE = msg[i]; | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| li t1, 150 | ||||
| li t1, 0xCAFE | ||||
| li t2, 300 | ||||
| li t3, -250 | ||||
| sw t1, -4(t2) | ||||
| li t1, 500 | ||||
| #lw t1, -4(t2) | ||||
| li t3, 0xBEEF | ||||
| sb t1, -6(t2) | ||||
| sb t3, -13(t2) | ||||
| li t1, 23 | ||||
| lbu t1, -6(t2) | ||||
| lbu t3, -13(t2) | ||||
|  |  | |||
|  | @ -1,16 +0,0 @@ | |||
| .equ TRACE_BASE, 0x40000000 | ||||
| 
 | ||||
| .section .text | ||||
| .globl _start | ||||
| _start: | ||||
| 
 | ||||
|         la a0, msg | ||||
| 
 | ||||
| 1:      li a2, TRACE_BASE | ||||
| #        addi a0, a0, 1 | ||||
| #        j 1b | ||||
| 
 | ||||
| 
 | ||||
| #.section .rodata | ||||
| msg: | ||||
| 	    .string "Hello World\n" | ||||
		Loading…
	
		Reference in New Issue