# Test interrupt-driven i/o. .text main: addi $sp,$sp,-4 sw $s0,0($sp) la $t7,initTransmitter jalr $t7 la $s0,alphabet loop: lb $a0,0($s0) beq $a0,$0,done la $t7,putchar jalr $t7 addi $s0,$s0,1 j loop done: j done .data alphabet: .asciiz "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" .ktext initTransmitter: mfc0 $t0,$12 # Set global interrupt-enable bits. ori $t0,0xFF01 mtc0 $t0,$12 lui $t0,0xFFFF sw $0,12($t0) # Send a null character to the transmitter. jr $ra putchar: sb $a0,outputBuffer # Store character into the output buffer. addi $t3,$0,1 sb $t3,outputBufferIsFull lui $t0,0xFFFF # Turn on transmitter (display) interrupts. lw $t1,8($t0) ori $t1,$t1,2 sw $t1,8($t0) jr $ra