EECS 373 - Fall 2026 - Lecture 2: “Instruction Set Architecture (ISA)”
Overview
EECS 373 Lecture 2 explains the ARMv7-M Instruction Set Architecture used in the course, focusing on Thumb-2, the register and memory model, and how instructions move and manipulate data. It connects ARM's licensing model and standardized memory map to practical assembly topics, including instruction encodings, status flags, loads and stores, addressing modes, and conditional branches, then applies them in a worksheet and simulator exercise.
Key takeaways
- ARM licenses processor and ISA intellectual property rather than manufacturing every chip; vendors including NXP and Texas Instruments use the shared core and distinguish products through peripherals.
- Thumb-2 combines 16-bit and 32-bit instructions to balance compact firmware size with access to broader registers and larger immediates.
- ARM's unified memory model lets the same load and store instructions access SRAM and memory-mapped peripherals, but software must know each vendor's address map.
- A 32-bit address space addresses 4 GiB of byte-addressed memory, while an individual microcontroller may implement only a small portion of the standardized map.
- ARM load addressing modes differ in whether a base register changes and when: offset leaves it unchanged, pre-index writeback changes it before access, and post-index changes it afterward.
- MOVW followed by MOVT constructs a 32-bit constant because MOVW clears the upper half and MOVT preserves the lower half.
Chapters
- Use Piazza for questions and confirm the correct Gradescope lab section, since due dates depend on section placement.
- Homework 1 reviews the limited analog material required for the course; office hours and open lab hours are available for help.
- Keyed connectors prevent incorrect orientation, while locking connectors resist accidental disconnection.
- A lab project once caught fire after using basic unkeyed headers, illustrating why students should ask staff for suitable connectors instead of improvising.
- ARM licenses instruction-set and processor intellectual property to chipmakers such as STMicroelectronics, Infineon, NXP, and Texas Instruments.
- Chip vendors differentiate products through additions such as peripherals, including USB controllers and ADCs, while retaining a shared ARM core.
- Licensing avoids the time and risk of creating and validating a processor architecture from scratch.
- A shared ARM architecture also makes software tools and engineers familiar with the platform easier to find across companies.
- Cortex-A targets application processors such as smartphones, Cortex-R targets real-time systems with timing requirements, and Cortex-M targets microcontrollers.
- The course focuses on ARMv7-M and the Thumb-2 instruction set.
- An ISA specifies the contract between software and hardware, including instructions, data types, addressing, storage, and control flow.
- Cortex-M models implement different feature subsets; for example, Cortex-M4F adds floating-point hardware.
- A 32-bit address space can address 4 GiB of byte-addressed memory, which helped motivate the PC industry's move from 32-bit to 64-bit architectures.
- Many microcontrollers have limited flash, so smaller 16-bit instructions reduce program size.
- Thumb-2 combines 16-bit encodings for compact common operations with 32-bit encodings for instructions needing more registers or larger immediates.
- The mixed-width design balances code density against instruction capability on constrained devices.
- From the ARM core's perspective, instructions, SRAM, and peripherals occupy one address space accessed through loads and stores.
- A peripheral register is accessed by its address, just like a memory location; the core does not use a separate instruction for each vendor's USB or GPIO hardware.
- ARM standardizes broad memory regions to support interoperability across chip vendors.
- The compiler, IDE, and programmer must account for vendor-specific peripheral addresses and functions.
- ARM defines address regions, but a chip vendor implements only the memory and peripherals present in a particular device.
- A reserved address range means the device has no implemented memory structure there, not that the space is available for another purpose.
- The lecture contrasts ARM's broad SRAM region with a particular device's much smaller implemented RAM, described as 352 KB.
- Accessing an unimplemented address has undefined results; device documentation identifies implemented regions and their addresses.
- Each ARM memory address identifies one byte, while common operations handle 8-bit, 16-bit, or 32-bit values.
- In little-endian layout, the least significant byte is stored at the lowest address; the course assumes little endian unless stated otherwise.
- The core has sixteen 32-bit registers, R0 through R15, with R13 as the stack pointer, R14 as the link register, and R15 as the program counter.
- A typical memory layout places code in flash, the heap growing upward, and the stack growing downward; some systems copy code from flash to SRAM during boot.
- An instruction encoding assigns bit fields to the operation, destination register, and operands; a MOV immediate is one example.
- Thumb-2 instructions may be 16 or 32 bits, and encoding patterns let the core identify instruction length from the fetched bits.
- Two 16-bit instructions can occupy the same 32-bit region of code memory, while a 32-bit instruction uses both halves.
- The program counter advances as instructions are fetched and executed, so instruction width affects the address progression.
- ARM provides multiple encodings for operations such as ADD and MOV to trade instruction size against operand range.
- A 16-bit encoding can be preferable when its register and immediate fields fit, because it uses less program space.
- Operations involving a register outside a compact encoding's range, such as a high register, may require a 32-bit form.
- A larger immediate such as 416 cannot fit an 8-bit immediate field and requires a wider encoding with the immediate distributed across fields.
- Many ARM arithmetic and logic instructions have an S form that updates condition flags in the program status register.
- The flags include negative, zero, carry, and overflow state, which conditional branches can later test.
- Carry-aware addition supports multiword arithmetic, such as combining two 32-bit operations to process a 64-bit value.
- Not every operation should overwrite flags: preserving prior condition state can matter when a later branch depends on it.
- Bitwise OR can set selected GPIO or LED bits without changing the other bits in a shared port register.
- Bit-clear operations selectively clear bits, such as the lowest four bits, while preserving the remaining value.
- MOVW places a 16-bit immediate in the low half of a register and clears the upper half; MOVT writes the high half while preserving the low half.
- To construct a full 32-bit constant, use MOVW before MOVT, because MOVW clears the upper half.
- Loads transfer data from an address in memory into a core register, while stores transfer register data to memory.
- ARM provides byte, halfword, and word operations for 8-bit, 16-bit, and 32-bit values.
- A signed load can extend a narrow value to 32 bits by filling the upper bits with the sign bit; stores simply write bits and do not apply a data type.
- Memory contains bit patterns, so software must track whether a value represents a signed number, unsigned number, or another type.
- A basic load uses the address held in a base register, while offset addressing adds an offset for the memory access without changing that base register.
- Pre-indexing with writeback, shown with an exclamation mark, updates the base register before the memory access.
- Post-indexing accesses memory using the original base address, then updates the base for a subsequent operation.
- These modes support common patterns such as iterating through arrays and accessing regularly spaced peripheral registers.
- ARM branch forms include direct branches, branches that update the link register, and branches using a register-held target.
- Conditional branches such as branch-if-greater test condition flags in the program status register.
- Compare and test instructions update flags without requiring a destination register.
- The S suffix on arithmetic instructions provides another way to set flags for later control flow.
- Students work together on a non-quiz worksheet to apply the ARM instruction concepts covered in lecture.
- The instructor allows answers in decimal, making the exercise focus on instruction behavior rather than one number format.
- The worksheet occupies the interval before the worked simulator example, with students given time to reason through the problems.
- The online simulator demonstrates ARMv7 instructions, with the caveat that its encoding details differ slightly from the course's ARMv7-M target.
- A MOV loads decimal 152, or hexadecimal 0x98, into R0; stepping also shows the program counter advancing.
- The exercise inspects registers and memory while demonstrating stores that use pre-index and post-index updates.
- A post-index increment of two changes the base register after the memory operation, illustrating how successive stores move through addresses.
Transcript excerpt
0:00 can begin. So, let's see. So, announcements, class websites, um yeah, Piazza is the best place to ask questions of course, Gradescope. So, make sure you're all on Gradescope and specifically in the correct lab section. I know some people move. Some people move outside of whatever Wolverine access. Uh talk with James about that. Um but make sure you're in the correct lab section. Your due dates are based on that. And then uh we have no Canvas because Canvas is lame. Uh homework homework one was assigned last night. Um the first bit of it is a bunch of analog review. That is intended to be all the analog you actually have to understand in this course. There's almost nothing to calculate. There's a little bit of like how do you buy a or how would you calculate a
0:46 resistor? We give you a tutorial. So, if you finished that homework assignment you feel comfortable with analog, you're great. That's that's most of the rest of the class. Maybe a few other examples. If you're having trouble with that, come to office hours. Uh my office hours we'll have uh cuz we have a holiday on Monday. I'll have extra office hours. Do I have it on here? Yeah. Uh Tuesday at 11:00 if you want, but you can also go to open lab hours. They can answer those same questions there. Um yeah. And then you still guys still have lab this week and pre-labs are normally due before the lab, but this week labs will be due pre-labs will be due in lab. Are there any logistics questions before we get started? Somebody's got a question. Can't be that clear.
1:36 No questions. All right. Um going to get started. I often want to talk about I give a like a component of
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Interactive Sensing and Computing Lab.