assembler in FC7

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
DELAK_ALED
Posts: 23
Joined: Sat Jun 21, 2014 11:04 am
Has thanked: 5 times
Been thanked: 2 times
Contact:

assembler in FC7

Post by DELAK_ALED »

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
}
Attachments
in_FC6.fcfx
(3.12 KiB) Downloaded 79 times

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: assembler in FC7

Post by Steve »

Hopefully this post will help:
viewtopic.php?f=63&t=22957

DELAK_ALED
Posts: 23
Joined: Sat Jun 21, 2014 11:04 am
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: assembler in FC7

Post by DELAK_ALED »

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

chipfryer27
Valued Contributor
Valued Contributor
Posts: 617
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: assembler in FC7

Post by chipfryer27 »

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 :)

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: assembler in FC7

Post by Steve »

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.
c code test.png
c code test.png (20.72 KiB) Viewed 6202 times
Attachments
c code test.fcfx
(7.14 KiB) Downloaded 76 times

DELAK_ALED
Posts: 23
Joined: Sat Jun 21, 2014 11:04 am
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: assembler in FC7

Post by DELAK_ALED »

Thank you to everyone who helped me tremendously here

Post Reply