Rotate Right
Posted: Sat Dec 29, 2012 11:48 am
Hi All,
I met the flowing declaration problem of variables in a rotation right. Let make the problem more clear:
1) take 2 variables A and B, which are declared as 1 byte variable each. Say A=0x01 and B=0x10.
2) I want to place bit 0 of A into bit 7 of B (and all other bits in B shifted to right)
3) The most easy way is in the assembler code like:
Asm
{
RRF A,F // which places bit 0 of A into the carry bit
RRF B,F // which places the carry bit into bit 7 of B
}
So far so good. But now in Flowcode 5:
4) The variable A and B will become gbl_FCV_A and gbl_FCV_A in the assembler code. But
asm
{
RRF gbl_FCV_A,F
RRF glb_FCV_B,F
}
gives an error that these variabales are unknown
5) The variable A and B will become FCV_A and FCV_A in the C-code. But
asm
{
RRF FCV_A,F
RRF FCV_B,F
}
give also the error that these variables are unknown.
In principle 4) is the right assembler code and should be used as such. But it is interpreted as a C-code with wrong variable names.
My question:
Is there and easy/simple solution?
Kind regards
Jan Lichtenbelt
I met the flowing declaration problem of variables in a rotation right. Let make the problem more clear:
1) take 2 variables A and B, which are declared as 1 byte variable each. Say A=0x01 and B=0x10.
2) I want to place bit 0 of A into bit 7 of B (and all other bits in B shifted to right)
3) The most easy way is in the assembler code like:
Asm
{
RRF A,F // which places bit 0 of A into the carry bit
RRF B,F // which places the carry bit into bit 7 of B
}
So far so good. But now in Flowcode 5:
4) The variable A and B will become gbl_FCV_A and gbl_FCV_A in the assembler code. But
asm
{
RRF gbl_FCV_A,F
RRF glb_FCV_B,F
}
gives an error that these variabales are unknown
5) The variable A and B will become FCV_A and FCV_A in the C-code. But
asm
{
RRF FCV_A,F
RRF FCV_B,F
}
give also the error that these variables are unknown.
In principle 4) is the right assembler code and should be used as such. But it is interpreted as a C-code with wrong variable names.
My question:
Is there and easy/simple solution?
Kind regards
Jan Lichtenbelt