diff --git a/cMIPS/tests/handlerUARTjedi2.s b/cMIPS/tests/handlerUARTjedi2.s index ec4f00b10019483187cd265c12b3407f8ecdedc3..31644ba89a61437fad1da862373019d05d18aa3f 100644 --- a/cMIPS/tests/handlerUARTjedi2.s +++ b/cMIPS/tests/handlerUARTjedi2.s @@ -22,6 +22,16 @@ sw $6, 10*4($k0) sw $7, 11*4($k0) + # check if queue is full, maybe increment + lui $5, %hi(nrx) + ori $5, $5, %lo(nrx) + lw $7, 0($5) + slti $6, $7, 16 + beq $6, zero, overrun + nop + addiu $7, $7, 1 + sw $7, 0($5) + # enqueue lui $5, %hi(rx_tl) # get rx tail address ori $5, $5, %lo(rx_tl) @@ -42,9 +52,14 @@ sb $7, 0($6) # and store it! #### process rx_tl -- update tail - #lw $7, 0($5) + #lw $7, 0($5) #nop +overrun: + + # do something if queue is full + #... (doing absolutely nothing besides stacking and unstacking regs) + # loading back used registers lw $5, 9*4($k0) lw $6, 10*4($k0)