Lecture 12
Memory-Mapped I/O (MMIO)
Lecture
Outline
- I/O devices
- Direct memory access (DMA)
- Memory-mapped I/O (MMIO)
- Drivers
- RARS MMIO device emulators
Examples
Workshop
NOTE: The tasks from this workshop may take time. If one workshop is not enough to solve them, you may take some time from the next workshop (if it does not have a lot of practical materials).
-
Study and run the examples from the lecture.
-
Input a floating-point number, round it to one digit to the right of decimal point (e.g.
3.5) and display it in theDigital Sim Labdisplay. Use digit_lab1.s as a starting program. -
Modify the digit_lab2.s program to display keys pressed in the hexadecimal keyword in the digital display (as decimal values, e.g.
F==15). Use the workshop task as a basis. -
Write a program (based on digit_lab2.s) that inputs an integer value
X(with heReadIntsystem call) and then usesDigital Sim Labto enter 32-bit integers (8 hexadecimal digits)Y. It repeats entering integers until the enteredYis not equal toX. Then it printsFOUNDand exits. IfYequals0the program must printSTOPPEDand exit. -
Write a program that draws a square with size 64×64 dots in the middle of
Bitmap Display(see theToolsmenu of RARS) with size 128×128 dots. The color and the thickness of lines in dots is specified by the user (use theReadIntsystem call). See bitmap_display.s as an example.
Homework
TODO: Add descriptions and Ejudge tasks
Solve the following tasks and submit them into Ejudge:
- FullRainbow
- TheCircle
References
- Input/Output. Chapter 8 in [COA].
- Memory-mapped I/O. Section 9.2 in [DDCA].
- Memory-mapped I/O (Wikipedia).
- Direct memory access (Wikipedia).