; reassembly of "NETZUHR_20090731_FLASH.HEX" ;--------------------------------------- ; ATtiny2313 memory use summary [bytes]: ; Segment Begin End Code Data Used Size Use% ; [.cseg] 0x000000 0x0007fc 2044 0 2044 2048 99.8% ; [.dseg] 0x000060 0x00007a 0 26 26 128 20.3% ; [.eseg] 0x000000 0x000000 0 0 0 128 0.0% ;;--------------------------------------- .nolist .include "tn2313def.inc" .list ; .def temp = r24 ; .dseg .org 0x0060 ; DS60: .byte 1 DS61: .byte 2 DS63: .byte 1 DS64: .byte 1 DS65: .byte 1 DS66: .byte 1 DS67: .byte 1 DS68: .byte 1 DS69: .byte 2 DS6B: .byte 1 DS6C: .byte 1 DS6D: .byte 1 DS6E: .byte 1 DS6F: .byte 1 DS70: .byte 1 DS71: .byte 1 DS72: .byte 1 DS73: .byte 1 DS74: .byte 1 DS75: .byte 1 DS76: .byte 1 DS77: .byte 1 DS78: .byte 1 DS79: .byte 1 ; last lds/sts data byte at 0x0079 ;--------------------------------------- .cseg .org 0x0000 ; L0000: rjmp _reset ; L0013 reti ; INT0 reti ; INT1 reti ; ICP1 reti ; OC1A rjmp L0252 ; ISR OVF1 rjmp L030E ; ISR OVF0 reti ; URXC0 reti ; UDRE0 reti ; UTXC0 reti ; ACI reti ; PCI reti ; OC1B reti ; OC0A reti ; OC0B reti ; USISTART reti ; USIOVF reti ; EERDY reti ; WDTOVF ; _reset: ; L0013: ldi temp, low(ramend); 0xDF out SPL, temp ; ldi temp, high(ramend) ; out SPH, temp ldi YL,0xC0 ldi ZL,0xB8 mov r4,ZL clr YH mov r5,YH ldi ZL,0x7E ldi ZH,0x00 ldi XL,0x60 ; DSEG startaddr ldi XH,0x00 clr temp L001F: st X+,temp sbiw ZL,0x01 brne L001F in temp,MCUSR ; MCUSR 0x34 BORF EXTRF PORF mov r0,temp andi temp,0xF7 out MCUSR,temp ldi temp,0x1F out WDTCR,temp ; WDTCR 0x21 WDCE WDE WDP 2 sec ldi temp,0x07 out WDTCR,temp ; WDP 2 sec (256) clr r6 ldi temp,0xFF out DDRB,temp ; DDRB 0x17 -> PB output ldi temp,0x0F out DDRD,temp ; DDRD 0x11-> PD IIIIOOOO ldi temp,0x20 out PORTD,temp ; 0x12 PD5 pullup L0031: ldi XL,0x30 ld r16,X bst r16, 5 ; bit 5 to T-flag brtc L0036 rjmp L0037 L0036: rjmp L0031 L0037: ldi temp,0x10 ldi r25,0x27 rcall L03E0 ldi temp,0x55 sts DS67,temp ldi temp,0x55 sts DS68,temp ldi temp,0x55 sts DS69,temp ldi temp,0x04 sts DS65,temp ldi temp,0x08 sts DS76,temp ldi temp,0x02 out TCCR0B,temp ; TCCR0B 0x33 CS02 ldi temp,0x00 out TCCR0A,temp ; TCCR0A 0x30 reset in temp,TIMSK ; read TIMSK 0x39 ori temp,0x02 ; TIMSK or mask 0x02 out TIMSK,temp ; refresh TIMSK ldi temp,0x00 out TCCR1A,temp ; TCCR1A 0x2F reset ldi temp,0x03 out TCCR1B,temp ; TCCR1B 0x2E CS10 + CS11 in temp,TIMSK ; read TIMSK ori temp,0x80 ; TIMSK or mask 0x80 out TIMSK,temp ; refresh TIMSK TOIE1 sei L0058: rcall L007A lds r16,DS68 cpi r16,0xAA breq L005E rjmp L005F L005E: rcall L0111 L005F: lds r16,DS71 cpi r16,0x01 breq L0064 rjmp L0068 L0064: ldi temp,0x07 sts DS66,temp rjmp L006B L0068: ldi temp,0x1F sts DS66,temp L006B: sbic PIND,5 ; skip PIND 0x10 Bit 5 cleared rjmp L0079 ldi temp,0x03 sts DS66,temp rcall L00E3 lds r16,DS60 cpi r16,0x64 breq L0076 rjmp L0078 L0076: rcall L0191 rjmp L0079 L0078: rcall L015F L0079: rjmp L0058 L007A: lds temp,DS71 sts DS6D,temp lds temp,DS72 sts DS6E,temp lds temp,DS73 sts DS6F,temp lds temp,DS74 sts DS70,temp ldi XL,0x6C ld r16,X bst r16, 0 brts L008F rjmp L0093 L008F: ldi temp,0x01 sts DS6B,temp rjmp L0096 L0093: ldi temp,0x04 sts DS6B,temp L0096: ret L0097: ldi temp,0x01 sts DS6B,temp lds temp,DS75 sts DS6D,temp lds temp,DS76 sts DS6E,temp lds temp,DS77 sts DS6F,temp lds temp,DS78 sts DS70,temp ret L00AB: ldi temp,0xD0 ldi r25,0x07 rcall L03E0 ret L00AF: ldi temp,0x04 sts DS6B,temp ldi temp,0x04 sts DS65,temp ldi temp,0x0A sts DS6D,temp ldi temp,0x0A sts DS6E,temp ldi temp,0x0A sts DS6F,temp ldi temp,0x0A sts DS70,temp ret ;--* ; L00C2: rcall L00AF ldi temp,0x00 sts DS6E,temp ldi temp,0x0B sts DS6F,temp ldi temp,0x0B sts DS70,temp ret L00CD: rcall L00AF ldi temp,0x0A sts DS6E,temp ldi temp,0x10 sts DS6F,temp ldi temp,0x11 sts DS70,temp ret L00D8: rcall L00AF ldi temp,0x05 sts DS6E,temp ldi temp,0x0E sts DS6F,temp ldi temp,0x0F sts DS70,temp ret L00E3: ldi temp,0x00 sts DS60,temp L00E6: ldi XL,0x30 ld r16,X bst r16,5 brtc L00EB rjmp L00F9 L00EB: ldi temp,0x0F ldi r25,0x00 rcall L03E0 ldi XL,0x60 ld temp,X subi temp,0xFF st X,temp lds r16,DS60 cpi r16,0x64 breq L00F7 rjmp L00F8 L00F7: ret L00F8: rjmp L00E6 L00F9: ret L00FA: ldi temp,0x00 sts DS60,temp L00FD: ldi XL,0x30 ld r16,X bst r16,5 brts L0102 rjmp L0110 L0102: ldi temp,0x0F ldi r25,0x00 rcall L03E0 ldi XL,0x60 ld temp,X subi temp,0xFF st X,temp lds r16,DS60 cpi r16,0x64 breq L010E rjmp L010F L010E: ret L010F: rjmp L00FD L0110: ret L0111: ldi temp,0x03 sts DS66,temp L0114: lds r20,DS74 lds r16,DS79 cp r16,r20 breq L011B rjmp L0120 L011B: rcall L007A sbic PIND, 5 ; PIND Bit5 rjmp L011F rjmp L0120 L011F: rjmp L0114 L0120: ldi temp,0x55 sts DS67,temp rcall L00E3 lds r16,DS60 cpi r16,0x64 breq L0129 rjmp L012A L0129: rjmp L0148 L012A: rcall L00AF ldi temp,0x05 sts DS6D,temp ldi temp,0x11 sts DS6E,temp ldi temp,0x02 sts DS6F,temp rcall L00AB ldi XL,0x79 ld temp,X subi temp,0xF9 st X,temp lds r16,DS79 cpi r16,0x09 brcs L013F breq L013F rjmp L0140 L013F: rjmp L0144 L0140: ldi XL,0x79 ld temp,X subi temp,0x0A st X,temp L0144: ldi temp,0xAA sts DS69,temp rjmp L015B L0148: ldi temp,0x55 sts DS69,temp lds temp,DS78 sts DS79,temp rcall L00C2 rcall L00AB rcall L00AB L0152: lds r20,DS74 lds r16,DS79 cp r16,r20 breq L0159 rjmp L015B L0159: rcall L007A rjmp L0152 L015B: ldi temp,0xAA sts DS67,temp ret L015F: rcall L00AB rcall L00AF ldi temp,0x0C sts DS6D,temp ldi temp,0x0D sts DS6E,temp rcall L00AB rcall L0097 rcall L00AB L016A: lds r16,DS67 cpi r16,0xAA breq L016F rjmp L0173 L016F: rcall L00CD ldi temp,0x0C sts DS6D,temp L0173: lds r16,DS67 cpi r16,0x55 breq L0178 rjmp L0183 L0178: rcall L00C2 ldi temp,0x0C sts DS6D,temp ldi temp,0x55 sts DS69,temp lds temp,DS78 sts DS79,temp L0183: rcall L00E3 rcall L00FA lds r16,DS60 cpi r16,0x64 breq L018A rjmp L018B L018A: ret L018B: ldi XL,0x67 ld temp,X ldi r25,0xFF eor temp,r25 st X,temp rjmp L016A L0191: rcall L00E3 lds r16,DS60 cpi r16,0x64 breq L0197 rjmp L0198 L0197: rcall L01A0 L0198: rcall L00E3 lds r16,DS60 cpi r16,0x64 breq L019E rjmp L019F L019E: rcall L01C2 L019F: ret L01A0: rcall L00D8 ldi temp,0x0C sts DS6D,temp rcall L00AB rcall L0097 rcall L01EF lds temp,DS6D sts DS75,temp lds temp,DS6E sts DS76,temp lds temp,DS6F sts DS77,temp lds temp,DS70 sts DS78,temp lds temp,DS78 sts DS79,temp ldi temp,0x55 sts DS69,temp ldi temp,0xAA sts DS67,temp ret L01C2: in temp,TIMSK ; read TIMSK andi temp,0x7F out TIMSK,temp ; update TIMSK rcall L00D8 rcall L00AB rcall L007A rcall L01EF lds temp,DS6D sts DS71,temp lds temp,DS6E sts DS72,temp lds temp,DS6F sts DS73,temp lds temp,DS70 sts DS74,temp lds temp,DS74 subi temp,0x01 sts DS74,temp L01DE: ldi XL,0x30 ld r16,X bst r16,5 brtc L01E3 rjmp L01E4 L01E3: rjmp L01DE L01E4: ldi temp,0x3B sts DS6C,temp ldi temp,0x38 out TCNT1H,temp ; TCNT1H 0x2D ldi temp,0x02 out TCNT1L,temp ; TCNT1L 0x2C in temp,TIMSK ; read TIMSK ori temp,0x80 ; set TOIE1 out TIMSK,temp ; update TIMSK ret L01EF: ldi temp,0x01 sts DS6B,temp L01F2: ldi temp,0x00 sts DS65,temp rcall L00E3 lds r16,DS60 cpi r16,0x64 breq L01FB rjmp L01FC L01FB: rjmp L0224 L01FC: rcall L00FA lds r16,DS60 cpi r16,0x64 breq L0202 rjmp L0203 L0202: rjmp L0224 L0203: ldi XL,0x6E ld temp,X subi temp,0xFF st X,temp lds r16,DS6E cpi r16,0x0A breq L020C rjmp L0213 L020C: ldi temp,0x00 sts DS6E,temp ldi XL,0x6D ld temp,X subi temp,0xFF st X,temp L0213: lds r16,DS6D cpi r16,0x02 breq L0218 rjmp L0223 L0218: lds r16,DS6E cpi r16,0x04 breq L021D rjmp L0223 L021D: ldi temp,0x00 sts DS6E,temp ldi temp,0x00 sts DS6D,temp L0223: rjmp L01F2 L0224: ldi temp,0x01 sts DS65,temp rcall L00E3 lds r16,DS60 cpi r16,0x64 breq L022D rjmp L022E L022D: rjmp L024E L022E: rcall L00FA lds r16,DS60 cpi r16,0x64 breq L0234 rjmp L0235 L0234: rjmp L024E L0235: ldi XL,0x70 ld temp,X subi temp,0xFF st X,temp lds r16,DS70 cpi r16,0x0A breq L023E rjmp L0245 L023E: ldi temp,0x00 sts DS70,temp ldi XL,0x6F ld temp,X subi temp,0xFF st X,temp L0245: lds r16,DS6F cpi r16,0x06 breq L024A rjmp L024D L024A: ldi temp,0x00 sts DS6F,temp L024D: rjmp L0224 L024E: ldi temp,0x04 sts DS65,temp ret L0252: push r0 push r1 push r2 push r3 push r4 push r5 push r7 push r10 push r11 push r16 push r17 push r18 push r19 push r20 push r21 push r22 push r23 push temp push r25 push XL push XH push YL push YH push ZL push ZH in temp,SREG ; save SREG 0x3F push temp ldi temp,0x38 out TCNT1H,temp ; TCNT1H 0x2D ldi temp,0x02 out TCNT1L,temp ; TCNT1L 0x2C ldi XL,0x6C ld temp,X subi temp,0xFF st X,temp lds r16,DS6C cpi r16,0x3B brcs L027B breq L027B rjmp L027C L027B: rjmp L0283 L027C: ldi temp,0x00 sts DS6C,temp ldi XL,0x74 ld temp,X subi temp,0xFF st X,temp L0283: lds r16,DS74 cpi r16,0x09 brcs L0289 breq L0289 rjmp L028A L0289: rjmp L0291 L028A: ldi temp,0x00 sts DS74,temp ldi XL,0x73 ld temp,X subi temp,0xFF st X,temp L0291: lds r16,DS73 cpi r16,0x05 brcs L0297 breq L0297 rjmp L0298 L0297: rjmp L029F L0298: ldi temp,0x00 sts DS73,temp ldi XL,0x72 ld temp,X subi temp,0xFF st X,temp L029F: lds r16,DS72 cpi r16,0x09 brcs L02A5 breq L02A5 rjmp L02A6 L02A5: rjmp L02AD L02A6: ldi temp,0x00 sts DS72,temp ldi XL,0x71 ld temp,X subi temp,0xFF st X,temp L02AD: lds r16,DS71 cpi r16,0x01 brcs L02B3 breq L02B3 rjmp L02B4 L02B3: rjmp L02C1 L02B4: lds r16,DS72 cpi r16,0x03 brcs L02BA breq L02BA rjmp L02BB L02BA: rjmp L02C1 L02BB: ldi temp,0x00 sts DS72,temp ldi temp,0x00 sts DS71,temp L02C1: ldi temp,0x55 sts DS68,temp lds r16,DS67 cpi r16,0xAA brne L02C9 rjmp L02CA L02C9: rjmp L02F2 L02CA: lds r16,DS69 cpi r16,0xAA breq L02CF rjmp L02D0 L02CF: rjmp L02E8 L02D0: lds r20,DS71 lds r16,DS75 cp r16,r20 brne L02D7 rjmp L02D8 L02D7: rjmp L02F2 L02D8: lds r20,DS72 lds r16,DS76 cp r16,r20 brne L02DF rjmp L02E0 L02DF: rjmp L02F2 L02E0: lds r20,DS73 lds r16,DS77 cp r16,r20 brne L02E7 rjmp L02E8 L02E7: rjmp L02F2 L02E8: lds r20,DS74 lds r16,DS79 cp r16,r20 breq L02EF rjmp L02F2 L02EF: ldi temp,0xAA sts DS68,temp L02F2: pop temp out 0x3F,temp ; SREG restore pop ZH pop ZL pop YH pop YL pop XH pop XL pop r25 pop temp pop r23 pop r22 pop r21 pop r20 pop r19 pop r18 pop r17 pop r16 pop r11 pop r10 pop r7 pop r5 pop r4 pop r3 pop r2 pop r1 pop r0 reti L030E: push r0 push r1 push r2 push r3 push r4 push r5 push r7 push r10 push r11 push r16 push r17 push r18 push r19 push r20 push r21 push r22 push r23 push temp push r25 push XL push XH push YL push YH push ZL push ZH in temp,0x3F ; save SREG push temp ldi temp,0x60 out 0x32,temp ; TCNT0 ldi temp,0xFF out PORTB,temp ; PORTB output sbic PIND, 4 ; PIND bit 4 rjmp L0330 rjmp L03BB L0330: ldi XL,0x63 ld temp,X subi temp,0xFF st X,temp lds r16,DS63 lds r20,DS66 and r16,r20 ldi XL,0x63 st X,r16 ldi temp,0xA0 out PORTD,temp ; PORTD output lds r16,DS63 cpi r16,0x00 breq L0342 rjmp L0352 L0342: sbi PORTD, 3 ; PORTD Bit 3 ldi XL,0x6D ld ZL,X clr ZH ldi XL,0x64 ldi r25,0x01 rcall L03F7 lds r16,DS64 cpi r16,0xC0 breq L034E rjmp L0351 L034E: ldi temp,0xFF sts DS64,temp L0351: rjmp L0376 L0352: cpi r16,0x01 breq L0355 rjmp L035D L0355: sbi PORTD, 2 ; PORTD Bit 2 ldi XL,0x6E ld ZL,X clr ZH ldi XL,0x64 ldi r25,0x01 rcall L03F7 rjmp L0376 L035D: cpi r16,0x02 breq L0360 rjmp L0368 L0360: sbi PORTD, 1 ; PORTD Bit 1 ldi XL,0x6F ld ZL,X clr ZH ldi XL,0x64 ldi r25,0x01 rcall L03F7 rjmp L0376 L0368: cpi r16,0x03 breq L036B rjmp L0376 L036B: sbi PORTD, 0 ; PORTD Bit 0 ldi XL,0x70 ld ZL,X clr ZH ldi XL,0x64 ldi r25,0x01 rcall L03F7 ldi XL,0x6A ld temp,X subi temp,0xFF st X,temp L0376: ldi XL,0x63 ld temp,X bst temp, 1 ldi XL,0x61 clr temp bld temp, 0 st X,temp lds r20,DS65 lds r16,DS61 cp r16,r20 breq L0384 rjmp L038C L0384: ldi XL,0x6A ld r16,X bst r16, 6 brts L0389 rjmp L038C L0389: ldi temp,0xFF sts DS64,temp L038C: lds r20,DS6B lds r16,DS63 cp r16,r20 breq L0393 rjmp L0397 L0393: ldi XL,0x64 ld temp,X andi temp,0x7F st X,temp L0397: lds r16,DS67 cpi r16,0xAA breq L039C rjmp L03A5 L039C: lds r16,DS63 cpi r16,0x03 breq L03A1 rjmp L03A5 L03A1: ldi XL,0x64 ld temp,X andi temp,0x7F st X,temp L03A5: ldi XL,0x64 ld temp,X out PORTB,temp lds r16,DS68 cpi r16,0xAA breq L03AD rjmp L03BB L03AD: ldi XL,0x6A ld temp,X bst temp, 6 ldi XL,0x31 ld temp,X bld temp, 6 st X,temp ldi XL,0x6A ld temp,X bst temp, 6 ldi XL,0x32 ld temp,X bld temp, 6 st X,temp L03BB: pop temp out 0x3F,temp ; SREG back pop ZH pop ZL pop YH pop YL pop XH pop XL pop r25 pop temp pop r23 pop r22 pop r21 pop r20 pop r19 pop r18 pop r17 pop r16 pop r11 pop r10 pop r7 pop r5 pop r4 pop r3 pop r2 pop r1 pop r0 reti L03D7: sbiw ZL,0x01 brne L03D7 ret set bld r6, 2 ret clt bld r6, 2 ret L03E0: push ZL push ZH clr ZL or ZL,temp or ZL,r25 breq L03EC L03E6: ldi ZL,0x33 ldi ZH,0x03 L03E8: sbiw ZL,0x01 brne L03E8 sbiw temp,0x01 brne L03E6 L03EC: pop ZH pop ZL ret L03EF: sbic 0x1C, 1; EECR read enable rjmp L03EF out 0x1E,ZL ; EEAR read write acc adiw ZL,0x01 ret ldi r25,0x01 rjmp L03F7 ldi r25,0x02 L03F7: rcall L03EF sbi 0x1C,0 ; EECR read ena in temp,0x1D ; EEDR data reg st X+,temp dec r25 brne L03F7 ret ; last flash byte address = 0x07FB ; last flash word address = 0x03FD ;--------------------------------------- ;