Presentation is loading. Please wait.

Presentation is loading. Please wait.

The ARM Programmer’s Model

Similar presentations


Presentation on theme: "The ARM Programmer’s Model"— Presentation transcript:

1 The ARM Programmer’s Model
Jacob Huerta, Ryan Crell, and Veronica Hohe 1/30/2015

2 Outline ARM Registers Von Neumann Cycle Sequence CPSR Memory
Standard ARM vs. Thumb ARM Instructions ARM Instructions Supervisor Mode/Kernel Mode Exceptions 1/30/2015

3 ARM Registers 1/30/2015

4 ARM Registers Instruction set = operations to change system state
State = data items in processor’s visible registers/systems memory Multiple invisible registers in a processor 1/30/2015

5 ARM Registers User-level programming
15 general purpose registers PC CPSR System-level programming/exceptions Remaining registers 1/30/2015

6 Von Neumann Cycle Sequence
1/30/2015

7 Von Neumann Cycle Sequence
1/30/2015

8 CPSR 1/30/2015

9 ARM CPSR Control Bits Protected from user-level programs Mode T IF
Control the processor mode Bits 0-4 (must be a valid mode) T Control the instruction set State bit IF Enables control interrupt Bit 6 is FIQ disable and Bit 7 is IRQ disable 1/30/2015

10 ARM CPSR Flag Bits Condition Code Flags NZCV N (“Negative flag”)
0/1 = value is positive/negative Z (“Zero flag”) 0/1 = result is non-zero/zero C (“Carry flag”) 0/1 = “extends” for shift/”borrows” for subtraction V (“Overflow flag”) 0/1 = no overflow/overflow caused by last arithmetic operation 1/30/2015

11 ARM CPSR Unused Bits Unused bits Reserved
State preserved when changing the flag or control bits Should not be altered by programs Should not rely on them when checking the PSR status Might read as 1’s or 0’s in future processors 1/30/2015

12 ARM Memory Organization
1/30/2015

13 ARM Memory Organization
View memory as linear array of bytes numbered from 0 to 232-1 Store data items in Byte (8 bits) Half-word (16 bits) Word (32 bits) Align words on 4 bytes Organize in little-endian style 1/30/2015

14 ARM Instructions 1/30/2015

15 ARM vs. THUMB Instructions
32-bit instruction set 3-data address instructions 16 general purpose registers 16-bit instruction set 2-data address instructions 8 general purpose registers “Less regular” instructions Higher code density High performance 1/30/2015

16 ARM vs. THUMB Instructions
Not a “complete” architecture Supports ARM architecture The T bit in CPSR toggles the interpretation 1/30/2015

17 ARM vs. THUMB Instructions
1/30/2015

18 ARM Instructions Load-store architecture
Processes only values stored in registers and instructions Performs operations on these values Stores results in register Affects memory using only load and store instructions Inability to perform memory-to-memory operations Instructions Data processing: between registers (add, sub, etc.) Data transfer: between registers and memory (load, store) Control flow: execution of instructions (branches, link, supervisor calls) 1/30/2015

19 Supervisor Mode/Kernel Mode
1/30/2015

20 Supervisor Mode/Kernel Mode
User with supervisor privileges can use system calls to affect Kernel code Device drivers Privileged code User program with IO access permissions Unprivileged code User programs 1/30/2015

21 Exceptions 1/30/2015

22 Exceptions Normal execution is paused to handle events like
Systems calls Interrupts generated by external sources Undefined instructions Traps 1/30/2015

23 Exception Handling Save current state is
Copy PC into register rl4_exc Copy CPSR into register SPSR_exc Register r13_exc = pointer to memory stack to store user registers Set processor operating mode to exception mode 1/30/2015

24 Exception Handling Set PC to value between 0x00 and 0x1C depending on exception type Restore user registers from memory stack Restore (adjusted) PC and CPSR 1/30/2015

25 Input/Output (I/O) System
1/30/2015

26 Input/Output (I/O) System
I/O peripheral Device mapped to memory Device registers treated as memory locations by system Given interrupt support (make interrupt requests) Normal interrupt (IRQ) = most requests Fast interrupt (FIQ) = time-sensitive/critical requests Direct Memory Access (DMA) External to ARM processor Handles high-bandwidth I/O traffic 1/30/2015

27 References (2001). “The Thumb Instruction Set.” Web January 28, 2015. (2014). “About processor exceptions.” ARM. Web. (2014). “Exception handling process.” ARM. Web. (2014). “Load/store architecture.” Wikipedia. Web. August 4, (2014). “Protection ring.” Wikipedia. Web. December 30, (2014). “Reserved bits.” ARM. Web. August 4, (2014). “Trap (computing).” Wikipedia. Web. April 30, Furber, S. (2000). ARM system-on-chip architecture. Harlow, England: Addison-Wesley. (2014). Gibson, J. (2011). ARM assembly language: An Introduction (2nd ed.). Lexington, KY: The Author. 1/30/2015

28 Questions? 1/30/2015


Download ppt "The ARM Programmer’s Model"

Similar presentations


Ads by Google