Annoying warning in 5.2 assembler.

Discussion and support of the compiler from ImageCraft for the M8C.

Moderator: richard@imagecraft.com

Annoying warning in 5.2 assembler.

Postby AndyW » Mon Aug 20, 2012 2:04 am

It seems that now, any usage of code within .LITERAL, .ENDLITERAL generates a warning. Why? It seems perfectly valid to use instructions here, for example in the case of a jump table using JACC.
On one of my projects I get 100 warnings because of this, which swamp the output.
AndyW
The Big Cheese
The Big Cheese
 
Posts: 180
Joined: Mon Jul 18, 2005 6:06 am
Location: London, UK

Re: Annoying warning in 5.2 assembler.

Postby bobmarlowe » Mon Aug 20, 2012 1:17 pm

Hi Andy,
can you please provide us with an example so that we can check the warning-text etc.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Annoying warning in 5.2 assembler.

Postby AndyW » Mon Aug 20, 2012 1:38 pm

code:

USBFS_ControlInDispatch:
JACC USBFS_ControlInDispatchTable
.LITERAL
USBFS_ControlInDispatchTable:
JMP USBFS_Not_Supported_Local_Drv ; USB_TRANS_STATE_IDLE
JMP USBFS_ControlReadDataStage ; USB_TRANS_STATE_CONTROL_READ
JMP USBFS_ControlWriteStatusStage ; USB_TRANS_STATE_CONTROL_WRITE
JMP USBFS_NoDataControlStatusStage ; USB_TRANS_STATE_NO_DATA_CONTROL
.ENDLITERAL

Output:
!W lib/usbfs_std.asm(1339): Probable ERROR! Machine instructions inside .LITERAL/.ENDLITERAL
will cause problems with Code Compression optimization.
AndyW
The Big Cheese
The Big Cheese
 
Posts: 180
Joined: Mon Jul 18, 2005 6:06 am
Location: London, UK

Re: Annoying warning in 5.2 assembler.

Postby bobmarlowe » Mon Aug 20, 2012 2:09 pm

You have (as the warning states) used code within the .LITERAL .
The assembly handbook says
all data defined in ROM with the ASCIZ, DB, DS,
DSU, DW, or DWL directives must use this directive

So for your jump-table there is no need for .LITERAL
When you have got a table with addresses you want to jump to and load the address and jump to you'll have to use DW instructions and .LITERAL

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Annoying warning in 5.2 assembler.

Postby CypressRaj » Sun Dec 16, 2012 11:43 pm

You can safely ignore those warnings. .literal directive tells the compiler to avoid using compression of the code written between .literal and .endliteral directives. This warning comes up even if you have disabled compresion feature.

-Rajiv Badiger
CypressRaj
Cheese Cube
Cheese Cube
 
Posts: 37
Joined: Sun Nov 22, 2009 10:07 pm

Re: Annoying warning in 5.2 assembler.

Postby bobmarlowe » Mon Dec 17, 2012 1:38 am

I'm not quite conform with you, Rajiv. To decide which warnings may be "safely" ignored and which not can get forgotten after some time has expired. So I suggest to get rid of EVERY warning so that we are not mis-leaded "it is only a warning, nothing more" or in case of a mis-function of the software "There are warnings, do they have somthing to do with that issue?"

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Annoying warning in 5.2 assembler.

Postby AndyW » Mon Dec 17, 2012 6:59 am

bobmarlowe wrote:I'm not quite conform with you, Rajiv. To decide which warnings may be "safely" ignored and which not can get forgotten after some time has expired. So I suggest to get rid of EVERY warning so that we are not mis-leaded "it is only a warning, nothing more" or in case of a mis-function of the software "There are warnings, do they have somthing to do with that issue?"

Bob


Bob, I could not agree more. In fact its worse than this because its not actually a warning, it shows in capitals "PROBABLE ERROR". To get over 100 of these on a project which has no errors and gave no warnings on a previous version of the assembler is a big nuisance and hides real errors.
AndyW
The Big Cheese
The Big Cheese
 
Posts: 180
Joined: Mon Jul 18, 2005 6:06 am
Location: London, UK

Re: Annoying warning in 5.2 assembler.

Postby bobmarlowe » Mon Dec 17, 2012 8:11 am

It was (and is) your choice to write your program in a way that no warnings occur. You could have avoided all your 100 messages when ommitting the .LITERAL instruction in the area where code resides.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Annoying warning in 5.2 assembler.

Postby AndyW » Mon Dec 17, 2012 9:08 am

bobmarlowe wrote:It was (and is) your choice to write your program in a way that no warnings occur. You could have avoided all your 100 messages when ommitting the .LITERAL instruction in the area where code resides.

Bob


But can I be sure the code wont get affected by compression if no .LITERAL is used?

Note that most of the code affected by this is in Cypress UMs
AndyW
The Big Cheese
The Big Cheese
 
Posts: 180
Joined: Mon Jul 18, 2005 6:06 am
Location: London, UK

Re: Annoying warning in 5.2 assembler.

Postby bobmarlowe » Mon Dec 17, 2012 3:54 pm

Read the manual exactly: it states "All DATA defined with db etc" (see my previous post). What the warning says is that you used the .LITERAL instruction for CODE which cannot get compressed, so what is the .LITERAL good for? So you can be sure that the compiler will not compress your code.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany


Return to “%s” ImageCraft ICCv7 for M8C Compiler

Who is online

Users browsing this forum: No registered users and 1 guest

cron