CS 631-02 Systems Foundations — Meeting Summary¶
- Date: Mar 10, 2026
- Time: 02:50 PM Pacific (US and Canada)
- Meeting ID: 882 2309 0019
Quick Recap¶
The session focused on assembly language programming and its relationship to high-level languages such as Rust. Greg demonstrated a “Hello, World” program written in assembly without C libraries, covering calling conventions, stack management, and byte ordering. He introduced bitwise operations and explained how the Rust compiler performs overflow checks in debug mode. He emphasized why understanding assembly is essential for systems programming and for illuminating how high-level languages work. The session concluded with an outline of upcoming topics: strings, bitwise operators, and generating RISC-V assembly code from NT-Lang.
Next Steps¶
- Greg:
- Send the explicit algorithm for insertion sort (and swap) via Campus Wire.
- Post the Rust implementation of insertion sort for reference.
- Release the next assignment (Lab 4) today or early tomorrow.
- Students:
- Use Rust GDB to step through their assembly code as part of Lab 4.
Detailed Summary¶
Assembly Language and PICO Modifications¶
- Greg clarified common difficulties when learning assembly, especially around branching, and contrasted how conditions should be reasoned about in assembly versus C or Rust.
- He noted he would follow up with an explicit sorting algorithm via Campus Wire (previously omitted by mistake).
- He introduced modifications to PICO code (forked to run on the Beagle) and mentioned the need for an API key.
- He aimed to make the PICO interface resemble Cloud Code, adding multi-line input and Shift+Enter submission; however, terminal compatibility may vary.
Assembly Programming Challenges¶
- Two core challenges were highlighted:
- Adhering to calling conventions.
- Managing control structures (branches, conditionals, loops).
- He compared Rust and C sorting functions, noting differences in string representation and handling across languages.
- He identified the need for an illustrative slide on conditionals in assembly.
Conditional Branches in Assembly Language¶
- He walked through implementing conditional logic with AND and OR, showing how high-level conditions expand into multiple branch sequences.
- He corrected a prior misunderstanding about a variable’s value and gave a step-by-step method for writing accurate conditional branches in assembly.
Compiler Implementation and Architecture Planning¶
- He discussed compiler responsibilities for decomposing high-level constructs (especially multiple conditions and branches) into machine code.
- Planned topics:
- Strings and bitwise operators.
- RISC-V assembly code generation.
- He proposed adding a code generator to NT-Lang to build a small end-to-end compiler and mentioned a possible future just-in-time (JIT) compiler for NT-Lang.
- He reviewed standardized but somewhat arbitrary register conventions in RISC-V.
RISC-V Registers and Endianness¶
- He explained caller-saved vs. callee-saved registers and why preserving register values across function calls matters.
- He covered byte ordering (endianness), distinguishing:
- Little-endian
- Big-endian
- He noted that while processors fetch memory in chunks, only the needed bytes are used immediately; the rest are cached.
Big-Endian vs. Little-Endian¶
- He compared architectures and configurability:
- Modern ARMs and RISC-V support configurability.
- Using GDB, he demonstrated that RISC-V employs little-endian format.
- In response to why a single universal format isn’t used, he explained trade-offs, including big-endian’s advantages for human-readable memory display.
Assembly Language Programming Concepts¶
- Key topics reinforced:
- Byte ordering’s importance in systems, networking, and data processing.
- Writing “Hello, World” entirely in assembly without C libraries.
- Bitwise operators and techniques for extracting bit sequences from integers.
- Rust compiler behavior in debug mode, particularly overflow checks.
- He emphasized that learning assembly deepens understanding of compilers and prepares students for advanced systems work.