.NOLIST .INCLUDE "8515def.inc" .LIST .DEF mp = R16 rjmp main main: ldi mp,0xFF out DDRB, mp loop: ldi mp, 0b01010101 out PORTB, mp ldi mp, 0b10101010 out PORTB, mp clr mp out PORTB, mp ser mp out PORTB, mp rjmp loop |
AVRASM ver. 2.1.12
C:\Atmel_ASM\ASM001\ASM001.asm Fri Jul 27 17:46:24 2007 C:\Atmel_ASM\ASM001\ASM001.asm(3): Including file 'C:\Programme\Atmel\AVR Tools\AvrAssembler2\Appnotes\8515def.inc' .LIST .DEF mp = R16 000000 c000 rjmp main main: 000001 ef0f ldi mp,0xFF 000002 bb07 out DDRB, mp loop: 000003 e505 ldi mp, 0b01010101 000004 bb08 out PORTB, mp 000005 ea0a ldi mp, 0b10101010 000006 bb08 out PORTB, mp 000007 2700 clr mp 000008 bb08 out PORTB, mp 000009 ef0f ser mp 00000a bb08 out PORTB, mp 00000b cff7 rjmp loop RESOURCE USE INFORMATION ------------------------ Notice: The register and instruction counts are symbol table hit counts, and hence implicitly used resources are not counted, eg, the 'lpm' instruction without operands implicitly uses r0 and z, none of which are counted. x,y,z are separate entities in the symbol table and are counted separately from r26..r31 here. .dseg memory usage only counts static data declared with .byte AT90S8515 register use summary: r0 : 0 r1 : 0 r2 : 0 r3 : 0 r4 : 0 r5 : 0 r6 : 0 r7 : 0 r8 : 0 r9 : 0 r10: 0 r11: 0 r12: 0 r13: 0 r14: 0 r15: 0 r16: 10 r17: 0 r18: 0 r19: 0 r20: 0 r21: 0 r22: 0 r23: 0 r24: 0 r25: 0 r26: 0 r27: 0 r28: 0 r29: 0 r30: 0 r31: 0 x : 0 y : 0 z : 0 Registers used: 1 out of 35 (2.9%) AT90S8515 instruction use summary: adc : 0 add : 0 adiw : 0 and : 0 andi : 0 asr : 0 bclr : 0 bld : 0 brbc : 0 brbs : 0 brcc : 0 brcs : 0 breq : 0 brge : 0 brhc : 0 brhs : 0 brid : 0 brie : 0 brlo : 0 brlt : 0 brmi : 0 brne : 0 brpl : 0 brsh : 0 brtc : 0 brts : 0 brvc : 0 brvs : 0 bset : 0 bst : 0 cbi : 0 cbr : 0 clc : 0 clh : 0 cli : 0 cln : 0 clr : 1 cls : 0 clt : 0 clv : 0 clz : 0 com : 0 cp : 0 cpc : 0 cpi : 0 cpse : 0 dec : 0 eor : 0 icall : 0 ijmp : 0 in : 0 inc : 0 ld : 0 ldd : 0 ldi : 3 lds : 0 lpm : 0 lsl : 0 lsr : 0 mov : 0 neg : 0 nop : 0 or : 0 ori : 0 out : 5 pop : 0 push : 0 rcall : 0 ret : 0 reti : 0 rjmp : 2 rol : 0 ror : 0 sbc : 0 sbci : 0 sbi : 0 sbic : 0 sbis : 0 sbiw : 0 sbr : 0 sbrc : 0 sbrs : 0 sec : 0 seh : 0 sei : 0 sen : 0 ser : 1 ses : 0 set : 0 sev : 0 sez : 0 sleep : 0 st : 0 std : 0 sts : 0 sub : 0 subi : 0 swap : 0 tst : 0 wdr : 0 Instructions used: 5 out of 100 (5.0%) AT90S8515 memory use summary [bytes]: Segment Begin End Code Data Used Size Use% --------------------------------------------------------------- [.cseg] 0x000000 0x000018 24 0 24 8192 0.3% [.dseg] 0x000060 0x000060 0 0 0 512 0.0% [.eseg] 0x000000 0x000000 0 0 0 512 0.0% Assembly complete, 0 errors, 0 warnings |
.NOLIST .INCLUDE "8515def.inc" .LIST .DEF temp = R20 ; Initialisierung Stackpointer: ; Der Stack wird im RAM angelegt. ; Der Stack wächst von oben nach unten. ; Zu Beginn muss man den Stackpointer auf das Ende des RAM setzen. ldi temp, LOW(RAMEND) ; Low Byte der höchsten RAM-Adresse out SPL, temp ldi temp, HIGH(RAMEND) ; High Byte der höchsten RAM-Adresse out SPH, temp ; Sprung zum Hauptprogramm rjmp main ; Hauptprogramm main: ldi R16,0xFF out DDRB, R16 loop: ldi R16, 0b01010101 out PORTB, R16 rcall delay; ldi R16, 0b10101010 out PORTB, R16 rcall delay; clr R16 out PORTB, R16 rcall delay; ser R16 out PORTB, R16 rcall delay; rjmp loop ; Unterprogramm Warteschleife delay: clr R17 M2: clr R18 M1: dec R18 ; erniedrigt R18 um 1 (Decrement) nop ; No Operation (1 Takt) nop nop nop nop nop nop nop nop nop nop nop nop nop brne M1 ; Branch if Not Equal dec R17 brne M2 ret ; Return from Subroutine |
.NOLIST .INCLUDE "8515def.inc" .LIST .DEF temp = R20 ; Initialisierung Stackpointer: ; Der Stack wird im RAM angelegt. ; Der Stack wächst von oben nach unten. ; Zu Beginn muss man den Stackpointer auf das Ende des RAM setzen. ldi temp, LOW(RAMEND) ; Low Byte der höchsten RAM-Adresse out SPL, temp ldi temp, HIGH(RAMEND) ; High Byte der höchsten RAM-Adresse out SPH, temp ; Sprung zum Hauptprogramm rjmp main ; Hauptprogramm main: ldi R16,0xFF out DDRB, R16 loop: ldi R16, 0b01010101 out PORTB, R16 rcall delay; ldi R16, 0b10101010 out PORTB, R16 rcall delay; clr R16 out PORTB, R16 rcall delay; ser R16 out PORTB, R16 rcall delay; rjmp loop ; Unterprogramm Warteschleife delay: ; ============================= ; delay loop generator ; 2000000 cycles: ; ----------------------------- ; delaying 1999998 cycles: ldi R17, $12 WGLOOP0: ldi R18, $BC WGLOOP1: ldi R19, $C4 WGLOOP2: dec R19 brne WGLOOP2 dec R18 brne WGLOOP1 dec R17 brne WGLOOP0 ; ----------------------------- ; delaying 2 cycles: nop nop ; ============================= ret ; Return from Subroutine |