diff --git a/cMIPS/include/handlers.s b/cMIPS/include/handlers.s index b063e416bc24f9b5b1c365dca8e3dae166275513..e39b4c2a8208bb202e344495c4c68b388ddf97e7 100644 --- a/cMIPS/include/handlers.s +++ b/cMIPS/include/handlers.s @@ -12,6 +12,7 @@ .bss .align 2 + .set noreorder .global _counter_val # accumulate number of interrupts .comm _counter_val 4 .comm _counter_saves 8*4 # area to save up to 8 registers @@ -31,9 +32,10 @@ extCounter: #---------------------------------- # save additional registers - # la $k1, _counter_saves - # sw $a0, 0*4($k1) - # sw $a1, 1*4($k1) + # lui $k1, %hi(_counter_saves) + # ori $k1, $k1, %lo(_counter_saves) + # sw $a0, 0*4($k1) + # sw $a1, 1*4($k1) #---------------------------------- lui $k1, %hi(HW_counter_value) @@ -48,10 +50,11 @@ extCounter: sw $k1,0($k0) #---------------------------------- - # and then restore same registers - # la $k1, _counter_saves - # lw $a0, 0*4($k1) - # lw $a1, 1*4($k1) + # and then restore those same registers + # lui $k1, %hi(_counter_saves) + # ori $k1, $k1, %lo(_counter_saves) + # lw $a0, 0*4($k1) + # lw $a1, 1*4($k1) #---------------------------------- mfc0 $k0, cop0_STATUS # Read STATUS register @@ -69,6 +72,7 @@ extCounter: .bss .align 2 + .set noreorder .global rx_queue,rx_hd,rx_tl # reception queue and pointers .comm rx_queue 16 .comm rx_hd 4 @@ -201,4 +205,3 @@ cmips_delay: nop .end cmips_delay #---------------------------------------------------------------- - \ No newline at end of file diff --git a/cMIPS/tests/extCounter.c b/cMIPS/tests/extCounter.c index 1b4e373733c82fb2ec59023e59b280e0786bf737..75a0b628bf73151a16f471763ae83c66e2290045 100644 --- a/cMIPS/tests/extCounter.c +++ b/cMIPS/tests/extCounter.c @@ -14,13 +14,12 @@ void main(void) { int i, increased, new, old, newValue; newValue = CNT_VALUE; - startCounter(newValue, 0); // no interrupts for (i=0; i < N; i++) { // repeat N rounds print(i); // print number of round newValue = CNT_VALUE + (i<<3); - startCounter(newValue, 0); // num cycles increases with i + startCounter(newValue, 0); // num cycles increases with i, no interrupts increased = TRUE; old = 0; diff --git a/cMIPS/tests/uarttx.c b/cMIPS/tests/uarttx.c index 36a44e98adb9348ec84987ea05887b4a70c77d12..ba59e25fd1b4b029b8db2c2ab452b49fce295f48 100644 --- a/cMIPS/tests/uarttx.c +++ b/cMIPS/tests/uarttx.c @@ -44,7 +44,7 @@ typedef struct serial { #define LONG_STRING 1 #if LONG_STRING -char *dog = "\n\tthe quick brown fox jumps over the lazy dog\n"; +char *dog = "\tthe quick brown fox jumps over the lazy dog"; char s[32]; #else char s[32]; // = "123";