; ; Example14_1Asm.asm ; ; Created: 10/04/2017 05:42:08 ; Author : Naimi ; LDI R20,HIGH(RAMEND) ;initialize stack pointer OUT SPH,R20 LDI R20,LOW(RAMEND) OUT SPL,R20 LDI R20,0xFF ;Port B as output OUT DDRB,R20 LDI R20,0x06 ;load step sequence L1: OUT PORTB,R20 ;PORTB = R20 LSR R20 ;shift right BRCC L2 ;if not carry skip next ORI R20,0x8 L2: RCALL DELAY ;wait RJMP L1 DELAY: LDI R18,30 D_L: LDI R17,255 D_L0: LDI R16,255 D_L1: NOP DEC R16 BRNE D_L1 DEC R17 BRNE D_L0 DEC R18 BRNE D_L RET