SHARE
TWEET

Untitled

a guest Feb 27th, 2020 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /*
  3.  * Assembler1.S
  4.  *
  5.  * Created: 2020-02-27 10:56:18
  6.  *  Author: eko15lj1
  7.  */
  8.  #define DDRB 0x04
  9.  #define PORTB 0x05
  10.  #define PINA 0x00
  11.  #define LED 0
  12.  
  13.  .global led_on
  14.  .global led_off
  15.  .global check_button
  16.  
  17. led_on:
  18.     ldi r18, 255
  19.     in r17, DDRB
  20.     or r17, r18
  21.     out DDRB, r18
  22.  
  23.     in r17, PORTB
  24.     or r17, r18
  25.     out PORTB, r18
  26. ret
  27.  
  28. led_off:
  29.     ldi r18, 255
  30.     //in r17, DDRB
  31.     //and r17, r18
  32.     out DDRB, r18
  33.  
  34.     ldi r17, 0
  35.     //or r17, r18
  36.     out PORTB, r17
  37. ret
  38.  
  39. check_button:
  40.     in r19, PINA
  41.     and r24, r19
  42. ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top