Hier ist der erstellte Assemblercode:
Man sieht darin, dass ganz und gar nicht optimiert wird.
Code:
;/////////////////////////////////////////////////////////////////////////////////
;// Code Generator: BoostC Compiler - http://www.sourceboost.com
;// Version : 6.96
;// License Type : Lite License (Unregistered)
;// Limitations : PIC12,PIC16 max code size:2048 words, max RAM banks:2, Non commercial use only
;/////////////////////////////////////////////////////////////////////////////////
include "P16F630.inc"
; Heap block 0, size:53 (0x0000002B - 0x0000005F)
__HEAP_BLOCK0_BANK EQU 0x00000000
__HEAP_BLOCK0_START_OFFSET EQU 0x0000002B
__HEAP_BLOCK0_END_OFFSET EQU 0x0000005F
; Heap block 1, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK1_BANK EQU 0x00000000
__HEAP_BLOCK1_START_OFFSET EQU 0x00000000
__HEAP_BLOCK1_END_OFFSET EQU 0x00000000
; Heap block 2, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK2_BANK EQU 0x00000000
__HEAP_BLOCK2_START_OFFSET EQU 0x00000000
__HEAP_BLOCK2_END_OFFSET EQU 0x00000000
; Heap block 3, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK3_BANK EQU 0x00000000
__HEAP_BLOCK3_START_OFFSET EQU 0x00000000
__HEAP_BLOCK3_END_OFFSET EQU 0x00000000
gbl_status EQU 0x00000003 ; bytes:1
gbl_indf EQU 0x00000000 ; bytes:1
gbl_tmr0 EQU 0x00000001 ; bytes:1
gbl_pcl EQU 0x00000002 ; bytes:1
gbl_fsr EQU 0x00000004 ; bytes:1
gbl_porta EQU 0x00000005 ; bytes:1
gbl_portc EQU 0x00000007 ; bytes:1
gbl_pclath EQU 0x0000000A ; bytes:1
gbl_intcon EQU 0x0000000B ; bytes:1
gbl_pir1 EQU 0x0000000C ; bytes:1
gbl_tmr1l EQU 0x0000000E ; bytes:1
gbl_tmr1h EQU 0x0000000F ; bytes:1
gbl_t1con EQU 0x00000010 ; bytes:1
gbl_cmcon EQU 0x00000019 ; bytes:1
gbl_option_reg EQU 0x00000081 ; bytes:1
gbl_trisa EQU 0x00000085 ; bytes:1
gbl_trisc EQU 0x00000087 ; bytes:1
gbl_pie1 EQU 0x0000008C ; bytes:1
gbl_pcon EQU 0x0000008E ; bytes:1
gbl_osccal EQU 0x00000090 ; bytes:1
gbl_wpua EQU 0x00000095 ; bytes:1
gbl_wpu EQU 0x00000095 ; bytes:1
gbl_ioca EQU 0x00000096 ; bytes:1
gbl_ioc EQU 0x00000096 ; bytes:1
gbl_vrcon EQU 0x00000099 ; bytes:1
gbl_eedata EQU 0x0000009A ; bytes:1
gbl_eeadr EQU 0x0000009B ; bytes:1
gbl_eecon1 EQU 0x0000009C ; bytes:1
gbl_eecon2 EQU 0x0000009D ; bytes:1
pause1ms_00000_1_loop EQU 0x00000024 ; bytes:2
pause1ms_00000_1_i EQU 0x00000026 ; bytes:2
pause1ms_00000_1_oszilator EQU 0x00000028 ; bytes:2
CompTempVar574 EQU 0x0000002A ; bytes:1
CompTempVar575 EQU 0x0000002A ; bytes:1
pause_00000_arg_loop EQU 0x00000020 ; bytes:2
pause_00000_1_i EQU 0x00000022 ; bytes:2
CompTempVar576 EQU 0x00000024 ; bytes:1
ORG 0x00000000
GOTO _startup
ORG 0x00000004
pause1ms_00000
; { pause1ms ; function begin
MOVLW 0x28
BCF STATUS, RP0
MOVWF pause1ms_00000_1_oszilator
CLRF pause1ms_00000_1_oszilator+D'1'
CLRF pause1ms_00000_1_i
CLRF pause1ms_00000_1_i+D'1'
label1
MOVF pause1ms_00000_1_i+D'1', W
XORLW 0x80
MOVWF CompTempVar574
MOVF pause1ms_00000_1_oszilator+D'1', W
XORLW 0x80
SUBWF CompTempVar574, W
BTFSS STATUS,Z
GOTO label2
MOVF pause1ms_00000_1_oszilator, W
SUBWF pause1ms_00000_1_i, W
label2
BTFSS STATUS,C
RETURN
CLRF pause1ms_00000_1_loop
CLRF pause1ms_00000_1_loop+D'1'
label3
MOVF pause1ms_00000_1_loop+D'1', W
XORLW 0x80
MOVWF CompTempVar575
MOVLW 0x80
SUBWF CompTempVar575, W
BTFSS STATUS,Z
GOTO label4
MOVLW 0x1E
SUBWF pause1ms_00000_1_loop, W
label4
BTFSS STATUS,C
GOTO label5
INCF pause1ms_00000_1_loop, F
BTFSS STATUS,Z
GOTO label3
INCF pause1ms_00000_1_loop+D'1', F
GOTO label3
label5
INCF pause1ms_00000_1_i, F
BTFSC STATUS,Z
INCF pause1ms_00000_1_i+D'1', F
GOTO label1
; } pause1ms function end
ORG 0x0000002C
pause_00000
; { pause ; function begin
CLRF pause_00000_1_i
CLRF pause_00000_1_i+D'1'
label6
MOVF pause_00000_1_i+D'1', W
XORLW 0x80
MOVWF CompTempVar576
MOVF pause_00000_arg_loop+D'1', W
XORLW 0x80
SUBWF CompTempVar576, W
BTFSS STATUS,Z
GOTO label7
MOVF pause_00000_arg_loop, W
SUBWF pause_00000_1_i, W
label7
BTFSS STATUS,C
RETURN
CALL pause1ms_00000
INCF pause_00000_1_i, F
BTFSC STATUS,Z
INCF pause_00000_1_i+D'1', F
GOTO label6
; } pause function end
ORG 0x0000003F
main
; { main ; function begin
BCF STATUS, RP0
CLRF gbl_porta
CLRF gbl_portc
BSF STATUS, RP0
CLRF gbl_trisa
MOVLW 0xFF
MOVWF gbl_trisc
BCF STATUS, RP0
CLRF gbl_intcon
label8
BTFSS gbl_portc,0
GOTO label9
MOVLW 0xFF
MOVWF gbl_porta
GOTO label10
label9
CLRF gbl_porta
label10
MOVLW 0xFF
MOVWF pause_00000_arg_loop
CLRF pause_00000_arg_loop+D'1'
CALL pause_00000
GOTO label8
; } main function end
ORG 0x00000053
_startup
BCF PCLATH,3
BCF PCLATH,4
GOTO main
END
Wegen der for-schleife: Ich konnte keinen Fehler finden. Villeicht habe ich dich falsch verstanden. könntest du dass ein wenig genauer erläutern?
Ich habe auch ein Problem vom Assemblercode entdeckt, dass der Auslösßer sein könnte. Ich werde ihn heute noch untersuchen:
Code:
MOVLW 0xFA
MOVWF pause_00000_arg_loop
CLRF pause_00000_arg_loop+D'1'
CALL pause_00000
Dabei wird zuerst der Wert 250 in die Variable pause_00000_arg_loop geschrieben, und danach durch CLRF pause_00000_arg_loop+D'1' wieder gelöscht. Was das +D'1' bedeutet, weiß ich nicht, da ich dass noch nie angewendet habe.
Ist dass villeicht das problem?
Lesezeichen