Print all eight hexadecimal digits of a word
Online version: https://fpga.labsland.com/altera/computer-organization/lab-04/part-02/
Debugger setup
CPUlator simulatorRISC-V · DE1-SoC Nios V computer, simulated in your browser. No board or sign-in needed.
- Get the sourceDownload
hexword.s - Open the simulatorOpen CPUlator
Complete hex_word. It receives a 32-bit value in a0 and calls hex_digit once for each nibble, starting with the most significant. Keep leading zeros. Preserve each saved register you use, and save the return address before the first nested call. Keep sp aligned to 16 bytes.
Run the starter first. Identify the missing part of the terminal line. Predict the complete line for 0x00b30e04 and for zero. Test those values, 0x80000000 and 0xffffffff. Write the eight-digit field exactly as the terminal produced it.
Single-step one iteration. Which copy of the input survives the call to hex_digit? Submit the four observations and account for each word you stored on the stack.
Adapted from FPGAcademy Computer Organization 24.1 · Lab 4, Part II. LabsLand wrote the assembly and worksheet. MIT
