PUBLIC geti2cbyte RSEG CODE geti2cbyte mov.b #00000000B, R12 ;R12 für empfangenes Byte bic.b #4,&P1DIR ;sda auf eingang umschalten mov.b #00001000B, R13 ;8x ausführen nextin bic.b #2,&P1DIR ;SCL high call #delay bit.b #4,&P1IN ;SDA testen rlc.b R12 ;SDA in R12 rotieren bis.b #2,&P1DIR ;SCL low bic.b #2,&P1OUT call #delay dec.b R13 jne nextin mov.b R12, xyz ;Empf. Byte übergeben ret PUBLIC delay RSEG CODE delay nop nop nop nop nop nop ret