--- /dev/null
+;
+; eeprom via i2c read/write
+;
+; author: hackbard@hackdaworld.org
+;
+
+; specify device
+.include "../include/m32def.inc"
+
+; ------------------
+; interrupt vectors:
+; ------------------
+
+; reset
+nop
+rjmp RESET
+; int0
+nop
+reti
+; int1
+nop
+reti
+; int2
+nop
+reti
+; timer 2 compare
+nop
+reti
+; timer 2 overflow
+nop
+reti
+; timer 1 capture
+nop
+reti
+; timer 1 compare a
+nop
+reti
+; timer 1 compare b
+nop
+reti
+; timer 1 overflow
+nop
+reti
+; timer 0 compare
+nop
+reti
+; timer 0 overflow
+nop
+reti
+; spi/stc transfer complete
+nop
+reti
+; usart rx complete
+nop
+reti
+; usart data register empty
+nop
+reti
+; usart tx complete
+nop
+reti
+; adc complete
+nop
+reti
+; eeprom ready
+nop
+reti
+; analog comparator
+nop
+reti
+; twi
+nop
+reti
+; spm ready
+nop
+reti
+
+; -----
+; code:
+; -----
+
+RESET:
+; set stackpointer
+ldi r16,high(RAMEND) ; write top of ramend (highbyte)
+out SPH,r16 ; to stackpointer
+ldi r16,low(RAMEND) ; write top of ramend (lowbyte)
+out SPL,r16 ; to stackpointer
+
+; rs232 init
+ldi r16,12 ; "76,8k bps @ 16 mhz" in r16
+out UBRR,r16 ; write to uart baudrate register
+ldi r16,(1<<RXEN)|(1<<TXEN) ; enable rx/tx
+out UCSRB,r16 ; write to uart control register
+
+; two wire (aka i2c) setup
+ldi r16,20 ; set period
+out TWBR,r16 ; write to twi bit rate register
+;in r16,TWSR ; get status register
+;ori r16,1 ; set last bit -> prescaler = 4
+;andi r16,0xfd
+sbi TWSR,TWPS0
+cbi TWSR,TWPS1
+;out TWSR,r16 ; write to twi status register
+
+ldi r16,(1<<TWEN|1<<TWINT|)
+TWCR
+
+
+; global interrupt enable
+sei
+
+
+
+
+; transmit 0x23 all the fucking time ...
+ldi r16, 0x23 ; load 0x23 to register
+out UDR, r16 ; write that to uart data register port
+LOOP:
+sbis USR, UDRE
+rjmp LOOP
+ldi r16, 0x0a
+out UDR, r16
+rjmp LOOP_H
+
+LOOP_H:
+sbis USR, UDRE
+rjmp LOOP_H
+ldi r16, 0x68
+out UDR, r16
+rjmp LOOP_D
+
+LOOP_D:
+sbis USR, UDRE
+rjmp LOOP_D
+ldi r16, 0x64
+out UDR, r16
+rjmp LOOP_W
+
+LOOP_W:
+sbis USR, UDRE
+rjmp LOOP_W
+ldi r16, 0x77
+out UDR, r16
+rjmp LOOP
+