Trace a signed maximum in the debugger
Online version: https://fpga.labsland.com/altera/computer-organization/lab-01/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
trace.s - Open the simulatorOpen CPUlator
Load trace.s and choose Compile and Load. The five samples are signed 32-bit measurements. Before execution, predict the greatest value and its hexadecimal representation. If you initialized the candidate to zero, what would happen with this particular list?
Stop on each comparison
In Disassembly, go to inspect by entering its label in the address field. Click the gray breakpoint margin next to its first instruction and choose Continue. Record a0 and t0. Continue to the same breakpoint until the pointer reaches end_samples. Which comparison changes a0? Why does an equal value leave it alone?
Remove the breakpoint, continue to hold and press Stop. Open Memory (Ctrl-M), enter result in its address field and read the stored word. Compare it with the register. Use Restart, take two single steps, then double-click the PC value and enter the address of _start from Disassembly. Step again and describe which instruction executes.
Hand in
Submit the sequence of candidates, the final word from memory and one observation linking a source instruction to its effect. Replace the first sample by 24 and repeat. Distinguish the address of result from the value stored there.
Adapted from FPGAcademy · Computer Organization 24.1 · Lab 1, II. Original LabsLand assembly and worksheet. MIT
