Immediate data Immediate operands : ADD r3, r3, #1 valid ADD r3, #1,#2 invalid ADD #3, r1,r2 invalid ADD r3, r2, #&FF ( to represent hexadecimal immediate.

Slides:



Advertisements
Similar presentations
Slides created by: Professor Ian G. Harris Efficient C Code  Your C program is not exactly what is executed  Machine code is specific to each ucontroller.
Advertisements

ARM versions ARM architecture has been extended over several versions.
Embedded Systems Programming
Overheads for Computers as Components 2nd ed.
Embedded Systems Architecture
© 2000 Morgan Kaufman Overheads for Computers as Components ARM instruction set zARM versions. zARM assembly language. zARM programming model. zARM memory.
1 ECE 5465 Advanced Microcomputers Group 11: Brian Knight Benjamin Moore Alex Williams.
Embedded System Design Center ARM7TDMI Microprocessor Data Processing Instructions Sai Kumar Devulapalli.
COMP3221 lec10-logical-II&mul.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 10: C/Assembler Logical and Shift – II & Multiplication.
COMP3221 lec9-logical-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 9: C/Assembler Logical and Shift - I
ARM Microprocessor “MIPS for the Masses”.
Binary Logic (review) Basic logical operators: (Chapter 7 expanded)
Computer Organization & Assembly Language
Thumb Data Processing Instructions and Breakpoint Instructions 02/18/2015 Mingliang Ge Yi (Leo) Wu Xinuo (Johnny) Zhao.
COMP3221 lec08-arith.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 8: C/Assembler Data Processing
Embedded Systems Programming ARM assembler. Creating a binary from assembler source arm=linux-as Assembler Test1.S arm-linux-ld Linker Arm-boot.o Executable.
ARM Instructions I Prof. Taeweon Suh Computer Science Education Korea University.
Topic 8: Data Transfer Instructions CSE 30: Computer Organization and Systems Programming Winter 2010 Prof. Ryan Kastner Dept. of Computer Science and.
Assembly Programming on the TI-89 Created By: Adrian Anderson Trevor Swanson.
Lecture 4. ARM Instructions Prof. Taeweon Suh Computer Science & Engineering Korea University COMP427 Embedded Systems.
BITWISE OPERATIONS – Microprocessor Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Topic 7: Control Flow Instructions CSE 30: Computer Organization and Systems Programming Winter 2011 Prof. Ryan Kastner Dept. of Computer Science and Engineering.
1 Chapter 4 ARM Assembly Language Smruti Ranjan Sarangi Computer Organisation and Architecture PowerPoint Slides PROPRIETARY MATERIAL. © 2014 The McGraw-Hill.
Lecture 2: Advanced Instructions, Control, and Branching EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer.
Unit-2 Instruction Sets, CPUs
Lecture 4: Load/Store Architectures CS 2011 Fall 2014, Dr. Rozier.
What is a program? A sequence of steps
Arithmetic and Logic Chapter 5
COMP3221: Microprocessors and Embedded Systems--Lecture 10 1 COMP3221: Microprocessors and Embedded Systems Lecture 10: Shift and Bit-set Instructions.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Microprocessor & Assembly Language
Instruction Set Architectures Early trend was to add more and more instructions to new CPUs to do elaborate operations –VAX architecture had an instruction.
ARM Shifts, Multiplies & Divide??. MVN Pseudo Instructions Pseudo Intruction: Supported by assembler, not be hardware.
Binary Logic (review) Basic logical operators:(Chapter 7 expanded) NOT AND – outputs 1 only if both inputs are 1 OR – outputs 1 if at lest one input is.
ARM Instruction Set Computer Organization and Assembly Languages Yung-Yu Chuang with slides by Peng-Sheng Chen.
Smruti Ranjan Sarangi, IIT Delhi Chapter 4 ARM Assembly Language
Chapter 15: Higher Level Constructs
Assembly Language Programming of 8085
COMPUTER ARCHITECTURE & OPERATIONS I
Introduction to the ARM Instruction Set
ARM Registers Register – internal CPU hardware device that stores binary data; can be accessed much more rapidly than a location in RAM ARM has.
Assembly Language Assembly Language
ECE 3430 – Intro to Microcomputer Systems
Processor Instructions set. Learning Objectives
March 2006 Saeid Nooshabadi
Number Systems.
Arithmetic and Logic Chapter 5
68000 Arithmetic Instructions
The 8051 Assembly Language Arithmetic & Logic Instructions
Computer Architecture & Operations I
Topic 6: Bitwise Instructions
Logical Operations In some applications it is necessary to manipulate other sizes of data, or perhaps only individual bits. There are instructions that.
Multiplication by small constants (pp. 139 – 140)
ECEG-3202 Computer Architecture and Organization
Shift & Rotate Instructions)
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ECEG-3202 Computer Architecture and Organization
Arithmetic and Logic Chapter 5
Table 3‑1: Unsigned Data Range Summary in ARM
The ARM Instruction Set
Computer Organization and Assembly Languages Yung-Yu Chuang 2008/11/17
Branching instructions
ARM Introduction.
Overheads for Computers as Components 2nd ed.
The Processor.
Computer Architecture
CS501 Advanced Computer Architecture
Introduction to the ARM Instruction Set. Data Processing Instructions Move Instructions Syntax: { }{S} Rd, N.
Bit Manipulations CS212.
Arithmetic and Logic Chapter 3
Presentation transcript:

Immediate data Immediate operands : ADD r3, r3, #1 valid ADD r3, #1,#2 invalid ADD #3, r1,r2 invalid ADD r3, r2, #&FF ( to represent hexadecimal immediate , use &) Ox1234 uses 16 bits For binary number: suffix the number with 0b For octal number: suffix the number with 0 For hexadecimal numbers: suffix the number with 0x, 0X or &

Barrel Shifter Barrel Shifter is a functional unit which can be used in a number of different circumstances. It provides five types of shifts and rotates which can be applied to Operand2.

Barrel Shifter ASL: Arithmetic Shift left, this is synonym for LSL

Barrel Shifter

Examples of Barrel Shifter MOV r0, r0, LSL #1 ; r0 = r0 * 21 MOV r1, r1, LSR #2 ; r1 = divide r1 by 4 (unsigned) MOV r2, r2, ASR #2 ; r2 = divide r2 by 4 (signed) MOV r3, r3, ROR#16 ; swap the top and bottom halves of r3 ADD r5, r5, r3, LSL #4 ; 4-address instruction ;r5 = r5+ r3 * 24

Operand 2

I bit in the instruction

If I bit is 0, operand 2 is Register Registers shifted by values: MOV r2, r2, LSR #1 ;shift r2 right by one bit RSB r10 r5, r11, ASR #14 ;shift r11 right by14 bits while sign extending, then subtract r5 from that. Put the result in r10. Registers shifted by registers: BIC r11, r11, r1, LSL r0 ;take r1 and shift it left by r0, then use that as a mask to clear bits in r11. Put the result in r11 CMP r9, r8, ROR r0 ;take r8 and rotate it right by r0, then compare that with r9. the result is in flags

If I bit is 0, operand 2 is in register

If I bit is 1 – Immediate operand

Instruction format

What is the maximum value that can be represented by immediate operands? 12 bits -----> 2^12 -- 0 to 4095 (in other processors 16 bits for immediate operands, so 2^16) But using 8 bits and shift operations(4 bits) can represent a 32 bit data

What are the different ways to represent operands ? In Register, Immediate , barrel shifter …

Condition code

Eg - to set condition bits Setting condition bits § Simply add an ‘S’ following the arithmetic/ logic instruction § Example: ADDS r0,r1,r2 (in ARM) This is equivalent to r0=r1+r2 and set the condition bits for this operation

Data Processing Instructions (3) Conditional codes + Data processing instructions Barrel shifter = Powerful tools for efficient coded programs

Data Processing Instructions (4) e.g.: if (z==1) R1=R2+(R3*4) compiles to CMP ADDEQS R1,R2,R3, LSL #2 ( SINGLE INSTRUCTION ! )

C

Instruction format