Advertisement
Jgug

Lr_01_2

Feb 28th, 2014
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .include "m2560def.inc"
  2.  
  3. .cseg
  4. init:
  5.     ldi r16,0xFA
  6.     ldi r17,0b11101111
  7.     ldi r18,0x03
  8.     ldi r19,0x57
  9.     out DDRB,r16
  10. main:
  11.     ldi r16,0xFA
  12.     ldi r17,0b11101111
  13.     ldi r18,0x03
  14.     ldi r19,0x57
  15.     out PORTB, r16
  16.     AND r17,r16
  17.     out PORTB,r17
  18.     cp r16,r17
  19.     rjmp res
  20.     noteq:
  21.         out PORTB,r19
  22.         rjmp main
  23.     equal:
  24.         out PORTB,r18
  25.         rjmp main
  26.     res:
  27.         brne noteq
  28.         breq equal
  29.         rjmp main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement