Clock / Speed:
Ready Cycles: 0 Core: ARMv7-M
main.s Ln 1, Col 1
ARM CORTEX-M3 CORE (ARMv7-M) Instruction Fetch (IF) 3-Stage Harvard Pipeline Prefetch: 32-bit Thumb-2 Decoder 16-bit & 32-bit Instructions Active: IDLE Program Counter (PC / R15) Thumb State (Bit 0 = 1) 0x00000000 32-Bit Register Bank R0: 00000000 R1: 00000000 R2: 00000000 R3: 00000000 R12: 00000000 LR: FFFFFFFF SP: 20008000 MSP: 20008000 PSP: 20000000 CTL: 00 (MSP) Physical Dual Stack Architecture 32-BIT ALU Add · Sub · Logic · Shift Barrel Shifter HW Math Engine 32x32 Mult (1 Cyc) Divide (2-12 Cyc) Program Status Register (xPSR) APSR: N:0 Z:0 C:0 V:0 Q:0 IPSR: 0 (Thread Mode) · EPSR T=1 INTERNAL ADVANCED HIGH-PERFORMANCE BUS (AHB-LITE) MATRIX MEMORY & SYSTEM PERIPHERALS Flash Memory (I-Code / D-Code) Base: 0x00000000 · Vector Table Internal SRAM (System Bus) Base: 0x20000000 · Heap & Stack NVIC & Exception Unit Up to 240 IRQs · Priority Grouping Pending: None 24-Bit SysTick Timer CSR · RVR · CVR CVR: 0x000000 Memory-Mapped Peripherals GPIO: 0x40000000 · UART: 0x40001000 LEDs: 0x00
[00:00:00] EcrioniX ARM Cortex-M3 Studio initialized. Architecture: ARMv7-M Thumb-2 execution model.
[00:00:00] Reset vector loaded. Write Thumb-2 assembly or select an experiment from the left Project Explorer.
EcrioniX ARM Cortex-M3 Development Board
32-Bit Microcontroller System · Memory-Mapped GPIO · 72 MHz Clock Sim
VDD: 3.3V OK
8x Output LEDs (GPIOA Pins 0–7) 0x00
Mapped to GPIO Output Data Register (0x40000004):
PA7
PA6
PA5
PA4
PA3
PA2
PA1
PA0
8x Rocker DIP Switches (GPIOA Pins 8–15) 0x00
Mapped to GPIO Input Data Register (0x40000008):
PA15
PA14
PA13
PA12
PA11
PA10
PA9
PA8
2-Digit Seven-Segment Display 00
Mapped to 0x40000020 (Cathode/Anode Hex Output):
User Buttons & Hardware Triggers
Click to pulse hardware lines:
SysTick Heartbeat LED:
Virtual UART0 Serial Terminal (0x40001000) 115200 Baud · 8-N-1
EcrioniX Virtual UART Serial Terminal Ready. Assembly programs writing to UART_DR (0x40001000) will stream output here. Type text below to simulate incoming serial bytes (RXNE).

ARM Cortex-M3 Memory Architecture & Stack Inspector

The Cortex-M3 has a 4 GB contiguous memory space partitioned into standard architectural regions: Code (Flash), SRAM, Peripherals, and System Control Space (SCS). Below is the live memory matrix and stack inspection.

Code / Flash Space (0x00000000 – 0x1FFFFFFF)

Contains the Vector Table, Reset Handler, Thumb-2 instructions, and constant literal pools. Initial MSP value is located at 0x00000000, and Reset Vector is at 0x00000004.

SRAM Memory Space (0x20000000 – 0x3FFFFFFF)

On-chip volatile RAM. Contains static data, heap, and the execution stack. In this simulator, the default stack pointer resets to top of SRAM (0x20008000) and grows downwards toward 0x20000000.

Peripheral Space (0x40000000 – 0x5FFFFFFF)

Memory-mapped registers for I/O: GPIO Direction (0x40000000), GPIO Output ODR (0x40000004), GPIO Input IDR (0x40000008), and UART0 (0x40001000).

System Control Space (0xE0000000 – 0xFFFFFFFF)

Houses the processor core peripherals: SysTick timer (0xE000E010), NVIC registers (0xE000E100), System Control Block SCB (0xE000ED00), and MPU.

Go to Address:
Address +0+1+2+3 +4+5+6+7 +8+9+A+B +C+D+E+F ASCII

Cortex-M3 Hardware Exception Stack Frame (Auto-Stacking)

Upon taking an interrupt or exception, the hardware automatically pushes eight 32-bit registers onto the active stack in descending order:

SP + 28
xPSR
SP + 24
PC (Return)
SP + 20
LR
SP + 16
R12
SP + 12
R3
SP + 8
R2
SP + 4
R1
SP + 0
R0

Nested Vectored Interrupt Controller (NVIC) & Exception Matrix

The ARM Cortex-M3 NVIC provides low-latency, deterministic exception and interrupt handling. Below is the active Vector Table and NVIC control registers.

Exc # Vector Address Exception Name Type Priority Status Action
10x00000004ResetSystem-3 (Fixed)Active
20x00000008NMI (Non-Maskable Interrupt)System-2 (Fixed)Inactive
30x0000000CHardFaultFault-1 (Fixed)Inactive
40x00000010MemManage FaultFaultConfigurableInactive-
50x00000014BusFaultFaultConfigurableInactive-
60x00000018UsageFaultFaultConfigurableInactive-
110x0000002CSVCall (Supervisor Call)SystemConfigurableInactive
140x00000038PendSV (Pendable Service)SystemConfigurableInactive
150x0000003CSysTick (System Timer)SystemConfigurableInactive
160x00000040External IRQ0 (EXTI0 Pin PA0)External0Inactive
170x00000044External IRQ1 (UART0 RXNE)External0Inactive

24-Bit SysTick Timer Peripheral Simulator

The Cortex-M3 includes an integrated 24-bit down-counter (SysTick) designed to generate periodic interrupts for real-time operating systems (RTOS tick) and software delay routines.

SysTick Control & Registers

SYST_CSR (0xE000E010): 0x00000007
ENABLE: 1 TICKINT: 1 CLKSOURCE: 1 (CPU) COUNTFLAG: 0
SYST_RVR (Reload): 0x0000270F (9999)
SYST_CVR (Current): 0x00001388 (5000)
Current Counter Progress (24-bit Countdown):

Interactive SysTick Controller

Configure the timer reload value and test periodic interrupt firing:

Reload Value:

24 Practical ARM Cortex-M3 Assembly Laboratory Experiments

Every experiment comes pre-loaded with verified Thumb-2 assembly source code, objective, step-by-step execution path, and virtual hardware peripheral mapping. Click any card to load the code directly into the IDE.

ARM Cortex-M3 Engineering Curriculum · 20 Core Modules

Systematic, university-level technical guides covering processor microarchitecture, bus systems, interrupt controllers, and assembly optimization.

Cortex-M3 Instruction Set Reference & Technical FAQs

Comprehensive reference guide to ARMv7-M Thumb and Thumb-2 instructions supported by the EcrioniX Studio execution engine.

Data Processing & Arithmetic

32-bit ALU operations updating or preserving APSR condition flags:

  • MOV / MOVS Rd, #imm | Rm – Move 32-bit value (MOVS updates N, Z flags)
  • ADD / ADDS Rd, Rn, #imm | Rm – Add with optional APSR flag update
  • SUB / SUBS Rd, Rn, #imm | Rm – Subtract with borrow generation
  • ADC / SBC Rd, Rn, Rm – Add / Subtract with Carry flag
  • MUL / MULS Rd, Rn, Rm – 32-bit hardware multiplication
  • AND, ORR, EOR, BIC – Bitwise logical AND, OR, XOR, Bit Clear
  • MVN Rd, Rm – Move Bitwise NOT (one's complement)
  • CMP / CMN Rn, #imm | Rm – Compare / Compare Negative
  • TST Rn, Rm – Test bits (AND without storing result)

Shifts, Memory & Branching

Barrel shifter, Little-Endian memory access, and control flow:

  • LSL / LSR / ASR / ROR – Logical/Arithmetic Shift & Rotate
  • LDR / STR Rd, [Rn, #offset] – Load / Store 32-bit word
  • LDRB / STRB Rd, [Rn, #offset] – Load / Store 8-bit unsigned byte
  • LDRH / STRH Rd, [Rn, #offset] – Load / Store 16-bit unsigned halfword
  • PUSH / POP {reglist} – Hardware stack push/pop via active SP
  • B / BEQ / BNE / BGT / BLT – Unconditional & conditional branch
  • BL label – Branch with Link (stores return in LR)
  • BX Rm – Branch and Exchange (BX LR returns from subroutine)
  • CBZ / CBNZ Rn, label – Compare and Branch on Zero / Non-Zero

Frequently Asked Questions (FAQs)

What is the ARM Cortex-M3 processor architecture? ▼

The ARM Cortex-M3 is a high-performance, low-cost 32-bit RISC microprocessor based on the ARMv7-M architecture. It features a 3-stage Harvard pipeline, unified memory architecture, integrated Nested Vectored Interrupt Controller (NVIC), hardware single-cycle multiply, hardware divide, and a 24-bit SysTick timer.

Does Cortex-M3 support both ARM and Thumb instruction sets? ▼

No. Unlike classic ARM cores (such as ARM7TDMI or ARM9), the Cortex-M3 core executes exclusively in Thumb state. It utilizes Thumb-2 technology, allowing high-density 16-bit instructions and high-throughput 32-bit instructions to intermix freely without mode-switching overhead.

What are the differences between MSP and PSP? ▼

Cortex-M3 provides two physical stack pointers banked under R13: the Main Stack Pointer (MSP) and the Process Stack Pointer (PSP). MSP is the default stack used on boot, during all exception and interrupt handlers, and by the OS kernel. PSP is used by application user threads in Thread mode to isolate user task stack faults from kernel space.

How does hardware exception stacking work in Cortex-M3? ▼

Upon taking an interrupt, Cortex-M3 automatically pushes eight 32-bit registers to the current stack: R0, R1, R2, R3, R12, LR, PC, and xPSR. The Link Register is loaded with a special EXC_RETURN code (e.g., 0xFFFFFFF9). On executing BX LR, the core detects this code and un-stacks all eight registers in hardware without software assembly intervention.

What are APSR, IPSR, and EPSR registers? ▼

These are three views of the 32-bit Program Status Register (xPSR). APSR (Application PSR) holds ALU condition flags: N (Negative), Z (Zero), C (Carry), V (Overflow), and Q (Saturation). IPSR (Interrupt PSR) holds the currently active exception number (0 = Thread mode). EPSR (Execution PSR) holds the Thumb state bit (T=1) and If-Then (IT) execution state bits.

What is the function of the SysTick timer in Cortex-M3? ▼

SysTick is a 24-bit down-counting system timer built directly into the processor core (0xE000E010). Because it is part of the standard ARMv7-M architecture rather than an external vendor peripheral, operating systems (like FreeRTOS or Zephyr) can provide portable task preemption ticks across all Cortex-M microcontrollers.

What is NVIC and how does interrupt tail-chaining work? ▼

The Nested Vectored Interrupt Controller (NVIC) is tightly coupled with the Cortex-M3 core, supporting up to 240 external interrupts with configurable priorities. Tail-chaining is an optimization where, upon exiting an ISR when another interrupt is pending, the processor skips pop/push operations and switches directly to the next ISR in as few as 6 clock cycles.

How does little-endian byte ordering work in Cortex-M3? ▼

Cortex-M3 defaults to little-endian byte ordering: the least significant byte (LSB) of a multi-byte word is stored at the lowest memory address. For example, 32-bit word 0x12345678 at address 0x20000000 places 0x78 at byte 0, 0x56 at byte 1, 0x34 at byte 2, and 0x12 at byte 3.

What is an IT (If-Then) block in Thumb-2? ▼

The IT instruction enables up to four consecutive instructions to execute conditionally based on APSR flags without branching. For example, 'ITE EQ' makes the first instruction execute if Z==1 (Then), and the second execute if Z==0 (Else), reducing branch misprediction penalties.

What triggers a HardFault exception in Cortex-M3? ▼

A HardFault (Vector 3) occurs when an unrecoverable error happens, such as executing an undefined instruction, branching to an address with bit 0 cleared (attempting ARM state), an unaligned load/store when alignment checking is enabled, accessing an unmapped memory bus address, or fault escalation when another fault handler fails.

How do memory-mapped peripherals work in this simulator?

Peripherals are mapped into standard 32-bit address space: GPIOA Direction register is at 0x40000000, Output Data (ODR) is at 0x40000004 (controlling virtual LEDs and 7-segment display), Input Data (IDR) is at 0x40000008 (reading DIP switches), and UART0 is at 0x40001000.

Can I use this simulator for university embedded systems lab coursework? ▼

Yes. The simulator implements genuine ARMv7-M execution semantics and is specifically structured around university embedded systems curricula (e.g. Yiu, Valvano, Mazidi) covering Thumb-2 assembly, ALU operations, stack frames, SysTick delays, and NVIC interrupts.

How are 32-bit immediate constants loaded in Thumb-2? ▼

In Thumb-2, 32-bit constants can be loaded using MOVW (load 16 bits into lower half) followed by MOVT (load 16 bits into upper half), or via the pseudo-instruction 'LDR Rd, =const' which loads the value from a PC-relative literal pool in Flash.

What is the difference between MOVS and MOV? ▼

The 'S' suffix instructs the processor to update the APSR condition flags (N and Z based on the result, and C on shifts). 'MOV' performs the register transfer without altering any flags. In 16-bit Thumb, low-register moves (R0-R7) generally imply flag updates (MOVS).

Does this emulator run 100% locally in my browser? ▼

Yes. The two-pass assembler, cycle execution engine, virtual hardware board, and memory subsystems are implemented in client-side JavaScript. No data is sent to external servers, and full functionality is preserved offline.