Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  herhaling ARM assembler instructies  geindexeerde.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Advanced Piloting Cruise Plot.
Chapter 16 Pointers and Arrays. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Pointers and Arrays.
Chapter 1 The Study of Body Function Image PowerPoint
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Genes and Evolution Comparative Genome Structure and Evolution Synteny- comparison of chromosome order in related species.
Chapter 4 Addressing modes CEG2400 Microcomputer Systems CEG2400 ch4 addressing modes v3a 1.
Required:PM: Ch 8.1-3, pgs Recommended:Wiki: Microarchitecture Wiki: Addressing_mode Wiki: Three-state logicWiki: Microarchitecture Wiki: Addressing_mode.
Computer Science Education
SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
Embedded Software 1. General 8051 features (excluding I/O) CPU 8 bit microcontroller The basic registers include (more discussed later) The 8-bit A (accumulator)
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
ABC Technology Project
1 B. Bruidegom Computer Architecture Top down approach B. Bruidegom AMSTEL-instituut.
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  LCD aansturen  een scrollende text laten zien.
Vervolg C Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1 Onderwerpen voor vandaag Dallas one-wire interface Opgave:
VOORBLAD.
Progam.-(6)* Write a program to Display series of Leaner, Even and odd using by LOOP command and Direct Offset address. Design by : sir Masood.
Based on Mike Feeley’s original slides; Modified by George Tsiknis Unit 11 Local Variables, Parameters and the Stack Relevant Information CPSC 213 Companion.
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Chapter 5 Test Review Sections 5-1 through 5-4.
SE-292 High Performance Computing
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Week 1.
Vervolg C Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1 Onderwerpen voor vandaag functie definitions;.h files;
1 Patt and Patel Ch. 7 LC-3 Assembly Language. 2 LC-3 is a load/store RISC architecture Has 8 general registersHas 8 general registers Has a flat 16-bit.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
1 Challenge the future Load Flow Problem Parallel Programming on the GPU with MATLAB Erik Berkhof.
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  herhaling: geindexeerd, CMP, stack  operand2.
Onderwerpen voor vandaag
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.
Compiler Construction Sohail Aslam Lecture Code Generation  The code generation problem is the task of mapping intermediate code to machine code.
ARM versions ARM architecture has been extended over several versions.
Embedded Systems Programming
Tutorial Essentially all the Blackfin instruction you need for all of ENCM511. The instructions are easy. Its knowing when to use them that is the difficult.
Appendix D The ARM Processor
RAT R1 R2 R3 R4 R5 R6 R7 Fetch Q RS MOB ROB Execute Retire.
Cosc 2150: Computer Organization
Overheads for Computers as Components 2nd ed.
The University of Adelaide, School of Computer Science
Suranaree University Of Technology มทส  2002 Anant Oonsivilai 2002/2/27 Microcomputers and Microprocessors Chapter Assembly Language Programming.
Chapter 3 โพรเซสเซอร์และการทำงาน The Processing Unit
CPSC 330 Fall 1999 HW #1 Assigned September 1, 1999 Due September 8, 1999 Submit in class Use a word processor (although you may hand-draw answers to Problems.
The NS7520.
Wat gaan we doen? harhaling data types
Embedded Systems Architecture
Passing by-value vs. by-reference in ARM by value C code equivalent assembly code int a;.section since a is not assigned an a:.skip initial.
THUMB Instructions: Branching and Data Processing
Multiplication – Microprocessor
Machine Language and Assembly Language
Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2.
VPEMSY1, D3ECPT2 : ARM Assembler Hogeschool Utrecht / Electrical Engineering & Design 1  Herhaling B/BL, conditions,
Computertechniek 2 – ARM assembler Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  Herhaling ARM assembler instructies.
Chapter 4 Addressing modes
Presentation transcript:

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  herhaling ARM assembler instructies  geindexeerde adressering  conditionele instructies en de flags  subroutines, gebruik van de stack  gebruik van het bordje: LEDs en LCD  oefening

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 2 LDR R0, =value MOV R0, R1 LDR R0, [ R1 ] STR R0, [ R1 ] ADD R0, R1, R2 ADD R0, R1, #15 B label BL label

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 3 LDR R0, =value R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 4 MOV R0, R1 R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 5 LDR R0, [ R1 ] R0 R R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 6 STR R0, [ R1 ] R0 R1FFFF FFFB R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 7 ADD R3, R1, R2 R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen +

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 8 B = branch R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 9 BL = branch and link R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R15 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 10 Variaties op LDR R0, [R1]: LDR R0, [ R1 ], #12 LDR R0, [ R1, #12 ] LDR R0, [ R1, #12 ] !

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 11 LDR R0, [ R1 ] R0 R R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R14 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 12 Addressing mode: Post-indexed Example: STR r0, [r1], #12 To auto-’increment’ the base register to location 0x1f4 instead use: – STR r0, [r1], #-12 r1 0x200 Original Base Register Memory 0x5 0x200 r0 0x5 Source Register for STR Offset 12 0x20c r1 0x20c Updated Base Register

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 13 LDR R0, [ R1 ], #4 R0 R R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R14 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 14 Addressing mode: Pre-indexed Example: STR r0, [r1,#12] To store to location 0x1f4 instead use: STR r0, [r1,#-12] To auto-increment base pointer to 0x20c use: STR r0, [r1, #12]! If r2 contains 3, access 0x20c by multiplying this by 4: –STR r0, [r1, r2, LSL #2] r1 0x200 Base Register Memory 0x5 0x200 r0 0x5 Source Register for STR Offset 12 0x20c

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 15 LDR R0, [ R1, #4 ] R0 R R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R14 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 16 LDR R0, [ R1, #4 ] ! R0 R R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 = SP R14 = LR R14 = PC registers ……. FFFF FFFB FFFF FFFC FFFF FFFD FFFF FFFE FFFF geheugen

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 17  Alle instructies kunnen conditioneel zijn  Load en store kunnen ook per half-word of byte  Bij add / sub kan opt

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 18  LCD aansturen  een scrollende text laten zien

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 19 LCD file hello.zip uitpakken naar lege directory (geen spaties in de pathname…) run ‘as is’ geeft “Hello world” op het display

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 20 main LCD library delay library Chip startup code

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 21 LCD Library Subroutines: LCD_INIT eenmalig aanroepen LCD_CLEAR maakt het display leeg, cursor naar eerste positie LCD_PUTCHAR print het char in R0, schuift nar volgende positie

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 22 Text vastleggen hello:.asciz “Hello!”.align ldr r1, =hello

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 23.global main tekst:.asciz "Hello world!".align save registers stmfdsp!, { lr gebruik de LCD blLCD_INIT blLCD_CLEAR ldrr1, =tekst loop: ldrbr0,[ r1 ] addr1, r1, #1 cmpr0, #0 beqklaar blLCD_PUTCHAR bloop return ldmfdsp!, { pc }

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 24 blLCD_INIT blLCD_CLEAR ldrr1, =tekst loop: ldrbr0,[ r1 ] addr1, r1, #1 cmpr0, #0 beqklaar blLCD_PUTCHAR bloop klaar:

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 25 Doen Test “Hello world” Laat een andere text zien Maak een subroutine die een asciz string (R0 = pointer) laat zien op het LCD display (test deze subroutine) Laat een scrollende text zien op het LCD display

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 26 Scroll een text ‘over’ het display, bv: Hello brave new ello brave new w llo brave new wo lo brave new wor o brave new worl brave new world brave new world. En dan weer overnieuw.

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 27 Opdrachten: 1. Maak zelf het ‘loop’ optel programma af en test het op het bordje. 2. maak een programma dat 2 getallen vermenigvuldigt (door herhaald optellen). Het is wellicht handig eerst in C te schrijven hoe je dit zou doen.