main: li $a3, 0xffff0000 #base address of memory-mapped terminal countdown: li $s0, 3500000 #initialize time counter. Instruction rate is approximately one million instruction per second. waitloop: #wait one second (500000) addi $s0,$s0,-1 bnez $s0,waitloop CkReady: lw $t1,0($a3) #read from receiver control registers andi $t1, $t1, 1 #extract ready bit beqz $t1, CkReady lw $t0, 4($a3) #get character from the keyboard XReady: lw $t1,8($a3) #read from transmitter control register andi $t1, $t1, 1 #extract ready bit beqz $t1, XReady #if not ready branch back sw $t0, 12($a3) #send character to display b countdown #wait one second until the other poll