Engineering Lab

UCT CSC2002 / 2023

Image processing at register level

Assembly exercises reading ASCII image data, manipulating channel values and writing image files.

MIPS assemblyPPM / PGMFile syscallsByte parsing

UCT / COURSE CONTEXT / 2023

CSC2002S · Computer Science 2002

Concurrent programming, computer architecture and interface design, with Java and assembler practicals.

Science handbook · 2023

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.
STEP 1 / 3

Read bytes

Load the input file into the submitted buffer using file syscalls.

Source-derived walkthrough

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.

NEXT IN THE ARCHIVEParallel neighbourhood filters