1.1 --- a/vga.S Sat Nov 18 17:54:35 2017 +0100
1.2 +++ b/vga.S Sat Nov 18 19:12:50 2017 +0100
1.3 @@ -851,42 +851,6 @@
1.4
1.5
1.6
1.7 -/* Exception handler. */
1.8 -
1.9 -exc_handler:
1.10 - mfc0 $t7, CP0_ERROREPC
1.11 - nop
1.12 -
1.13 -exc_write_word:
1.14 - li $t8, 32
1.15 - la $v0, U1TXREG
1.16 -exc_loop:
1.17 - addiu $t8, $t8, -4
1.18 - srlv $v1, $t7, $t8 /* $v1 = $t7 >> $t8 */
1.19 - andi $v1, $v1, 0xF
1.20 - addiu $t9, $v1, -10 /* $t9 >= 10? */
1.21 - bgez $t9, exc_alpha
1.22 - nop
1.23 -exc_digit:
1.24 - addiu $v1, $v1, 48 /* convert to digit: '0' */
1.25 - j exc_write
1.26 - nop
1.27 -exc_alpha:
1.28 - addiu $v1, $v1, 55 /* convert to alpha: 'A' - 10 */
1.29 -exc_write:
1.30 - sw $v1, 0($v0)
1.31 - bnez $t8, exc_loop
1.32 - nop
1.33 -exc_loop_end:
1.34 - li $v1, '\n'
1.35 - sw $v1, 0($v0)
1.36 -
1.37 -exc_handler_end:
1.38 - j exc_handler_end
1.39 - nop
1.40 -
1.41 -
1.42 -
1.43 /* Event routines. */
1.44
1.45 /* The vertical back porch. */
1.46 @@ -1058,3 +1022,39 @@
1.47 _vsync_active_ret:
1.48 jr $ra
1.49 nop
1.50 +
1.51 +
1.52 +
1.53 +/* Exception handler. */
1.54 +
1.55 +exc_handler:
1.56 + mfc0 $t7, CP0_ERROREPC
1.57 + nop
1.58 +
1.59 +exc_write_word:
1.60 + li $t8, 32
1.61 + la $v0, U1TXREG
1.62 +exc_loop:
1.63 + addiu $t8, $t8, -4
1.64 + srlv $v1, $t7, $t8 /* $v1 = $t7 >> $t8 */
1.65 + andi $v1, $v1, 0xF
1.66 + addiu $t9, $v1, -10 /* $t9 >= 10? */
1.67 + bgez $t9, exc_alpha
1.68 + nop
1.69 +exc_digit:
1.70 + addiu $v1, $v1, 48 /* convert to digit: '0' */
1.71 + j exc_write
1.72 + nop
1.73 +exc_alpha:
1.74 + addiu $v1, $v1, 55 /* convert to alpha: 'A' - 10 */
1.75 +exc_write:
1.76 + sw $v1, 0($v0)
1.77 + bnez $t8, exc_loop
1.78 + nop
1.79 +exc_loop_end:
1.80 + li $v1, '\n'
1.81 + sw $v1, 0($v0)
1.82 +
1.83 +exc_handler_end:
1.84 + j exc_handler_end
1.85 + nop