När man läser manualen så låter det som att den gör bara det nödvändigaste. Så allt mjukvarustackande är nödvändigt. På PIC16 sparar den undan W, STATUS, FSR och PCLATH.
Jag kan tänka mig att det är möjligheten att man kan anropa funktioner från interruptet som gör att den måste ha lite extra kod.
Men om nu kompilatorn är så effektiv. Varför skulle ni i så fall prata om att skriva allt i ASM i stället.
Så vi tar oss en titt på koden som MikroC har genererat. Hur mycket fuffens verkar den ha för sig?
Kod: Markera allt
; ASM code generated by mikroVirtualMachine for PIC - V. 6.2.1.0
; Date/Time: 2007-04-19 08:24:27
; Info: http://www.mikroelektronika.co.yu
; ADDRESS OPCODE ASM
; ----------------------------------------------
$0000 $2B72 GOTO _main
$0004 $ _interrupt:
$0004 $00FF MOVWF STACK_15
$0005 $0E03 SWAPF STATUS, 0
$0006 $0183 CLRF STATUS
$0007 $00B7 MOVWF ?saveSTATUS
$0008 $0804 MOVF FSR, 0
$0009 $00B6 MOVWF ?saveFSR
$000A $080A MOVF PCLATH, 0
$000B $00B8 MOVWF ?savePCLATH
$000C $018A CLRF PCLATH
$000D $087A MOVF STACK_10, 0
$000E $00C7 MOVWF STSAVED_10
$000F $0871 MOVF STACK_1, 0
$0010 $00C6 MOVWF STSAVED_1
$0011 $0870 MOVF STACK_0, 0
$0012 $00C5 MOVWF STSAVED_0
;1Wire_Master.c,62 :: void interrupt() {
;1Wire_Master.c,70 :: if (INTCON.INTF) {
$0013 $1C8B BTFSS INTCON, 1
$0014 $2977 GOTO L_interrupt_2
;1Wire_Master.c,72 :: switch (onewire_state) {
$0015 $2955 GOTO L_interrupt_3
;1Wire_Master.c,74 :: case GET_CMD : TRISB.F0=1;
$0016 $ L_interrupt_5:
$0016 $1303 BCF STATUS, RP1
$0017 $1683 BSF STATUS, RP0
$0018 $1683 BSF STATUS, RP0
$0019 $1406 BSF TRISB, 0
;1Wire_Master.c,75 :: olow_cmd >>= 1;
$001A $1283 BCF STATUS, RP0
$001B $0CB2 RRF interrupt_olow_cmd_L0, 1
$001C $13B2 BCF interrupt_olow_cmd_L0, 7
;1Wire_Master.c,76 :: delay_us(10);
$001D $3010 MOVLW 16
$001E $00FA MOVWF STACK_10
$001F $0BFA DECFSZ STACK_10, F
$0020 $281F GOTO $-1
$0021 $0000 NOP
;1Wire_Master.c,77 :: if(PORTB.F0)
$0022 $1C06 BTFSS PORTB, 0
$0023 $2825 GOTO L_interrupt_6
;1Wire_Master.c,78 :: olow_cmd |= 0x80;
$0024 $17B2 BSF interrupt_olow_cmd_L0, 7
$0025 $ L_interrupt_6:
;1Wire_Master.c,79 :: bit_index++;
$0025 $0AB3 INCF interrupt_bit_index_L0, 1
;1Wire_Master.c,81 :: if (bit_index > 7) {
$0026 $0833 MOVF interrupt_bit_index_L0, 0
$0027 $3C07 SUBLW 7
$0028 $1803 BTFSC STATUS, C
$0029 $289D GOTO L_interrupt_7
;1Wire_Master.c,83 :: byte_index=0;
$002A $01B4 CLRF interrupt_byte_index_L0, 1
;1Wire_Master.c,84 :: bit_index=0;
$002B $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,86 :: if (ow_active) {
$002C $1D05 BTFSS PORTA, 2
$002D $284C GOTO L_interrupt_8
;1Wire_Master.c,88 :: switch (olow_cmd) {
$002E $2846 GOTO L_interrupt_9
;1Wire_Master.c,90 :: case READ_SCRATCHPAD :
$002F $ L_interrupt_11:
;1Wire_Master.c,91 :: onewire_state=ANSWARE_REQUEST;
$002F $3006 MOVLW 6
$0030 $00A0 MOVWF _onewire_state
;1Wire_Master.c,92 :: ANSWARE_DATA=SCRATCHPAD;
$0031 $3022 MOVLW _SCRATCHPAD
$0032 $00A1 MOVWF _ANSWARE_DATA
;1Wire_Master.c,93 :: bit_temp=(ANSWARE_DATA[byte_index] >> bit_index) & 0b00000001;
$0033 $0834 MOVF interrupt_byte_index_L0, 0
$0034 $0721 ADDWF _ANSWARE_DATA, 0
$0035 $0084 MOVWF FSR
$0036 $0800 MOVF INDF, 0
$0037 $00B5 MOVWF interrupt_bit_temp_L0
$0038 $0833 MOVF interrupt_bit_index_L0, 0
$0039 $00F0 MOVWF STACK_0
$003A $0870 MOVF STACK_0, 0
$003B $ L_interrupt_49:
$003B $1903 BTFSC STATUS, Z
$003C $2841 GOTO L_interrupt_50
$003D $0CB5 RRF interrupt_bit_temp_L0, 1
$003E $13B5 BCF interrupt_bit_temp_L0, 7
$003F $3FFF ADDLW 255
$0040 $283B GOTO L_interrupt_49
$0041 $ L_interrupt_50:
$0041 $3001 MOVLW 1
$0042 $05B5 ANDWF interrupt_bit_temp_L0, 1
;1Wire_Master.c,94 :: break;
$0043 $284B GOTO L_interrupt_10
;1Wire_Master.c,96 :: default :
$0044 $ L_interrupt_12:
;1Wire_Master.c,97 :: onewire_state=WAITING_FOR_RESET;
$0044 $01A0 CLRF _onewire_state, 1
;1Wire_Master.c,98 :: break;
$0045 $284B GOTO L_interrupt_10
;1Wire_Master.c,99 :: }
$0046 $ L_interrupt_9:
$0046 $0832 MOVF interrupt_olow_cmd_L0, 0
$0047 $3ABE XORLW 190
$0048 $1903 BTFSC STATUS, Z
$0049 $282F GOTO L_interrupt_11
$004A $2844 GOTO L_interrupt_12
$004B $ L_interrupt_10:
;1Wire_Master.c,100 :: }
$004B $289D GOTO L_interrupt_13
$004C $ L_interrupt_8:
;1Wire_Master.c,103 :: switch (olow_cmd) {
$004C $288C GOTO L_interrupt_14
;1Wire_Master.c,105 :: case SEARCH_ROM :
$004D $ L_interrupt_16:
;1Wire_Master.c,106 :: onewire_state=SEARCH_ROM_BIT;
$004D $3002 MOVLW 2
$004E $00A0 MOVWF _onewire_state
;1Wire_Master.c,107 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$004F $0834 MOVF interrupt_byte_index_L0, 0
$0050 $3F2A ADDLW _ROM_id
$0051 $0084 MOVWF FSR
$0052 $0800 MOVF INDF, 0
$0053 $00B5 MOVWF interrupt_bit_temp_L0
$0054 $0833 MOVF interrupt_bit_index_L0, 0
$0055 $00F0 MOVWF STACK_0
$0056 $0870 MOVF STACK_0, 0
$0057 $ L_interrupt_51:
$0057 $1903 BTFSC STATUS, Z
$0058 $285D GOTO L_interrupt_52
$0059 $0CB5 RRF interrupt_bit_temp_L0, 1
$005A $13B5 BCF interrupt_bit_temp_L0, 7
$005B $3FFF ADDLW 255
$005C $2857 GOTO L_interrupt_51
$005D $ L_interrupt_52:
$005D $3001 MOVLW 1
$005E $05B5 ANDWF interrupt_bit_temp_L0, 1
;1Wire_Master.c,108 :: break;
$005F $289D GOTO L_interrupt_15
;1Wire_Master.c,110 :: case SKIP_ROM :
$0060 $ L_interrupt_17:
;1Wire_Master.c,111 :: ow_active=1;
$0060 $1505 BSF PORTA, 2
;1Wire_Master.c,112 :: break;
$0061 $289D GOTO L_interrupt_15
;1Wire_Master.c,114 :: case MATCH_ROM :
$0062 $ L_interrupt_18:
;1Wire_Master.c,115 :: onewire_state=MATCH_ROM_READ;
$0062 $3005 MOVLW 5
$0063 $00A0 MOVWF _onewire_state
;1Wire_Master.c,116 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$0064 $0834 MOVF interrupt_byte_index_L0, 0
$0065 $3F2A ADDLW _ROM_id
$0066 $0084 MOVWF FSR
$0067 $0800 MOVF INDF, 0
$0068 $00B5 MOVWF interrupt_bit_temp_L0
$0069 $0833 MOVF interrupt_bit_index_L0, 0
$006A $00F0 MOVWF STACK_0
$006B $0870 MOVF STACK_0, 0
$006C $ L_interrupt_53:
$006C $1903 BTFSC STATUS, Z
$006D $2872 GOTO L_interrupt_54
$006E $0CB5 RRF interrupt_bit_temp_L0, 1
$006F $13B5 BCF interrupt_bit_temp_L0, 7
$0070 $3FFF ADDLW 255
$0071 $286C GOTO L_interrupt_53
$0072 $ L_interrupt_54:
$0072 $3001 MOVLW 1
$0073 $05B5 ANDWF interrupt_bit_temp_L0, 1
;1Wire_Master.c,117 :: break;
$0074 $289D GOTO L_interrupt_15
;1Wire_Master.c,120 :: case READ_ROM :
$0075 $ L_interrupt_19:
;1Wire_Master.c,121 :: onewire_state=ANSWARE_REQUEST;
$0075 $3006 MOVLW 6
$0076 $00A0 MOVWF _onewire_state
;1Wire_Master.c,122 :: ANSWARE_DATA=ROM_id;
$0077 $302A MOVLW _ROM_id
$0078 $00A1 MOVWF _ANSWARE_DATA
;1Wire_Master.c,123 :: bit_temp=(ANSWARE_DATA[byte_index] >> bit_index) & 0b00000001;
$0079 $0834 MOVF interrupt_byte_index_L0, 0
$007A $0721 ADDWF _ANSWARE_DATA, 0
$007B $0084 MOVWF FSR
$007C $0800 MOVF INDF, 0
$007D $00B5 MOVWF interrupt_bit_temp_L0
$007E $0833 MOVF interrupt_bit_index_L0, 0
$007F $00F0 MOVWF STACK_0
$0080 $0870 MOVF STACK_0, 0
$0081 $ L_interrupt_55:
$0081 $1903 BTFSC STATUS, Z
$0082 $2887 GOTO L_interrupt_56
$0083 $0CB5 RRF interrupt_bit_temp_L0, 1
$0084 $13B5 BCF interrupt_bit_temp_L0, 7
$0085 $3FFF ADDLW 255
$0086 $2881 GOTO L_interrupt_55
$0087 $ L_interrupt_56:
$0087 $3001 MOVLW 1
$0088 $05B5 ANDWF interrupt_bit_temp_L0, 1
;1Wire_Master.c,124 :: break;
$0089 $289D GOTO L_interrupt_15
;1Wire_Master.c,126 :: default :
$008A $ L_interrupt_20:
;1Wire_Master.c,127 :: onewire_state=WAITING_FOR_RESET;
$008A $01A0 CLRF _onewire_state, 1
;1Wire_Master.c,128 :: break;
$008B $289D GOTO L_interrupt_15
;1Wire_Master.c,129 :: }
$008C $ L_interrupt_14:
$008C $0832 MOVF interrupt_olow_cmd_L0, 0
$008D $3AF0 XORLW 240
$008E $1903 BTFSC STATUS, Z
$008F $284D GOTO L_interrupt_16
$0090 $0832 MOVF interrupt_olow_cmd_L0, 0
$0091 $3ACC XORLW 204
$0092 $1903 BTFSC STATUS, Z
$0093 $2860 GOTO L_interrupt_17
$0094 $0832 MOVF interrupt_olow_cmd_L0, 0
$0095 $3A55 XORLW 85
$0096 $1903 BTFSC STATUS, Z
$0097 $2862 GOTO L_interrupt_18
$0098 $0832 MOVF interrupt_olow_cmd_L0, 0
$0099 $3A33 XORLW 51
$009A $1903 BTFSC STATUS, Z
$009B $2875 GOTO L_interrupt_19
$009C $288A GOTO L_interrupt_20
$009D $ L_interrupt_15:
;1Wire_Master.c,131 :: }
$009D $ L_interrupt_13:
;1Wire_Master.c,132 :: }
$009D $ L_interrupt_7:
;1Wire_Master.c,133 :: break;
$009D $2974 GOTO L_interrupt_4
;1Wire_Master.c,134 :: case SEARCH_ROM_BIT :
$009E $ L_interrupt_21:
;1Wire_Master.c,135 :: if(bit_temp) {
$009E $0835 MOVF interrupt_bit_temp_L0, 0
$009F $1903 BTFSC STATUS, Z
$00A0 $28A4 GOTO L_interrupt_22
;1Wire_Master.c,136 :: MACRO_OLOW_HI
$00A1 $1683 BSF STATUS, RP0
$00A2 $1406 BSF TRISB, 0
;1Wire_Master.c,137 :: }
$00A3 $28A8 GOTO L_interrupt_23
$00A4 $ L_interrupt_22:
;1Wire_Master.c,139 :: MACRO_OLOW_LO
$00A4 $1283 BCF STATUS, RP0
$00A5 $1006 BCF PORTB, 0
$00A6 $1683 BSF STATUS, RP0
$00A7 $1006 BCF TRISB, 0
;1Wire_Master.c,140 :: }
$00A8 $ L_interrupt_23:
;1Wire_Master.c,142 :: delay_us(20);
$00A8 $3021 MOVLW 33
$00A9 $00FA MOVWF STACK_10
$00AA $0BFA DECFSZ STACK_10, F
$00AB $28AA GOTO $-1
;1Wire_Master.c,143 :: MACRO_OLOW_HI
$00AC $1406 BSF TRISB, 0
;1Wire_Master.c,144 :: onewire_state=SEARCH_ROM_CMP_BIT;
$00AD $3003 MOVLW 3
$00AE $1283 BCF STATUS, RP0
$00AF $00A0 MOVWF _onewire_state
;1Wire_Master.c,145 :: break;
$00B0 $2974 GOTO L_interrupt_4
;1Wire_Master.c,147 :: case SEARCH_ROM_CMP_BIT :
$00B1 $ L_interrupt_24:
;1Wire_Master.c,148 :: if(!bit_temp) {
$00B1 $0835 MOVF interrupt_bit_temp_L0, 0
$00B2 $1D03 BTFSS STATUS, Z
$00B3 $28B7 GOTO L_interrupt_25
;1Wire_Master.c,149 :: MACRO_OLOW_HI
$00B4 $1683 BSF STATUS, RP0
$00B5 $1406 BSF TRISB, 0
;1Wire_Master.c,150 :: }
$00B6 $28BB GOTO L_interrupt_26
$00B7 $ L_interrupt_25:
;1Wire_Master.c,152 :: MACRO_OLOW_LO
$00B7 $1283 BCF STATUS, RP0
$00B8 $1006 BCF PORTB, 0
$00B9 $1683 BSF STATUS, RP0
$00BA $1006 BCF TRISB, 0
;1Wire_Master.c,153 :: }
$00BB $ L_interrupt_26:
;1Wire_Master.c,155 :: delay_us(20);
$00BB $3021 MOVLW 33
$00BC $00FA MOVWF STACK_10
$00BD $0BFA DECFSZ STACK_10, F
$00BE $28BD GOTO $-1
;1Wire_Master.c,156 :: MACRO_OLOW_HI
$00BF $1406 BSF TRISB, 0
;1Wire_Master.c,157 :: onewire_state=SEARCH_ROM_READ_BIT;
$00C0 $3004 MOVLW 4
$00C1 $1283 BCF STATUS, RP0
$00C2 $00A0 MOVWF _onewire_state
;1Wire_Master.c,158 :: break;
$00C3 $2974 GOTO L_interrupt_4
;1Wire_Master.c,160 :: case SEARCH_ROM_READ_BIT : delay_us(10);
$00C4 $ L_interrupt_27:
$00C4 $3010 MOVLW 16
$00C5 $00FA MOVWF STACK_10
$00C6 $0BFA DECFSZ STACK_10, F
$00C7 $28C6 GOTO $-1
$00C8 $0000 NOP
;1Wire_Master.c,162 :: onewire_state=SEARCH_ROM_BIT;
$00C9 $3002 MOVLW 2
$00CA $00A0 MOVWF _onewire_state
;1Wire_Master.c,164 :: if (PORTB.F0!=bit_temp) {
$00CB $3001 MOVLW 1
$00CC $0506 ANDWF PORTB, 0
$00CD $00F1 MOVWF STACK_1
$00CE $0871 MOVF STACK_1, 0
$00CF $0635 XORWF interrupt_bit_temp_L0, 0
$00D0 $1903 BTFSC STATUS, Z
$00D1 $28D3 GOTO L_interrupt_28
;1Wire_Master.c,165 :: onewire_state=WAITING_FOR_RESET;
$00D2 $01A0 CLRF _onewire_state, 1
;1Wire_Master.c,166 :: }
$00D3 $ L_interrupt_28:
;1Wire_Master.c,168 :: bit_index++;
$00D3 $0AB3 INCF interrupt_bit_index_L0, 1
;1Wire_Master.c,169 :: if (bit_index>7) {
$00D4 $0833 MOVF interrupt_bit_index_L0, 0
$00D5 $3C07 SUBLW 7
$00D6 $1803 BTFSC STATUS, C
$00D7 $28DA GOTO L_interrupt_29
;1Wire_Master.c,170 :: bit_index=0;
$00D8 $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,171 :: byte_index++;
$00D9 $0AB4 INCF interrupt_byte_index_L0, 1
;1Wire_Master.c,172 :: }
$00DA $ L_interrupt_29:
;1Wire_Master.c,173 :: if (byte_index>7) {
$00DA $0834 MOVF interrupt_byte_index_L0, 0
$00DB $3C07 SUBLW 7
$00DC $1803 BTFSC STATUS, C
$00DD $28E3 GOTO L_interrupt_30
;1Wire_Master.c,174 :: bit_index=0;
$00DE $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,175 :: ow_active=1;
$00DF $1505 BSF PORTA, 2
;1Wire_Master.c,176 :: onewire_state=GET_CMD;
$00E0 $3001 MOVLW 1
$00E1 $00A0 MOVWF _onewire_state
;1Wire_Master.c,177 :: }
$00E2 $28F3 GOTO L_interrupt_31
$00E3 $ L_interrupt_30:
;1Wire_Master.c,179 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$00E3 $0834 MOVF interrupt_byte_index_L0, 0
$00E4 $3F2A ADDLW _ROM_id
$00E5 $0084 MOVWF FSR
$00E6 $0800 MOVF INDF, 0
$00E7 $00B5 MOVWF interrupt_bit_temp_L0
$00E8 $0833 MOVF interrupt_bit_index_L0, 0
$00E9 $00F0 MOVWF STACK_0
$00EA $0870 MOVF STACK_0, 0
$00EB $ L_interrupt_57:
$00EB $1903 BTFSC STATUS, Z
$00EC $28F1 GOTO L_interrupt_58
$00ED $0CB5 RRF interrupt_bit_temp_L0, 1
$00EE $13B5 BCF interrupt_bit_temp_L0, 7
$00EF $3FFF ADDLW 255
$00F0 $28EB GOTO L_interrupt_57
$00F1 $ L_interrupt_58:
$00F1 $3001 MOVLW 1
$00F2 $05B5 ANDWF interrupt_bit_temp_L0, 1
$00F3 $ L_interrupt_31:
;1Wire_Master.c,181 :: break;
$00F3 $2974 GOTO L_interrupt_4
;1Wire_Master.c,183 :: case MATCH_ROM_READ : delay_us(10);
$00F4 $ L_interrupt_32:
$00F4 $3010 MOVLW 16
$00F5 $00FA MOVWF STACK_10
$00F6 $0BFA DECFSZ STACK_10, F
$00F7 $28F6 GOTO $-1
$00F8 $0000 NOP
;1Wire_Master.c,185 :: if (PORTB.F0!=bit_temp) {
$00F9 $3001 MOVLW 1
$00FA $0506 ANDWF PORTB, 0
$00FB $00F1 MOVWF STACK_1
$00FC $0871 MOVF STACK_1, 0
$00FD $0635 XORWF interrupt_bit_temp_L0, 0
$00FE $1903 BTFSC STATUS, Z
$00FF $2901 GOTO L_interrupt_33
;1Wire_Master.c,186 :: onewire_state=WAITING_FOR_RESET;
$0100 $01A0 CLRF _onewire_state, 1
;1Wire_Master.c,187 :: }
$0101 $ L_interrupt_33:
;1Wire_Master.c,189 :: bit_index++;
$0101 $0AB3 INCF interrupt_bit_index_L0, 1
;1Wire_Master.c,190 :: if (bit_index>7) {
$0102 $0833 MOVF interrupt_bit_index_L0, 0
$0103 $3C07 SUBLW 7
$0104 $1803 BTFSC STATUS, C
$0105 $2908 GOTO L_interrupt_34
;1Wire_Master.c,191 :: bit_index=0;
$0106 $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,192 :: byte_index++;
$0107 $0AB4 INCF interrupt_byte_index_L0, 1
;1Wire_Master.c,193 :: }
$0108 $ L_interrupt_34:
;1Wire_Master.c,194 :: if (byte_index>7) {
$0108 $0834 MOVF interrupt_byte_index_L0, 0
$0109 $3C07 SUBLW 7
$010A $1803 BTFSC STATUS, C
$010B $2911 GOTO L_interrupt_35
;1Wire_Master.c,195 :: bit_index=0;
$010C $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,196 :: ow_active=1;
$010D $1505 BSF PORTA, 2
;1Wire_Master.c,197 :: onewire_state=GET_CMD;
$010E $3001 MOVLW 1
$010F $00A0 MOVWF _onewire_state
;1Wire_Master.c,198 :: }
$0110 $2921 GOTO L_interrupt_36
$0111 $ L_interrupt_35:
;1Wire_Master.c,200 :: bit_temp=(ROM_id[byte_index] >> bit_index) & 0b00000001;
$0111 $0834 MOVF interrupt_byte_index_L0, 0
$0112 $3F2A ADDLW _ROM_id
$0113 $0084 MOVWF FSR
$0114 $0800 MOVF INDF, 0
$0115 $00B5 MOVWF interrupt_bit_temp_L0
$0116 $0833 MOVF interrupt_bit_index_L0, 0
$0117 $00F0 MOVWF STACK_0
$0118 $0870 MOVF STACK_0, 0
$0119 $ L_interrupt_59:
$0119 $1903 BTFSC STATUS, Z
$011A $291F GOTO L_interrupt_60
$011B $0CB5 RRF interrupt_bit_temp_L0, 1
$011C $13B5 BCF interrupt_bit_temp_L0, 7
$011D $3FFF ADDLW 255
$011E $2919 GOTO L_interrupt_59
$011F $ L_interrupt_60:
$011F $3001 MOVLW 1
$0120 $05B5 ANDWF interrupt_bit_temp_L0, 1
$0121 $ L_interrupt_36:
;1Wire_Master.c,202 :: break;
$0121 $2974 GOTO L_interrupt_4
;1Wire_Master.c,204 :: case ANSWARE_REQUEST :
$0122 $ L_interrupt_37:
;1Wire_Master.c,205 :: if(bit_temp) {
$0122 $0835 MOVF interrupt_bit_temp_L0, 0
$0123 $1903 BTFSC STATUS, Z
$0124 $2928 GOTO L_interrupt_38
;1Wire_Master.c,206 :: MACRO_OLOW_HI
$0125 $1683 BSF STATUS, RP0
$0126 $1406 BSF TRISB, 0
;1Wire_Master.c,207 :: }
$0127 $292C GOTO L_interrupt_39
$0128 $ L_interrupt_38:
;1Wire_Master.c,209 :: MACRO_OLOW_LO
$0128 $1283 BCF STATUS, RP0
$0129 $1006 BCF PORTB, 0
$012A $1683 BSF STATUS, RP0
$012B $1006 BCF TRISB, 0
;1Wire_Master.c,210 :: }
$012C $ L_interrupt_39:
;1Wire_Master.c,212 :: delay_us(20);
$012C $3021 MOVLW 33
$012D $00FA MOVWF STACK_10
$012E $0BFA DECFSZ STACK_10, F
$012F $292E GOTO $-1
;1Wire_Master.c,213 :: MACRO_OLOW_HI
$0130 $1406 BSF TRISB, 0
;1Wire_Master.c,215 :: bit_index++;
$0131 $1283 BCF STATUS, RP0
$0132 $0AB3 INCF interrupt_bit_index_L0, 1
;1Wire_Master.c,216 :: if (bit_index>7) {
$0133 $0833 MOVF interrupt_bit_index_L0, 0
$0134 $3C07 SUBLW 7
$0135 $1803 BTFSC STATUS, C
$0136 $2939 GOTO L_interrupt_40
;1Wire_Master.c,217 :: bit_index=0;
$0137 $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,218 :: byte_index++;
$0138 $0AB4 INCF interrupt_byte_index_L0, 1
;1Wire_Master.c,219 :: }
$0139 $ L_interrupt_40:
;1Wire_Master.c,220 :: if (byte_index>7) {
$0139 $0834 MOVF interrupt_byte_index_L0, 0
$013A $3C07 SUBLW 7
$013B $1803 BTFSC STATUS, C
$013C $2942 GOTO L_interrupt_41
;1Wire_Master.c,221 :: bit_index=0;
$013D $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,222 :: ow_active=1;
$013E $1505 BSF PORTA, 2
;1Wire_Master.c,223 :: onewire_state=GET_CMD;
$013F $3001 MOVLW 1
$0140 $00A0 MOVWF _onewire_state
;1Wire_Master.c,224 :: }
$0141 $2952 GOTO L_interrupt_42
$0142 $ L_interrupt_41:
;1Wire_Master.c,226 :: bit_temp=(ANSWARE_DATA[byte_index] >> bit_index) & 0b00000001;
$0142 $0834 MOVF interrupt_byte_index_L0, 0
$0143 $0721 ADDWF _ANSWARE_DATA, 0
$0144 $0084 MOVWF FSR
$0145 $0800 MOVF INDF, 0
$0146 $00B5 MOVWF interrupt_bit_temp_L0
$0147 $0833 MOVF interrupt_bit_index_L0, 0
$0148 $00F0 MOVWF STACK_0
$0149 $0870 MOVF STACK_0, 0
$014A $ L_interrupt_61:
$014A $1903 BTFSC STATUS, Z
$014B $2950 GOTO L_interrupt_62
$014C $0CB5 RRF interrupt_bit_temp_L0, 1
$014D $13B5 BCF interrupt_bit_temp_L0, 7
$014E $3FFF ADDLW 255
$014F $294A GOTO L_interrupt_61
$0150 $ L_interrupt_62:
$0150 $3001 MOVLW 1
$0151 $05B5 ANDWF interrupt_bit_temp_L0, 1
$0152 $ L_interrupt_42:
;1Wire_Master.c,229 :: break;
$0152 $2974 GOTO L_interrupt_4
;1Wire_Master.c,232 :: case WAITING_FOR_RESET :
$0153 $ L_interrupt_43:
;1Wire_Master.c,233 :: break;
$0153 $2974 GOTO L_interrupt_4
;1Wire_Master.c,235 :: default : break;
$0154 $ L_interrupt_44:
$0154 $2974 GOTO L_interrupt_4
;1Wire_Master.c,236 :: }
$0155 $ L_interrupt_3:
$0155 $1303 BCF STATUS, RP1
$0156 $1283 BCF STATUS, RP0
$0157 $0820 MOVF _onewire_state, 0
$0158 $3A01 XORLW 1
$0159 $1903 BTFSC STATUS, Z
$015A $2816 GOTO L_interrupt_5
$015B $0820 MOVF _onewire_state, 0
$015C $3A02 XORLW 2
$015D $1903 BTFSC STATUS, Z
$015E $289E GOTO L_interrupt_21
$015F $0820 MOVF _onewire_state, 0
$0160 $3A03 XORLW 3
$0161 $1903 BTFSC STATUS, Z
$0162 $28B1 GOTO L_interrupt_24
$0163 $0820 MOVF _onewire_state, 0
$0164 $3A04 XORLW 4
$0165 $1903 BTFSC STATUS, Z
$0166 $28C4 GOTO L_interrupt_27
$0167 $0820 MOVF _onewire_state, 0
$0168 $3A05 XORLW 5
$0169 $1903 BTFSC STATUS, Z
$016A $28F4 GOTO L_interrupt_32
$016B $0820 MOVF _onewire_state, 0
$016C $3A06 XORLW 6
$016D $1903 BTFSC STATUS, Z
$016E $2922 GOTO L_interrupt_37
$016F $0820 MOVF _onewire_state, 0
$0170 $3A00 XORLW 0
$0171 $1903 BTFSC STATUS, Z
$0172 $2953 GOTO L_interrupt_43
$0173 $2954 GOTO L_interrupt_44
$0174 $ L_interrupt_4:
;1Wire_Master.c,237 :: TMR0=0;
$0174 $0181 CLRF TMR0, 1
;1Wire_Master.c,239 :: INTCON.INTF=0;
$0175 $108B BCF INTCON, 1
;1Wire_Master.c,240 :: INTCON.INTE=1;
$0176 $160B BSF INTCON, 4
;1Wire_Master.c,241 :: }
$0177 $ L_interrupt_2:
;1Wire_Master.c,243 :: if (INTCON.T0IF) {
$0177 $1303 BCF STATUS, RP1
$0178 $1283 BCF STATUS, RP0
$0179 $1D0B BTFSS INTCON, 2
$017A $2997 GOTO L_interrupt_45
;1Wire_Master.c,245 :: if (!PORTB.F0) {
$017B $1806 BTFSC PORTB, 0
$017C $2996 GOTO L_interrupt_46
;1Wire_Master.c,246 :: while(!PORTB.F0){}
$017D $ L_interrupt_47:
$017D $1C06 BTFSS PORTB, 0
$017E $297D GOTO L_interrupt_47
$017F $ L_interrupt_48:
;1Wire_Master.c,247 :: delay_us(14);
$017F $3017 MOVLW 23
$0180 $00FA MOVWF STACK_10
$0181 $0BFA DECFSZ STACK_10, F
$0182 $2981 GOTO $-1
;1Wire_Master.c,248 :: MACRO_OLOW_LO
$0183 $1006 BCF PORTB, 0
$0184 $1683 BSF STATUS, RP0
$0185 $1006 BCF TRISB, 0
;1Wire_Master.c,249 :: delay_us(103);
$0186 $30AB MOVLW 171
$0187 $00FA MOVWF STACK_10
$0188 $0BFA DECFSZ STACK_10, F
$0189 $2988 GOTO $-1
$018A $0000 NOP
;1Wire_Master.c,250 :: MACRO_OLOW_HI
$018B $1406 BSF TRISB, 0
;1Wire_Master.c,251 :: bit_index=0;
$018C $1283 BCF STATUS, RP0
$018D $01B3 CLRF interrupt_bit_index_L0, 1
;1Wire_Master.c,252 :: TRISB.F0=1; // Ska vara OLOW_DIR=1;
$018E $1683 BSF STATUS, RP0
$018F $1406 BSF TRISB, 0
;1Wire_Master.c,253 :: TRISA.F0=0; //För debugging
$0190 $1005 BCF TRISA, 0
;1Wire_Master.c,254 :: INTCON.INTF=0;
$0191 $108B BCF INTCON, 1
;1Wire_Master.c,255 :: ow_active=0;
$0192 $1283 BCF STATUS, RP0
$0193 $1105 BCF PORTA, 2
;1Wire_Master.c,256 :: onewire_state=GET_CMD;
$0194 $3001 MOVLW 1
$0195 $00A0 MOVWF _onewire_state
;1Wire_Master.c,257 :: }
$0196 $ L_interrupt_46:
;1Wire_Master.c,259 :: INTCON.T0IF=0;
$0196 $110B BCF INTCON, 2
;1Wire_Master.c,260 :: }
$0197 $ L_interrupt_45:
;1Wire_Master.c,262 :: }
$0197 $ L_Interrupt_end:
$0197 $0847 MOVF STSAVED_10, 0
$0198 $00FA MOVWF STACK_10
$0199 $0846 MOVF STSAVED_1, 0
$019A $00F1 MOVWF STACK_1
$019B $0845 MOVF STSAVED_0, 0
$019C $00F0 MOVWF STACK_0
$019D $0838 MOVF ?savePCLATH, 0
$019E $008A MOVWF PCLATH
$019F $0836 MOVF ?saveFSR, 0
$01A0 $0084 MOVWF FSR
$01A1 $0E37 SWAPF ?saveSTATUS, 0
$01A2 $0083 MOVWF STATUS
$01A3 $0EFF SWAPF STACK_15, 1
$01A4 $0E7F SWAPF STACK_15, 0
$01A5 $0009 RETFIE
----- Klipper bort alla externa funktioner --------
$0372 $ _main:
;1Wire_Master.c,48 :: void main() {
;1Wire_Master.c,50 :: init();
$0372 $228A CALL _init
;1Wire_Master.c,52 :: ow_get_id(&ROM_id,OW_PORT,OW_PIN);
$0373 $302A MOVLW _ROM_id
$0374 $1283 BCF STATUS, RP0
$0375 $00B9 MOVWF FARG_ow_get_id+0
$0376 $3005 MOVLW PORTA
$0377 $00BA MOVWF FARG_ow_get_id+1
$0378 $3001 MOVLW 1
$0379 $00BB MOVWF FARG_ow_get_id+2
$037A $229B CALL _ow_get_id
;1Wire_Master.c,53 :: ow_get_ds18b20_data(&SCRATCHPAD,OW_PORT,OW_PIN);
$037B $3022 MOVLW _SCRATCHPAD
$037C $00B9 MOVWF FARG_ow_get_ds18b20_data+0
$037D $3005 MOVLW PORTA
$037E $00BA MOVWF FARG_ow_get_ds18b20_data+1
$037F $3001 MOVLW 1
$0380 $00BB MOVWF FARG_ow_get_ds18b20_data+2
$0381 $22C1 CALL _ow_get_ds18b20_data
;1Wire_Master.c,55 :: onewire_state=WAITING_FOR_RESET;
$0382 $01A0 CLRF _onewire_state, 1
;1Wire_Master.c,57 :: while(1) {}
$0383 $ L_main_0:
$0383 $2B83 GOTO L_main_0
;1Wire_Master.c,59 :: }
$0384 $2B84 GOTO $
Kan det vara lokala eller globala variabler som måste sparas undan kanske eller vad är det för massa trams den håller på med i början av interruptet och sedan lite då och då i koden?