anhnha
Full Member level 6
Hi all,
I am have a problem when i insert a assembly in c code in ccs.this is my code:
in this i want to set trisb and trisc state but when i watch a list file i find that:
.................... #asm
.................... MOVLW 0x00
017F: MOVLW 00
.................... MOVWF TRISB
0180: BSF 03.5
0181: MOVWF 06
.................... MOVLW 0x18
0182: MOVLW 18
.................... MOVWF TRISC
0183: MOVWF 07
.................... BSF PORTC, 0
0184: BCF 03.5
0185: BSF 07.0
.................... BCF 0x03, 5
0186: BCF 03.5
.................... MOVF 0x4C, 0
0187: MOVF 4C,W
.................... SUBLW 1
0188: SUBLW 01
.................... BTFSC 0x03,2
0189: BTFSC 03.2
.................... MOVLW 0xF9
018A: MOVLW F9
.................... MOVWF PORTB
018B: MOVWF 06
.................... #endasm[/CODE]
I can not understand MOVWF 06 instruction I think it has to be a MOVWF 86 instruction because 06 is portb address and 86 is trisb address?
Thank you.
I am have a problem when i insert a assembly in c code in ccs.this is my code:
Code:
......#asm
MOVLW 0x00
MOVWF TRISB
MOVLW 0x18
MOVWF TRISC
BSF PORTC, 0
BCF 0x03, 5
MOVF 0x4C, 0
SUBLW 1
BTFSC 0x03,2
MOVLW 0xF9
MOVWF PORTB
#endasm
Code:
[CODE]
.................... MOVLW 0x00
017F: MOVLW 00
.................... MOVWF TRISB
0180: BSF 03.5
0181: MOVWF 06
.................... MOVLW 0x18
0182: MOVLW 18
.................... MOVWF TRISC
0183: MOVWF 07
.................... BSF PORTC, 0
0184: BCF 03.5
0185: BSF 07.0
.................... BCF 0x03, 5
0186: BCF 03.5
.................... MOVF 0x4C, 0
0187: MOVF 4C,W
.................... SUBLW 1
0188: SUBLW 01
.................... BTFSC 0x03,2
0189: BTFSC 03.2
.................... MOVLW 0xF9
018A: MOVLW F9
.................... MOVWF PORTB
018B: MOVWF 06
.................... #endasm[/CODE]
I can not understand MOVWF 06 instruction I think it has to be a MOVWF 86 instruction because 06 is portb address and 86 is trisb address?
Thank you.
Last edited: