1 / 17

Wat gaan we doen?

Wat gaan we doen?. herhaling ARM assembler instructies nieuwe ARM assembler instructie variaties het bordje en het gebruik ervan oefening. Herhaling. LDR R0, =value @ load fixed value MOV R0, R1 @ reg-reg copy LDR R0, [ R1 ] @ read from memory STR R0, [ R1 ] @ write to memory

Télécharger la présentation

Wat gaan we doen?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Wat gaan we doen? • herhaling ARM assembler instructies • nieuwe ARM assembler instructie variaties • het bordje en het gebruik ervan • oefening Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  2. Herhaling LDR R0, =value @ load fixed value MOV R0, R1 @ reg-reg copy LDR R0, [ R1 ] @ read from memory STR R0, [ R1 ] @ write to memory ADD R0, R1, R2 @ R0 = R1 + R2 ADD R0, R1, #15 @ R0 = R1 + 15 B label @ spring naar label BL subroutine @ spring naar subroutine Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  3. Herhaling ADD R0, R1, R2 @ tel op ADDS R0, R1, R2 @ en zet status ADDEQ R0, R1, R2 @ doe alleen als ‘EQ’ ADDSEQ R0, R1, R2 @ combinatie Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  4. Nieuw Variaties op LDR R0, [ R1 ]: LDR R0, [ R1 ] @ word (32 bit) LDRH R0, [ R1 ] @ half-word (16 bit) LDRB R0, [ R1 ] @ byte (8 bit) - H of B komt achteraan, dus: LDREQB - Let op de alignment van het geheugen adres! - Kan ook met STR Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  5. het bordje • sluit een bordje aan (parallel + USB) • installeer de files uit flip.zip • in een lege directory • let op: geen spaties in de pathname  • dubbel-klik op de .ppr file • build • start debugger Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  6. het bordje zet onder file > target settings: • Target = Remote/TCP • Hostname = 127.0.0.1 • Port = 8888 (als je netjes afsluit blijft zou dit moeten blijven staan) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  7. het bordje Als je dit krijgt moet je onder control panel > system > hardware > device manager (select view > show hidden devices) > non plug-and-pray devices > MAC_MOT > driver instellen op status = started, type = automatic Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  8. het bordje Als je dit krijgt heb je debugger/loader niet afgesloten Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  9. het bordje Voor als het even echt niet meer werkt: • als je de debugger hebt afgesloten moeten al die DOS schermen ook weg zijn (evt met de hand sluiten) • De editor sluiten en weer opstarten • de USB en Paralelle kabels er even uithalen om het bordje te resetten, USB eerst weer aansluiten, dan parallel. • PC uitzetten en weer aanzetten Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  10. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  11. flip.zip Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  12. flip.zip : beschikbare subroutines • ARK_LEDs_write schrijft de laagste 8 bits van R0 naar de LEDs, bitje == 1  LEDje is aan • ARK_wait_us wacht R0 microseconds (micro = 10-6) Beiden volgen de APCS! Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  13. APCS = ARM Procedure Call Standard R0 - R3 : function arguments R0 : function result (if applicable) R4 - R8 : local scratch (preserved) R9 - R15 : specific use (avoid) R0 - R3 are *not* preserved (caller-saved) R4 - R8 *must* be preserved (boek p175-180) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  14. flip.zip : flip.S #include "ark.h" .global main ARM main: mov r0, r1 loop: ldr r0, =0x55 bl ARK_LEDs_write ldr r0, =( 500 * 1000 ) bl ARK_wait_us ldr r0, =0xAA bl ARK_LEDs_write ldr r0, =( 500 * 1000 ) bl ARK_wait_us b loop Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  15. Opdrachten:Build en run het ‘flip’ programma op je bordje. Maak vervolgens zelf een programma dat op de LEDs een ‘KITT’ display laat zien. Maak hiervan twee versies:1. Een Belgische versie: een reeks calls met de waarden (patronen) die je wilt laten zien.Dit is een uitbreiding van flip.S in de zelfde stijl. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  16. Opdrachten (vervolg):2. Maak vervolgens een ‘tabel-in-het-geheugen’ versie: zet in het geheugen een reeks “.hword N” waarden, met als N de opeenvolgende patronen. Gebruik een waarde die niet kan, bv “-1” als afsluiter. Je programma begint aan het begin van de reeks, leest telkens een waarde, toon die waarde, en wacht even, maar als het de afsluiter tegenkomt begin je weer opnieuw aan het begin van de reeks. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  17. Opdrachten (vervolg):Verwijder flip.S (of jouw versie daarvan) uit het project en voeg kitt.c toe. Dit is een C versie van het kitt display. Pas dit programma aan zodat het ledje snel naar links gaat en dan langzaam naar rechts. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

More Related