In flowcode 6 I have no problem sending an assembler program to hardware (see example in attachment). However, in flowcode 7 I can't do that. Does anyone know how to modify the program so that I can also use that assembler program in flowcode 7?
Thanks in advance for helping to find a solution.
asm
{
movlw 0b00000000
movwf _trisd
movlw 0b10101010
movwf _portd
}
assembler in FC7
Moderator: Benj
-
- Posts: 23
- Joined: Sat Jun 21, 2014 11:04 am
- Has thanked: 5 times
- Been thanked: 2 times
-
- Posts: 23
- Joined: Sat Jun 21, 2014 11:04 am
- Has thanked: 5 times
- Been thanked: 2 times
Re: assembler in FC7
It has indeed helped me a lot. I only have a problem if I want to use a variable in my program.
How can I do that in FC7?
in FC6 this works well
unsigned char test;
asm
{
movlw 0b00000000
movwf _trisd
movlw 10
movwf _test
movff _test,_portd
}
in FC7 a problem occurs and it only has to do with that variable
unsigned char test;
#asm
movlw 0b00000000
movwf trisd
movlw 10
movwf test
movff test,portd
#endasm
How can I do that in FC7?
in FC6 this works well
unsigned char test;
asm
{
movlw 0b00000000
movwf _trisd
movlw 10
movwf _test
movff _test,_portd
}
in FC7 a problem occurs and it only has to do with that variable
unsigned char test;
#asm
movlw 0b00000000
movwf trisd
movlw 10
movwf test
movff test,portd
#endasm
-
- Valued Contributor
- Posts: 786
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 187 times
- Been thanked: 205 times
Re: assembler in FC7
Hi
In FC7 naming changed to capitals. If I had a variable called "test", I would if using a C-code block reference it with FCV_TEST
HTH
Regards
EDIT..
Oops, forgot you were using asm but Steve to the rescue
In FC7 naming changed to capitals. If I had a variable called "test", I would if using a C-code block reference it with FCV_TEST
HTH
Regards
EDIT..
Oops, forgot you were using asm but Steve to the rescue

- Steve
- Matrix Staff
- Posts: 3431
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: assembler in FC7
Please see the attached and image below.
It contains 4 equivalent icons showing variable assignment: Flowcode, C code and two in Assembly code.
There are 2 assembly code versions. The first is a copy of how C code statements are converted to assembly by the compiler (I found this by looking at the generated ".as" file after I did a compile). The second is a simplified version, but note it might not work because of various complications in the compilation process (due to optimisations, etc). The XC8 manual has much more information on this.
It contains 4 equivalent icons showing variable assignment: Flowcode, C code and two in Assembly code.
There are 2 assembly code versions. The first is a copy of how C code statements are converted to assembly by the compiler (I found this by looking at the generated ".as" file after I did a compile). The second is a simplified version, but note it might not work because of various complications in the compilation process (due to optimisations, etc). The XC8 manual has much more information on this.
- Attachments
-
- c code test.fcfx
- (7.14 KiB) Downloaded 184 times
-
- Posts: 23
- Joined: Sat Jun 21, 2014 11:04 am
- Has thanked: 5 times
- Been thanked: 2 times