.text lw $s0, kbdstatus # enable interrupts ori $s0, 2 sw $s0, kbdstatus mainloop: # now loop doing nothing nop j mainloop .text 0x80000180 # in MARS the ISR must be at this address isr: move $k0, $at # save $at; needed by assembler for following instrs lw $k1, kbddata # load the character from kbd sw $k1, dispdata # display the character (note: not correct; doesn't test display ready) move $at, $k0 # restore #at eret # return from ISR; re-enables interrupts .data 0xffff0000 kbdstatus: .space 4 kbddata: .space 4 dispstatus: .space 4 dispdata: .space 4