UCT CSC2002 / 2023
Image processing at register level
Assembly exercises reading ASCII image data, manipulating channel values and writing image files.
UCT / COURSE CONTEXT / 2023
CSC2002S · Computer Science 2002
Concurrent programming, computer architecture and interface design, with Java and assembler practicals.
ENGINEERING PERSPECTIVE
Inside the work
Work below high-level image libraries: interpret bytes, parse channel numbers and emit a valid image representation. It connects image transformation to file formats, registers and buffer limits.
- MIPS / MARS-style syscalls
- Assembly file input/output loads and emits byte buffers.
- ASCII PPM / PGM
- Channel parsing and header conversion support grayscale and brightness exercises.
Read bytes
Load the input file into the submitted buffer using file syscalls.
- Representation
- ASCII channel digits must be decoded before arithmetic and encoded again for output.
- Format contracts
- P3/P2 headers, dimensions and line endings are part of a valid file.
- Bounds
- The original README acknowledges buffer-space and newline issues; byte parsing must respect capacity.
What the demonstration establishes
This walkthrough is source-derived documentation. No old simulator binary was executed and fixture images with unclear rights remain local.
Evidence behind this page
Assembly source, saved submission/Git context, original README and retained local output files.
How it works
MARS-style file syscalls load a byte buffer. The grayscale exercise changes the P3 header to P2, parses RGB channel numbers and emits grayscale values. A companion source explores brightness changes.
Results & recovery
- Original outputTree.ppm and outputHouse.ppm files remain available locally alongside assembly sources.
Technical limitations
Absolute paths, line-ending assumptions and buffer bounds remain in the original code. No old executable or simulator binary was run, and supplied fixture images are not republished.
What I would improve now
Use relative input/output arguments, validate ASCII headers and dimensions, and test malformed data in a verified MIPS toolchain.