Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  herhaling: geindexeerd, CMP, stack  operand2.

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 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.
Addition Facts
Chapter 4 Addressing modes CEG2400 Microcomputer Systems CEG2400 ch4 addressing modes v3a 1.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 9:
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.
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  herhaling ARM assembler instructies  geindexeerde.
VOORBLAD.
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
Welcome To The Four Umpire System. © 2007 Softball Canada All Rights Reserved Softball Canada Four Umpire System FP & SP 2 Tips for the Four Umpire System.
Welcome To The Three Umpire System. © 2007 Softball Canada All Rights Reserved Softball Canada Three Umpire System FP 2 Tips for the Three Umpire System.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
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.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
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.
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
Class Addressing modes
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
ITEC 352 Lecture 13 ISA(4).
Machine Language and Assembly Language
Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2.
Code Generation.
Based on Mike Feeley’s and Tamara Munzner’s original slides; Modified by George Tsiknis Parameters and Local Variables Relevant Information CPSC 213 Companion.
1 ARM Movement Instructions u MOV Rd, ; updates N, Z, C Rd = u MVN Rd, ; Rd = 0xF..F EOR.
Run-time Environment for a Program different logical parts of a program during execution stack – automatically allocated variables (local variables, subdivided.
Embedded System Design Center Sai Kumar Devulapalli ARM7TDMI Microprocessor Load and store instruction.
VPEMSY1, D3ECPT2 : ARM Assembler Hogeschool Utrecht / Electrical Engineering & Design 1  Herhaling B/BL, conditions,
Multiple data transfer instructions ARM also supports multiple loads and stores: ldm/ldmia/ldmfd: load multiple registers starting from [base register],
Computertechniek 2 – ARM assembler Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  Herhaling ARM assembler instructies.
Computer Architecture Lecture 13 – part 1 by Engineer A. Lecturer Aymen Hasan AlAwady 31/3/2014 University of Kufa - Information Technology Research and.
More on Assembly 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
More on Assembly 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
Lecture 8: Loading and Storing to Memory CS 2011 Fall 2014, Dr. Rozier.
Multiple data transfer instructions ARM also supports multiple loads and stores: When the data to be copied to the stack is known to be a multiple of 4.
The Stack.
ARM Load/Store Instructions
Presentation transcript:

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  herhaling: geindexeerd, CMP, stack  operand2  geheugen indeling, pseudo-operaties  oefeningen: LCD, hoofdletters

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 2 LDR R0, [ R1 ]: LDR R0, [ R1 ], #4 LDR R0, [ R1, #4 ] LDR R0, [ R1, #4 ] !

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 3 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 4 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 5 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 6 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 7 CMP R1, R2 CMP R1, #15 CMN R1, R2 CMN R1, #10

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 8 CMP 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 - flags

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 9 CMN R1, #15 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 + flags

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 10 STMFD SP!, { R1-R9, R12 } LDMFD SP!, { R1-R9, R12 }

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 11 Stack A stack is an area of memory which grows as new data is “pushed” onto the “top” of it, and shrinks as data is “popped” off the top. stack pointer used to point the current “top” of the stack. empty ascending / empty decending / full ascending / full decenuing SP PUSH {1,2,3} POP 1 2 Result of pop = 3 SP

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 12 Stack Operation Traditionally, a stack grows down in memory, with the last “pushed” value at the lowest address. The ARM also supports ascending stacks, where the stack structure grows up through memory. The value of the stack pointer can either: –Point to the last occupied address (Full stack) and so needs pre-decrementing (ie before the push) –Point to the next occupied address (Empty stack) and so needs post-decrementing (ie after the push) The stack type to be used is given by the postfix to the instruction: –STMFD / LDMFD : Full Descending stack –STMFA / LDMFA : Full Ascending stack. –STMED / LDMED : Empty Descending stack –STMEA / LDMEA : Empty Ascending stack Note: ARM Compiler will always use a Full descending stack.

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 13 Block Data Transfer instructie code The Load and Store Multiple instructions (LDM / STM) allow betweeen 1 and 16 registers to be transferred to or from memory. The transferred registers can be either: –Any subset of the current bank of registers (default). ^ –Any subset of the user mode bank of registers when in a priviledged mode (postfix instruction with a ‘^’). Cond P U S W L Rn Register list Condition field Base register Load/Store bit 0 = Store to memory 1 = Load from memory Write- back bit 0 = no write-back 1 = write address into base PSR and force user bit 0 = don’t load PSR or force user mode 1 = load PSR or force user mode Up/Down bit 0 = Down; subtract offset from base 1 = Up ; add offset to base Pre/Post indexing bit 0 = Post; add offset after transfer, 1 = Pre ; add offset before transfer Each bit corresponds to a particular register. For example: Bit 0 set causes r0 to be transferred. Bit 0 unset causes r0 not to be transferred. At least one register must be transferred as the list cannot be empty.

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 14 Operand2: MOV R0, R1 ADD R0, R1, #2 SUBC R0, R1, R2, LSL #5 ADDS R1, R2, R3, ASR R4

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 15

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 16 Wat zit er in het geheugen van een programma: Code (text) Globale data met initiele waarde (data) Globale data zonder initiele waarde (bss) Stack (evt lokale data) Heap

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 17

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 18 Wat zit in een “image”  Code (text)  Globale data met initiele waarde (data) Globale data zonder initiele waarde (bss) Stack Heap

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 19 Wat kan/moet in ROM (read-only)  Code (text)  Globale data met initiele waarde (data)  maar wel copieren naar RAM! Globale data zonder initiele waarde (bss) Stack Heap

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 20 Code voor een ROMmable image  C zorgt zelf wel voor de juiste verdeling  Assembler: code moet in.text geinitialiseerde schrijfbare data moet in.data ongeinitialiseerde data hoort in.bss

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 21. global main getal_1 :.word 11 getal_2 :.word 22 getal_3 :.word 33 som :.word hier komt uw code: done: b done

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 22. global main.data.align getal_1 :.word 11 getal_2 :.word 22 getal_3 :.word 33.bss.align som :.skip 4.text.align hier komt uw code: done: b done

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 23 Text vastleggen (data segment).data hello:.asciz ”Hello!”.text ldr r1, =hello

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 24 Text vastleggen (text segment).text hello:.asciz ”Hello!”.align ldr r1, =hello

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 25 Schrijf een (nette!) subroutine LCD_PUTASCIZ die de 0-terminated string waar R0 naar wijst naar het LCD schrijft. Maak gebruik van een geindexeerde instructie (en natuurlijk van LCD_PUTCHAR). Demonstreer dit, maak natuurlijk gebruik van.asciz.

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 26 Schrijf een (nette!) subroutine UPCHAR die het ASCII character in R0, als dit een kleine letter is, omzet naar een hoofdletter. Demonstreer deze subroutine door een variatie op LCD_PUTASCIZ te maken (bv LCD_PUTASCIZ_UPCHAR).

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 27 Tips:  ASCII lezen: byte-wise  flags beinvloeden: S erachter  vergelijken: CMP (geen S nodig)  Wat is de ASCII waarde van kleine letter a? Geen idee, ik gebruik gewoon ’a’…