Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .thumb
  2. .syntax unified
  3.  
  4. .include "gpio_constants.s"     // Register-adresser og konstanter for GPIO
  5.  
  6. .text
  7.     .global Start
  8.    
  9. Start:
  10.     LDR R0, =GPIO_BASE + (PORT_SIZE * BUTTON_PORT) + GPIO_PORT_DIN
  11.  
  12.     LDR R1, =GPIO_BASE + (PORT_E * PORT_SIZE) + GPIO_PORT_DOUTSET
  13.     LDR R2, =GPIO_BASE + (PORT_E * PORT_SIZE) + GPIO_PORT_DOUTCLR
  14.  
  15.     LDR R3, =1 << LED_PIN
  16.     LDR R4, =1 << BUTTON_PIN
  17.  
  18. Loop:
  19.     LDR R5, [R0]
  20.     CMP R5, R4
  21.     BNE On
  22.  
  23. Off:
  24.     STR R3, [R2]
  25.     B Loop
  26.  
  27. On:
  28.     STR R3, [R1]
  29.     B Loop
  30.  
  31. NOP // Behold denne pƄ bunnen av fila
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement