diff --git a/asm/BasicLoop.asm b/asm/BasicLoop.asm index 8c43ca7..6454d8a 100644 --- a/asm/BasicLoop.asm +++ b/asm/BasicLoop.asm @@ -1,3 +1,6 @@ +.section .text +.globl _start +_start: # Basic loop ADDI t1, zero, 10 # t1 to 10 ADDI t2, zero, 1 #t2 to 1 diff --git a/asm/BasicLoop.hex b/asm/BasicLoop.hex deleted file mode 100644 index 26b1e9a..0000000 --- a/asm/BasicLoop.hex +++ /dev/null @@ -1,2 +0,0 @@ -:100000001303A0009303100033037340E31E03FEA9 -:00000001FF diff --git a/asm/BasicRegisters.asm b/asm/BasicRegisters.asm index 36ae580..06dd943 100644 --- a/asm/BasicRegisters.asm +++ b/asm/BasicRegisters.asm @@ -1,3 +1,7 @@ +.section .text +.globl _start +_start: + li t1, 150 li t2, 300 li t3, -250 diff --git a/asm/EternalLoop.asm b/asm/EternalLoop.asm index 8e78043..01eba6b 100644 --- a/asm/EternalLoop.asm +++ b/asm/EternalLoop.asm @@ -1,3 +1,7 @@ +.section .text +.globl _start +_start: + li t1, 150 li t2, 300 li t3, -250 diff --git a/asm/EternalLoop.hex b/asm/EternalLoop.hex index e423197..89074b8 100644 --- a/asm/EternalLoop.hex +++ b/asm/EternalLoop.hex @@ -1,3 +1,5 @@ +:020000021000EC :10000000130360099303C012130E60F0B30E730064 :0C001000338FC301B38F63406FF05FFFBC +:0400000310000000E9 :00000001FF diff --git a/asm/EternalLoop2.hex b/asm/EternalLoop2.hex deleted file mode 100644 index e423197..0000000 --- a/asm/EternalLoop2.hex +++ /dev/null @@ -1,3 +0,0 @@ -:10000000130360099303C012130E60F0B30E730064 -:0C001000338FC301B38F63406FF05FFFBC -:00000001FF diff --git a/asm/Memoryaccess.asm b/asm/Memoryaccess.asm index ef5b0f9..2fec136 100644 --- a/asm/Memoryaccess.asm +++ b/asm/Memoryaccess.asm @@ -3,4 +3,4 @@ li t2, 300 li t3, -250 sw t1, -4(t2) li t1, 500 -lw t1, -4(t2) +#lw t1, -4(t2) diff --git a/asm/memory.hex b/asm/memory.hex deleted file mode 100644 index ddebba2..0000000 --- a/asm/memory.hex +++ /dev/null @@ -1,18 +0,0 @@ -# Simple example -# JAL +2048 -#0010006F -# JAL +256 -#1000006F -# JAL +4 -0040006F -# ADD rd = R1, rs1 = R1, rs2 = R2 -002080B3 -# SUB rd = R3, rs1 = R1, rs2 = R2 -402081B3 -# ADD rd = R1, rs1 = R1, rs2 = R2 -002080B3 -# JAL -8 -# FF9FF06F -# JAL -12 -FF1FF06F -# END diff --git a/asm/out.hex b/asm/out.hex deleted file mode 100644 index e423197..0000000 --- a/asm/out.hex +++ /dev/null @@ -1,3 +0,0 @@ -:10000000130360099303C012130E60F0B30E730064 -:0C001000338FC301B38F63406FF05FFFBC -:00000001FF diff --git a/asm/test1.asm b/asm/test1.asm deleted file mode 100644 index 4a40148..0000000 --- a/asm/test1.asm +++ /dev/null @@ -1,8 +0,0 @@ -# test1.asm -JAL +4 -ADD t1, t1, t2 -SUB t3, t1, t2 -ADD t1, t1, t2 -# JAL -12 -J 10 -LUI t2, 250 diff --git a/asm/trace.asm b/asm/trace.asm new file mode 100644 index 0000000..5c00639 --- /dev/null +++ b/asm/trace.asm @@ -0,0 +1,34 @@ +.equ TRACE_BASE, 0x40000000 + +#msg: +# .string "Hello World\n" + +.section .text +.globl _start + +_start: + li a2, TRACE_BASE + li t0, 'H' + sb t0, 0(a2) + li t0, 'e' + sb t0, 0(a2) + li t0, 'l' + sb t0, 0(a2) + li t0, 'l' + sb t0, 0(a2) + li t0, 'o' + sb t0, 0(a2) + li t0, ' ' + sb t0, 0(a2) + li t0, 'w' + sb t0, 0(a2) + li t0, 'o' + sb t0, 0(a2) + li t0, 'r' + sb t0, 0(a2) + li t0, 'l' + sb t0, 0(a2) + li t0, 'd' + sb t0, 0(a2) + li t0, '\n' + sb t0, 0(a2) diff --git a/asm/trace2.asm b/asm/trace2.asm new file mode 100644 index 0000000..3066b0e --- /dev/null +++ b/asm/trace2.asm @@ -0,0 +1,16 @@ +.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"