Author: Will Hall
Course: CS155 — Computer Organization and Assembly Language
Final Project — Spring 2025
This LC-3 assembly program converts a two-digit Celsius temperature (00–99) into Fahrenheit using the formula:
F = (C × 9 / 5) + 32
The program:
- Prompts the user to input two ASCII digits
- Converts those digits into an integer Celsius value
- Applies fixed-point arithmetic using integer instructions only
- Outputs the resulting Fahrenheit value in clean, 3-digit decimal format
- Subroutine usage with
JSR
andRET
- Manual ASCII-to-integer conversion
- Fixed-point integer multiplication and loop-based division
- Controlled output formatting using TRAP routines
- Stack pointer initialization (
R6
) - Register discipline and clean, modular program structure
- All code written using instructions from the textbook (Patt & Patel)
This program is designed to run using LC3Tools, the modern command-line and GUI LC-3 simulator:
https://github.com/jrincayc/LC3tools
- Open the LC-3 Simulator
- Load the file:
celsius_to_fahrenheit_final.asm
- Assemble the program (
Assemble → Assemble All
) - Set PC to
x3000
if not already set - Run the program (
Simulate → Run
) - Input two digits when prompted (e.g.,
3
and0
for 30°C) - The program will output the Fahrenheit result
- Must be run in LC3Tools — the modern LC-3 simulator
- Only works with numeric input (
00
to99
) — no input validation is provided - Output is always in 3-digit format (e.g.,
032
,086
,111
)
This project involved debugging and understanding:
- How to simulate math operations without floating-point support
- Why register preservation is critical
- How trap routines interact with display formatting
- The LC-3 instruction lifecycle and memory safety
- How to structure a clean, modular assembly program under real constraints
This project was written and debugged over two months. Every line of logic was hand-built, corrected, and verified through repeated testing. It is stable, accurate, and designed to reflect mastery of the LC-3 as taught in this course.