Vet inte om jag tycker att koden för PIC18 blev så mycket bättre. En del ASM kommandon är utbytta och det blir inte riktigt lika mycket att spara undan i början av interruptet men annars är det inte mcyket bättre.
Kod: Markera allt
; ADDRESS OPCODE ASM
; ----------------------------------------------
$0000 $EFD8 F003 GOTO _main
$0008 $ _interrupt:
$0008 $C076 F02D MOVFF STACK_11, STSAVED_11
$000C $C075 F02C MOVFF STACK_10, STSAVED_10
$0010 $C06C F02B MOVFF STACK_1, STSAVED_1
$0014 $C06B F02A MOVFF STACK_0, STSAVED_0
$0018 $CFE9 F017 MOVFF FSR0L, ?saveFSR0
$001C $CFEA F018 MOVFF FSR0H, ?saveFSR0+1
$0020 $CFE1 F019 MOVFF FSR1L, ?saveFSR1
$0024 $CFE2 F01A MOVFF FSR1H, ?saveFSR1+1
;1Wire_Master.c,62 :: void interrupt() {
;1Wire_Master.c,70 :: if (INTCON.INT0F) {
$0028 $A2F2 BTFSS INTCON, 1, 0
$002A $D156 BRA L_interrupt_2
;1Wire_Master.c,72 :: switch (onewire_state) {
$002C $D138 BRA L_interrupt_3
;1Wire_Master.c,74 :: case GET_CMD : TRISB.F0=1;
$002E $ L_interrupt_5:
$002E $8093 BSF TRISB, 0, 0
;1Wire_Master.c,75 :: olow_cmd >>= 1;
$0030 $3213 RRCF interrupt_olow_cmd_L0, 1, 0
$0032 $9E13 BCF interrupt_olow_cmd_L0, 7, 0
;1Wire_Master.c,76 :: delay_us(10);
$0034 $0E21 MOVLW 33
$0036 $6E75 MOVWF STACK_10, 0
$0038 $2E75 DECFSZ STACK_10, F, 0
$003A $D7FE BRA $-1
;1Wire_Master.c,77 :: if(PORTB.F0)
$003C $B081 BTFSC PORTB, 0, 0
;1Wire_Master.c,78 :: olow_cmd |= 0x80;
$003E $8E13 BSF interrupt_olow_cmd_L0, 7, 0
$0040 $ L_interrupt_6:
;1Wire_Master.c,79 :: bit_index++;
$0040 $2A14 INCF interrupt_bit_index_L0, 1, 0
;1Wire_Master.c,81 :: if (bit_index > 7) {
$0042 $5014 MOVF interrupt_bit_index_L0, 0, 0
$0044 $0807 SUBLW 7
$0046 $B0D8 BTFSC STATUS, C, 0
$0048 $D07E BRA L_interrupt_7
;1Wire_Master.c,83 :: byte_index=0;
$004A $6A15 CLRF interrupt_byte_index_L0, 0
;1Wire_Master.c,84 :: bit_index=0;
$004C $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,86 :: if (ow_active) {
$004E $A480 BTFSS PORTA, 2, 0
$0050 $D021 BRA L_interrupt_8
;1Wire_Master.c,88 :: switch (olow_cmd) {
$0052 $D01B BRA L_interrupt_9
;1Wire_Master.c,90 :: case READ_SCRATCHPAD :
$0054 $ L_interrupt_11:
;1Wire_Master.c,91 :: onewire_state=ANSWARE_REQUEST;
$0054 $0E06 MOVLW 6
$0056 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,92 :: ANSWARE_DATA=SCRATCHPAD;
$0058 $0E03 MOVLW _SCRATCHPAD
$005A $6E01 MOVWF _ANSWARE_DATA, 0
$005C $0E00 MOVLW @_SCRATCHPAD
$005E $6E02 MOVWF _ANSWARE_DATA+1, 0
;1Wire_Master.c,93 :: bit_temp=(ANSWARE_DATA[byte_index] >> bit_index) & 0b00000001;
$0060 $5015 MOVF interrupt_byte_index_L0, 0, 0
$0062 $2401 ADDWF _ANSWARE_DATA, 0, 0
$0064 $6EE9 MOVWF FSR0L, 0
$0066 $0E00 MOVLW 0
$0068 $2002 ADDWFC _ANSWARE_DATA+1, 0, 0
$006A $6EEA MOVWF FSR0L+1, 0
$006C $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$0070 $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$0074 $506B MOVF STACK_0, 0, 0
$0076 $ L_interrupt_49:
$0076 $E004 BZ L_interrupt_50
$0078 $3216 RRCF interrupt_bit_temp_L0, 1, 0
$007A $9E16 BCF interrupt_bit_temp_L0, 7, 0
$007C $0FFF ADDLW 255
$007E $D7FB BRA L_interrupt_49
$0080 $ L_interrupt_50:
$0080 $0E01 MOVLW 1
$0082 $1616 ANDWF interrupt_bit_temp_L0, 1, 0
;1Wire_Master.c,94 :: break;
$0084 $D006 BRA L_interrupt_10
;1Wire_Master.c,96 :: default :
$0086 $ L_interrupt_12:
;1Wire_Master.c,97 :: onewire_state=WAITING_FOR_RESET;
$0086 $6A00 CLRF _onewire_state, 0
;1Wire_Master.c,98 :: break;
$0088 $D004 BRA L_interrupt_10
;1Wire_Master.c,99 :: }
$008A $ L_interrupt_9:
$008A $5013 MOVF interrupt_olow_cmd_L0, 0, 0
$008C $0ABE XORLW 190
$008E $E0E2 BZ L_interrupt_11
$0090 $D7FA BRA L_interrupt_12
$0092 $ L_interrupt_10:
;1Wire_Master.c,100 :: }
$0092 $D059 BRA L_interrupt_13
$0094 $ L_interrupt_8:
;1Wire_Master.c,103 :: switch (olow_cmd) {
$0094 $D04B BRA L_interrupt_14
;1Wire_Master.c,105 :: case SEARCH_ROM :
$0096 $ L_interrupt_16:
;1Wire_Master.c,106 :: onewire_state=SEARCH_ROM_BIT;
$0096 $0E02 MOVLW 2
$0098 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,107 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$009A $0E0B MOVLW _ROM_id
$009C $6EE9 MOVWF FSR0L, 0
$009E $0E00 MOVLW @_ROM_id
$00A0 $6EEA MOVWF FSR0L+1, 0
$00A2 $5015 MOVF interrupt_byte_index_L0, 0, 0
$00A4 $26E9 ADDWF FSR0L, 1, 0
$00A6 $B0D8 BTFSC STATUS, C, 0
$00A8 $2AEA INCF FSR0L+1, 1, 0
$00AA $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$00AE $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$00B2 $506B MOVF STACK_0, 0, 0
$00B4 $ L_interrupt_51:
$00B4 $E004 BZ L_interrupt_52
$00B6 $3216 RRCF interrupt_bit_temp_L0, 1, 0
$00B8 $9E16 BCF interrupt_bit_temp_L0, 7, 0
$00BA $0FFF ADDLW 255
$00BC $D7FB BRA L_interrupt_51
$00BE $ L_interrupt_52:
$00BE $0E01 MOVLW 1
$00C0 $1616 ANDWF interrupt_bit_temp_L0, 1, 0
;1Wire_Master.c,108 :: break;
$00C2 $D041 BRA L_interrupt_15
;1Wire_Master.c,110 :: case SKIP_ROM :
$00C4 $ L_interrupt_17:
;1Wire_Master.c,111 :: ow_active=1;
$00C4 $8480 BSF PORTA, 2, 0
;1Wire_Master.c,112 :: break;
$00C6 $D03F BRA L_interrupt_15
;1Wire_Master.c,114 :: case MATCH_ROM :
$00C8 $ L_interrupt_18:
;1Wire_Master.c,115 :: onewire_state=MATCH_ROM_READ;
$00C8 $0E05 MOVLW 5
$00CA $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,116 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$00CC $0E0B MOVLW _ROM_id
$00CE $6EE9 MOVWF FSR0L, 0
$00D0 $0E00 MOVLW @_ROM_id
$00D2 $6EEA MOVWF FSR0L+1, 0
$00D4 $5015 MOVF interrupt_byte_index_L0, 0, 0
$00D6 $26E9 ADDWF FSR0L, 1, 0
$00D8 $B0D8 BTFSC STATUS, C, 0
$00DA $2AEA INCF FSR0L+1, 1, 0
$00DC $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$00E0 $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$00E4 $506B MOVF STACK_0, 0, 0
$00E6 $ L_interrupt_53:
$00E6 $E004 BZ L_interrupt_54
$00E8 $3216 RRCF interrupt_bit_temp_L0, 1, 0
$00EA $9E16 BCF interrupt_bit_temp_L0, 7, 0
$00EC $0FFF ADDLW 255
$00EE $D7FB BRA L_interrupt_53
$00F0 $ L_interrupt_54:
$00F0 $0E01 MOVLW 1
$00F2 $1616 ANDWF interrupt_bit_temp_L0, 1, 0
;1Wire_Master.c,117 :: break;
$00F4 $D028 BRA L_interrupt_15
;1Wire_Master.c,120 :: case READ_ROM :
$00F6 $ L_interrupt_19:
;1Wire_Master.c,121 :: onewire_state=ANSWARE_REQUEST;
$00F6 $0E06 MOVLW 6
$00F8 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,122 :: ANSWARE_DATA=ROM_id;
$00FA $0E0B MOVLW _ROM_id
$00FC $6E01 MOVWF _ANSWARE_DATA, 0
$00FE $0E00 MOVLW @_ROM_id
$0100 $6E02 MOVWF _ANSWARE_DATA+1, 0
;1Wire_Master.c,123 :: bit_temp=(ANSWARE_DATA[byte_index] >> bit_index) & 0b00000001;
$0102 $5015 MOVF interrupt_byte_index_L0, 0, 0
$0104 $2401 ADDWF _ANSWARE_DATA, 0, 0
$0106 $6EE9 MOVWF FSR0L, 0
$0108 $0E00 MOVLW 0
$010A $2002 ADDWFC _ANSWARE_DATA+1, 0, 0
$010C $6EEA MOVWF FSR0L+1, 0
$010E $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$0112 $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$0116 $506B MOVF STACK_0, 0, 0
$0118 $ L_interrupt_55:
$0118 $E004 BZ L_interrupt_56
$011A $3216 RRCF interrupt_bit_temp_L0, 1, 0
$011C $9E16 BCF interrupt_bit_temp_L0, 7, 0
$011E $0FFF ADDLW 255
$0120 $D7FB BRA L_interrupt_55
$0122 $ L_interrupt_56:
$0122 $0E01 MOVLW 1
$0124 $1616 ANDWF interrupt_bit_temp_L0, 1, 0
;1Wire_Master.c,124 :: break;
$0126 $D00F BRA L_interrupt_15
;1Wire_Master.c,126 :: default :
$0128 $ L_interrupt_20:
;1Wire_Master.c,127 :: onewire_state=WAITING_FOR_RESET;
$0128 $6A00 CLRF _onewire_state, 0
;1Wire_Master.c,128 :: break;
$012A $D00D BRA L_interrupt_15
;1Wire_Master.c,129 :: }
$012C $ L_interrupt_14:
$012C $5013 MOVF interrupt_olow_cmd_L0, 0, 0
$012E $0AF0 XORLW 240
$0130 $E0B2 BZ L_interrupt_16
$0132 $5013 MOVF interrupt_olow_cmd_L0, 0, 0
$0134 $0ACC XORLW 204
$0136 $E0C6 BZ L_interrupt_17
$0138 $5013 MOVF interrupt_olow_cmd_L0, 0, 0
$013A $0A55 XORLW 85
$013C $E0C5 BZ L_interrupt_18
$013E $5013 MOVF interrupt_olow_cmd_L0, 0, 0
$0140 $0A33 XORLW 51
$0142 $E0D9 BZ L_interrupt_19
$0144 $D7F1 BRA L_interrupt_20
$0146 $ L_interrupt_15:
;1Wire_Master.c,131 :: }
$0146 $ L_interrupt_13:
;1Wire_Master.c,132 :: }
$0146 $ L_interrupt_7:
;1Wire_Master.c,133 :: break;
$0146 $D0C5 BRA L_interrupt_4
;1Wire_Master.c,134 :: case SEARCH_ROM_BIT :
$0148 $ L_interrupt_21:
;1Wire_Master.c,135 :: if(bit_temp) {
$0148 $5216 MOVF interrupt_bit_temp_L0, 1, 0
$014A $E002 BZ L_interrupt_22
;1Wire_Master.c,136 :: MACRO_OLOW_HI
$014C $8093 BSF TRISB, 0, 0
;1Wire_Master.c,137 :: }
$014E $D002 BRA L_interrupt_23
$0150 $ L_interrupt_22:
;1Wire_Master.c,139 :: MACRO_OLOW_LO
$0150 $9081 BCF PORTB, 0, 0
$0152 $9093 BCF TRISB, 0, 0
;1Wire_Master.c,140 :: }
$0154 $ L_interrupt_23:
;1Wire_Master.c,142 :: delay_us(20);
$0154 $0E42 MOVLW 66
$0156 $6E75 MOVWF STACK_10, 0
$0158 $2E75 DECFSZ STACK_10, F, 0
$015A $D7FE BRA $-1
$015C $0000 NOP
;1Wire_Master.c,143 :: MACRO_OLOW_HI
$015E $8093 BSF TRISB, 0, 0
;1Wire_Master.c,144 :: onewire_state=SEARCH_ROM_CMP_BIT;
$0160 $0E03 MOVLW 3
$0162 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,145 :: break;
$0164 $D0B6 BRA L_interrupt_4
;1Wire_Master.c,147 :: case SEARCH_ROM_CMP_BIT :
$0166 $ L_interrupt_24:
;1Wire_Master.c,148 :: if(!bit_temp) {
$0166 $5216 MOVF interrupt_bit_temp_L0, 1, 0
$0168 $E102 BNZ L_interrupt_25
;1Wire_Master.c,149 :: MACRO_OLOW_HI
$016A $8093 BSF TRISB, 0, 0
;1Wire_Master.c,150 :: }
$016C $D002 BRA L_interrupt_26
$016E $ L_interrupt_25:
;1Wire_Master.c,152 :: MACRO_OLOW_LO
$016E $9081 BCF PORTB, 0, 0
$0170 $9093 BCF TRISB, 0, 0
;1Wire_Master.c,153 :: }
$0172 $ L_interrupt_26:
;1Wire_Master.c,155 :: delay_us(20);
$0172 $0E42 MOVLW 66
$0174 $6E75 MOVWF STACK_10, 0
$0176 $2E75 DECFSZ STACK_10, F, 0
$0178 $D7FE BRA $-1
$017A $0000 NOP
;1Wire_Master.c,156 :: MACRO_OLOW_HI
$017C $8093 BSF TRISB, 0, 0
;1Wire_Master.c,157 :: onewire_state=SEARCH_ROM_READ_BIT;
$017E $0E04 MOVLW 4
$0180 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,158 :: break;
$0182 $D0A7 BRA L_interrupt_4
;1Wire_Master.c,160 :: case SEARCH_ROM_READ_BIT : delay_us(10);
$0184 $ L_interrupt_27:
$0184 $0E21 MOVLW 33
$0186 $6E75 MOVWF STACK_10, 0
$0188 $2E75 DECFSZ STACK_10, F, 0
$018A $D7FE BRA $-1
;1Wire_Master.c,162 :: onewire_state=SEARCH_ROM_BIT;
$018C $0E02 MOVLW 2
$018E $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,164 :: if (PORTB.F0!=bit_temp) {
$0190 $0E01 MOVLW 1
$0192 $1481 ANDWF PORTB, 0, 0
$0194 $6E6C MOVWF STACK_1, 0
$0196 $506C MOVF STACK_1, 0, 0
$0198 $1816 XORWF interrupt_bit_temp_L0, 0, 0
$019A $A4D8 BTFSS STATUS, Z, 0
;1Wire_Master.c,165 :: onewire_state=WAITING_FOR_RESET;
$019C $6A00 CLRF _onewire_state, 0
;1Wire_Master.c,166 :: }
$019E $ L_interrupt_28:
;1Wire_Master.c,168 :: bit_index++;
$019E $2A14 INCF interrupt_bit_index_L0, 1, 0
;1Wire_Master.c,169 :: if (bit_index>7) {
$01A0 $5014 MOVF interrupt_bit_index_L0, 0, 0
$01A2 $0807 SUBLW 7
$01A4 $E202 BC L_interrupt_29
;1Wire_Master.c,170 :: bit_index=0;
$01A6 $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,171 :: byte_index++;
$01A8 $2A15 INCF interrupt_byte_index_L0, 1, 0
;1Wire_Master.c,172 :: }
$01AA $ L_interrupt_29:
;1Wire_Master.c,173 :: if (byte_index>7) {
$01AA $5015 MOVF interrupt_byte_index_L0, 0, 0
$01AC $0807 SUBLW 7
$01AE $E205 BC L_interrupt_30
;1Wire_Master.c,174 :: bit_index=0;
$01B0 $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,175 :: ow_active=1;
$01B2 $8480 BSF PORTA, 2, 0
;1Wire_Master.c,176 :: onewire_state=GET_CMD;
$01B4 $0E01 MOVLW 1
$01B6 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,177 :: }
$01B8 $D014 BRA L_interrupt_31
$01BA $ L_interrupt_30:
;1Wire_Master.c,179 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$01BA $0E0B MOVLW _ROM_id
$01BC $6EE9 MOVWF FSR0L, 0
$01BE $0E00 MOVLW @_ROM_id
$01C0 $6EEA MOVWF FSR0L+1, 0
$01C2 $5015 MOVF interrupt_byte_index_L0, 0, 0
$01C4 $26E9 ADDWF FSR0L, 1, 0
$01C6 $B0D8 BTFSC STATUS, C, 0
$01C8 $2AEA INCF FSR0L+1, 1, 0
$01CA $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$01CE $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$01D2 $506B MOVF STACK_0, 0, 0
$01D4 $ L_interrupt_57:
$01D4 $E004 BZ L_interrupt_58
$01D6 $3216 RRCF interrupt_bit_temp_L0, 1, 0
$01D8 $9E16 BCF interrupt_bit_temp_L0, 7, 0
$01DA $0FFF ADDLW 255
$01DC $D7FB BRA L_interrupt_57
$01DE $ L_interrupt_58:
$01DE $0E01 MOVLW 1
$01E0 $1616 ANDWF interrupt_bit_temp_L0, 1, 0
$01E2 $ L_interrupt_31:
;1Wire_Master.c,181 :: break;
$01E2 $D077 BRA L_interrupt_4
;1Wire_Master.c,183 :: case MATCH_ROM_READ : delay_us(10);
$01E4 $ L_interrupt_32:
$01E4 $0E21 MOVLW 33
$01E6 $6E75 MOVWF STACK_10, 0
$01E8 $2E75 DECFSZ STACK_10, F, 0
$01EA $D7FE BRA $-1
;1Wire_Master.c,185 :: if (PORTB.F0!=bit_temp) {
$01EC $0E01 MOVLW 1
$01EE $1481 ANDWF PORTB, 0, 0
$01F0 $6E6C MOVWF STACK_1, 0
$01F2 $506C MOVF STACK_1, 0, 0
$01F4 $1816 XORWF interrupt_bit_temp_L0, 0, 0
$01F6 $A4D8 BTFSS STATUS, Z, 0
;1Wire_Master.c,186 :: onewire_state=WAITING_FOR_RESET;
$01F8 $6A00 CLRF _onewire_state, 0
;1Wire_Master.c,187 :: }
$01FA $ L_interrupt_33:
;1Wire_Master.c,189 :: bit_index++;
$01FA $2A14 INCF interrupt_bit_index_L0, 1, 0
;1Wire_Master.c,190 :: if (bit_index>7) {
$01FC $5014 MOVF interrupt_bit_index_L0, 0, 0
$01FE $0807 SUBLW 7
$0200 $E202 BC L_interrupt_34
;1Wire_Master.c,191 :: bit_index=0;
$0202 $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,192 :: byte_index++;
$0204 $2A15 INCF interrupt_byte_index_L0, 1, 0
;1Wire_Master.c,193 :: }
$0206 $ L_interrupt_34:
;1Wire_Master.c,194 :: if (byte_index>7) {
$0206 $5015 MOVF interrupt_byte_index_L0, 0, 0
$0208 $0807 SUBLW 7
$020A $E205 BC L_interrupt_35
;1Wire_Master.c,195 :: bit_index=0;
$020C $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,196 :: ow_active=1;
$020E $8480 BSF PORTA, 2, 0
;1Wire_Master.c,197 :: onewire_state=GET_CMD;
$0210 $0E01 MOVLW 1
$0212 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,198 :: }
$0214 $D014 BRA L_interrupt_36
$0216 $ L_interrupt_35:
;1Wire_Master.c,200 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$0216 $0E0B MOVLW _ROM_id
$0218 $6EE9 MOVWF FSR0L, 0
$021A $0E00 MOVLW @_ROM_id
$021C $6EEA MOVWF FSR0L+1, 0
$021E $5015 MOVF interrupt_byte_index_L0, 0, 0
$0220 $26E9 ADDWF FSR0L, 1, 0
$0222 $B0D8 BTFSC STATUS, C, 0
$0224 $2AEA INCF FSR0L+1, 1, 0
$0226 $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$022A $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$022E $506B MOVF STACK_0, 0, 0
$0230 $ L_interrupt_59:
$0230 $E004 BZ L_interrupt_60
$0232 $3216 RRCF interrupt_bit_temp_L0, 1, 0
$0234 $9E16 BCF interrupt_bit_temp_L0, 7, 0
$0236 $0FFF ADDLW 255
$0238 $D7FB BRA L_interrupt_59
$023A $ L_interrupt_60:
$023A $0E01 MOVLW 1
$023C $1616 ANDWF interrupt_bit_temp_L0, 1, 0
$023E $ L_interrupt_36:
;1Wire_Master.c,202 :: break;
$023E $D049 BRA L_interrupt_4
;1Wire_Master.c,204 :: case ANSWARE_REQUEST :
$0240 $ L_interrupt_37:
;1Wire_Master.c,205 :: if(bit_temp) {
$0240 $5216 MOVF interrupt_bit_temp_L0, 1, 0
$0242 $E002 BZ L_interrupt_38
;1Wire_Master.c,206 :: MACRO_OLOW_HI
$0244 $8093 BSF TRISB, 0, 0
;1Wire_Master.c,207 :: }
$0246 $D002 BRA L_interrupt_39
$0248 $ L_interrupt_38:
;1Wire_Master.c,209 :: MACRO_OLOW_LO
$0248 $9081 BCF PORTB, 0, 0
$024A $9093 BCF TRISB, 0, 0
;1Wire_Master.c,210 :: }
$024C $ L_interrupt_39:
;1Wire_Master.c,212 :: delay_us(20);
$024C $0E42 MOVLW 66
$024E $6E75 MOVWF STACK_10, 0
$0250 $2E75 DECFSZ STACK_10, F, 0
$0252 $D7FE BRA $-1
$0254 $0000 NOP
;1Wire_Master.c,213 :: MACRO_OLOW_HI
$0256 $8093 BSF TRISB, 0, 0
;1Wire_Master.c,215 :: bit_index++;
$0258 $2A14 INCF interrupt_bit_index_L0, 1, 0
;1Wire_Master.c,216 :: if (bit_index>7) {
$025A $5014 MOVF interrupt_bit_index_L0, 0, 0
$025C $0807 SUBLW 7
$025E $E202 BC L_interrupt_40
;1Wire_Master.c,217 :: bit_index=0;
$0260 $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,218 :: byte_index++;
$0262 $2A15 INCF interrupt_byte_index_L0, 1, 0
;1Wire_Master.c,219 :: }
$0264 $ L_interrupt_40:
;1Wire_Master.c,220 :: if (byte_index>7) {
$0264 $5015 MOVF interrupt_byte_index_L0, 0, 0
$0266 $0807 SUBLW 7
$0268 $E205 BC L_interrupt_41
;1Wire_Master.c,221 :: bit_index=0;
$026A $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,222 :: ow_active=1;
$026C $8480 BSF PORTA, 2, 0
;1Wire_Master.c,223 :: onewire_state=GET_CMD;
$026E $0E01 MOVLW 1
$0270 $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,224 :: }
$0272 $D012 BRA L_interrupt_42
$0274 $ L_interrupt_41:
;1Wire_Master.c,226 :: bit_temp=(ANSWARE_DATA[byte_index] >> bit_index) & 0b00000001;
$0274 $5015 MOVF interrupt_byte_index_L0, 0, 0
$0276 $2401 ADDWF _ANSWARE_DATA, 0, 0
$0278 $6EE9 MOVWF FSR0L, 0
$027A $0E00 MOVLW 0
$027C $2002 ADDWFC _ANSWARE_DATA+1, 0, 0
$027E $6EEA MOVWF FSR0L+1, 0
$0280 $CFEE F016 MOVFF POSTINC0, interrupt_bit_temp_L0
$0284 $C014 F06B MOVFF interrupt_bit_index_L0, STACK_0
$0288 $506B MOVF STACK_0, 0, 0
$028A $ L_interrupt_61:
$028A $E004 BZ L_interrupt_62
$028C $3216 RRCF interrupt_bit_temp_L0, 1, 0
$028E $9E16 BCF interrupt_bit_temp_L0, 7, 0
$0290 $0FFF ADDLW 255
$0292 $D7FB BRA L_interrupt_61
$0294 $ L_interrupt_62:
$0294 $0E01 MOVLW 1
$0296 $1616 ANDWF interrupt_bit_temp_L0, 1, 0
$0298 $ L_interrupt_42:
;1Wire_Master.c,229 :: break;
$0298 $D01C BRA L_interrupt_4
;1Wire_Master.c,232 :: case WAITING_FOR_RESET :
$029A $ L_interrupt_43:
;1Wire_Master.c,233 :: break;
$029A $D01B BRA L_interrupt_4
;1Wire_Master.c,235 :: default : break;
$029C $ L_interrupt_44:
$029C $D01A BRA L_interrupt_4
;1Wire_Master.c,236 :: }
$029E $ L_interrupt_3:
$029E $5000 MOVF _onewire_state, 0, 0
$02A0 $0A01 XORLW 1
$02A2 $B4D8 BTFSC STATUS, Z, 0
$02A4 $D6C4 BRA L_interrupt_5
$02A6 $5000 MOVF _onewire_state, 0, 0
$02A8 $0A02 XORLW 2
$02AA $B4D8 BTFSC STATUS, Z, 0
$02AC $D74D BRA L_interrupt_21
$02AE $5000 MOVF _onewire_state, 0, 0
$02B0 $0A03 XORLW 3
$02B2 $B4D8 BTFSC STATUS, Z, 0
$02B4 $D758 BRA L_interrupt_24
$02B6 $5000 MOVF _onewire_state, 0, 0
$02B8 $0A04 XORLW 4
$02BA $B4D8 BTFSC STATUS, Z, 0
$02BC $D763 BRA L_interrupt_27
$02BE $5000 MOVF _onewire_state, 0, 0
$02C0 $0A05 XORLW 5
$02C2 $E090 BZ L_interrupt_32
$02C4 $5000 MOVF _onewire_state, 0, 0
$02C6 $0A06 XORLW 6
$02C8 $E0BB BZ L_interrupt_37
$02CA $5000 MOVF _onewire_state, 0, 0
$02CC $0A00 XORLW 0
$02CE $E0E5 BZ L_interrupt_43
$02D0 $D7E5 BRA L_interrupt_44
$02D2 $ L_interrupt_4:
;1Wire_Master.c,237 :: TMR0L=0;
$02D2 $6AD6 CLRF TMR0L, 0
;1Wire_Master.c,239 :: INTCON.INT0F=0;
$02D4 $92F2 BCF INTCON, 1, 0
;1Wire_Master.c,240 :: INTCON.INT0E=1;
$02D6 $88F2 BSF INTCON, 4, 0
;1Wire_Master.c,241 :: }
$02D8 $ L_interrupt_2:
;1Wire_Master.c,243 :: if (INTCON.T0IF) {
$02D8 $A4F2 BTFSS INTCON, 2, 0
$02DA $D022 BRA L_interrupt_45
;1Wire_Master.c,245 :: if (!PORTB.F0) {
$02DC $B081 BTFSC PORTB, 0, 0
$02DE $D01F BRA L_interrupt_46
;1Wire_Master.c,246 :: while(!PORTB.F0){}
$02E0 $ L_interrupt_47:
$02E0 $A081 BTFSS PORTB, 0, 0
$02E2 $D7FE BRA L_interrupt_47
$02E4 $ L_interrupt_48:
;1Wire_Master.c,247 :: delay_us(14);
$02E4 $0E2E MOVLW 46
$02E6 $6E75 MOVWF STACK_10, 0
$02E8 $2E75 DECFSZ STACK_10, F, 0
$02EA $D7FE BRA $-1
$02EC $0000 NOP
;1Wire_Master.c,248 :: MACRO_OLOW_LO
$02EE $9081 BCF PORTB, 0, 0
$02F0 $9093 BCF TRISB, 0, 0
;1Wire_Master.c,249 :: delay_us(103);
$02F2 $0E02 MOVLW 2
$02F4 $6E76 MOVWF STACK_11, 0
$02F6 $0EFF MOVLW 255
$02F8 $6E75 MOVWF STACK_10, 0
$02FA $2E76 DECFSZ STACK_11, F, 0
$02FC $D001 BRA $+2
$02FE $D003 BRA $+4
$0300 $2E75 DECFSZ STACK_10, F, 0
$0302 $D7FE BRA $-1
$0304 $D7FA BRA $-5
$0306 $0E53 MOVLW 83
$0308 $6E75 MOVWF STACK_10, 0
$030A $2E75 DECFSZ STACK_10, F, 0
$030C $D7FE BRA $-1
;1Wire_Master.c,250 :: MACRO_OLOW_HI
$030E $8093 BSF TRISB, 0, 0
;1Wire_Master.c,251 :: bit_index=0;
$0310 $6A14 CLRF interrupt_bit_index_L0, 0
;1Wire_Master.c,252 :: TRISB.F0=1; // Ska vara OLOW_DIR=1;
$0312 $8093 BSF TRISB, 0, 0
;1Wire_Master.c,253 :: TRISA.F0=0; //För debugging
$0314 $9092 BCF TRISA, 0, 0
;1Wire_Master.c,254 :: INTCON.INT0F=0;
$0316 $92F2 BCF INTCON, 1, 0
;1Wire_Master.c,255 :: ow_active=0;
$0318 $9480 BCF PORTA, 2, 0
;1Wire_Master.c,256 :: onewire_state=GET_CMD;
$031A $0E01 MOVLW 1
$031C $6E00 MOVWF _onewire_state, 0
;1Wire_Master.c,257 :: }
$031E $ L_interrupt_46:
;1Wire_Master.c,259 :: INTCON.T0IF=0;
$031E $94F2 BCF INTCON, 2, 0
;1Wire_Master.c,260 :: }
$0320 $ L_interrupt_45:
;1Wire_Master.c,262 :: }
$0320 $ L_Interrupt_end:
$0320 $C017 FFE9 MOVFF ?saveFSR0, FSR0L
$0324 $C018 FFEA MOVFF ?saveFSR0+1, FSR0H
$0328 $C019 FFE1 MOVFF ?saveFSR1, FSR1L
$032C $C01A FFE2 MOVFF ?saveFSR1+1, FSR1H
$0330 $C02D F076 MOVFF STSAVED_11, STACK_11
$0334 $C02C F075 MOVFF STSAVED_10, STACK_10
$0338 $C02B F06C MOVFF STSAVED_1, STACK_1
$033C $C02A F06B MOVFF STSAVED_0, STACK_0
$0340 $0011 RETFIE
-------------------------------------------------------------------------------
$07B0 $ _main:
;1Wire_Master.c,48 :: void main() {
;1Wire_Master.c,50 :: init();
$07B0 $EC96 F002 CALL _init
;1Wire_Master.c,52 :: ow_get_id(&ROM_id,OW_PORT,OW_PIN);
$07B4 $0E0B MOVLW _ROM_id
$07B6 $6E1B MOVWF FARG_ow_get_id+0, 0
$07B8 $0E00 MOVLW @_ROM_id
$07BA $6E1C MOVWF FARG_ow_get_id+1, 0
$07BC $0E80 MOVLW PORTA
$07BE $6E1D MOVWF FARG_ow_get_id+2, 0
$07C0 $0E0F MOVLW @PORTA
$07C2 $6E1E MOVWF FARG_ow_get_id+3, 0
$07C4 $0E01 MOVLW 1
$07C6 $6E1F MOVWF FARG_ow_get_id+4, 0
$07C8 $ECA0 F002 CALL _ow_get_id
;1Wire_Master.c,53 :: ow_get_ds18b20_data(&SCRATCHPAD,OW_PORT,OW_PIN);
$07CC $0E03 MOVLW _SCRATCHPAD
$07CE $6E1B MOVWF FARG_ow_get_ds18b20_data+0, 0
$07D0 $0E00 MOVLW @_SCRATCHPAD
$07D2 $6E1C MOVWF FARG_ow_get_ds18b20_data+1, 0
$07D4 $0E80 MOVLW PORTA
$07D6 $6E1D MOVWF FARG_ow_get_ds18b20_data+2, 0
$07D8 $0E0F MOVLW @PORTA
$07DA $6E1E MOVWF FARG_ow_get_ds18b20_data+3, 0
$07DC $0E01 MOVLW 1
$07DE $6E1F MOVWF FARG_ow_get_ds18b20_data+4, 0
$07E0 $ECD3 F002 CALL _ow_get_ds18b20_data
;1Wire_Master.c,55 :: onewire_state=WAITING_FOR_RESET;
$07E4 $6A00 CLRF _onewire_state, 0
;1Wire_Master.c,57 :: while(1) {}
$07E6 $ L_main_0:
$07E6 $D7FF BRA L_main_0
;1Wire_Master.c,59 :: }
$07E8 $D7FF BRA $