IT3030E-CA-Chap7-IO System
IT3030E-CA-Chap7-IO System
Processor Devices
Control Output
Memory
Datapath Input
Interrupts
Processor
Cache
Graphics Network
Disk Disk
❑ Terminal:
Input: receiver control (0xffff0000) and data (0xffff0004)
Output: transmitter control (0xffff0008) and data (0xffff000c)
WaitForDis:
lw t2, 0(s1) # t2 = [s1] = DISPLAY_READY
beq t2, zero, WaitForDis # Polling
Encrypt:
addi t0, t0, 1 # change input key
ShowKey:
sw t0, 0(s0) # show key
j
IT3030E Fall 2024
loop 30
Interrupt driven I/O
❑ The I/O device issues an
interrupt to indicate that it needs
attention.
❑ The processor detects and
“serves” the interrupt by
executing a handler (aka.
Interrupt service routine).
# Set the UEIE (User External Interrupt Enable) bit in UIE register
li t1, 0x100
csrrs zero, uie, t1 # uie - ueie bit (bit 8)