cancel
Showing results for 
Search instead for 
Did you mean: 

ASSEMBLER #IF2 DIRECTIVE

fggnrc
Associate II
Posted on December 19, 2005 at 08:17

ASSEMBLER #IF2 DIRECTIVE

2 REPLIES 2
fggnrc
Associate II
Posted on August 25, 2005 at 07:57

Dear ST7 community,

I have found a wrong assembler behaviour when it deals with

address evaluation inside a #IF2 directive.

The error does not impact on the code generation but only in

the test I use to check that some code or data belongs to

the same page (see attachment test.txt).

When I disable these tests (by commenting them out), the

listing file (see attachment list.txt) shows that they are

fulfilled (i.e. all of them is in $F0 page)

When I enable them, the assembler complains

STMicroelectronics - Assembler - rel. 4.48

ERROR: CHECK crosses the SCI Parser page!

1 error on assembly of 'C:\uDev\SW_Projects\uAntHill\pclink.asm'

C:\uDev\SW_Projects\uAntHill\pclink.asm(494): as2 : Error 8: End of Assembly while in ENDIF! ''

Perhaps I miss some detail of assembler pass #2, or there is

a better way to implement my check, but I can not feel safe

without a such test in my code...

Thank you in advance

EtaPhi

PS: my experiments have also shown that the #LOAD directive

causes problems with the addresses management, since it

seems that sometimes the labels addresses that follow them

are not correctly computed.

________________

Attachments :

List.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0HT&d=%2Fa%2F0X0000000bWa%2FFiK60.ouZIc3dVUTqDxWLfUmSVn86uMsHtzCkIxKf6g&asPdf=false

Test.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0HO&d=%2Fa%2F0X0000000bWX%2FjOPqKPis.thKqb70yCSWvrW0TqMJ8ui_qwBeOITIBSg&asPdf=false
fggnrc
Associate II
Posted on December 19, 2005 at 08:17

I found that the source of my problems is my misunderstanding of the assembler documentation.

The st7 assembler reference tells that during the building process the assembler is called twice: before and after the link step.

I erroneously thought that these steps are related to the assembler passes, i.e. IF2 is true when the assembler is called after the linker.

This is not true, pass 1 and 2 are internal assembler steps that are always executed.

To put in effect my test, I changed the #IF2 into #IFDEF DO_TEST and added -d DO_TEST in the assembler command line.

This required an hack to the .stp file, since the post-link property page in the project settings is read-only.

Is there a ''clean'' (and safe) way to do this?

Thanks

EtaPhi