commit dfe368ecd912b49a10165cb34c95491e5759a87c
parent d519ef5fab85e6532e94055f513fb7a8247517eb
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Mon, 18 Mar 2024 12:34:49 +0900
use '=' signe to load the address of a label.
storing to the automatically saved pc causes hard fault
Diffstat:
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ex3/main.c b/ex3/main.c
@@ -63,9 +63,8 @@ main(void) {
 	p1.r[15] = 0x20000101; // pc
 	p1.next = NULL;
 
-	//proc0();
+	proc0();
 	for (;;) {
-		puts("a");
 		wfi();
 		for (int i = 0; i < 17; i++) {
 			printh(ptab.head->r[i]);
diff --git a/ex3/proc.s b/ex3/proc.s
@@ -2,7 +2,7 @@
 	.section .proc0, "a"
 	.global proc0
 proc0:
-	ldr r0, msg0
+	ldr r0, =msg0
 	bl puts
 	b proc0
 
@@ -14,7 +14,7 @@ msg0:
 	.section .proc1, "a"
 	.global proc1
 proc1:
-	ldr r0, msg1
+	ldr r0, =msg1
 	bl puts
 	b proc1
 
@@ -36,7 +36,7 @@ isr_alarm:
 	push {lr}
 
 	// debug:
-	ldr r0, alarm_msg
+	ldr r0, =alarm_msg
 	bl puts
 
 	sub sp, sp, #(17*4) // unsigned int r[17];
@@ -99,8 +99,8 @@ isr_alarm:
 	add r3, r3, #4
 	ldr r0, [r1, r2]
 	str r0, [r1, r3] // ReturnAddress(ExceptionType): The next pc at interrupt.
-	ldr r0, =0x20000101 // The entry point of proc1
-	str r0, [r1, r2]
+//	ldr r0, =0x20000101 // The entry point of proc1
+//	str r0, [r1, r2]
 
 	add r2, r2, #4
 	add r3, r3, #4