Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
One or more errors occurred in the back-end build...

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
pjc30943



Joined: 02 Dec 2005
Posts: 220

Posted: 04 December 2008, 23:35 PM    Post subject: One or more errors occurred in the back-end build... Reply with quote

When compiling with the following in a header:

Code:
'data storage arrays:
public const dataArrayLen as long = 10000
public threeDArray(dataArrayLen, 3) as single


the error
Quote:
"Error: one or more errors occurred in the back-end build process for "chirp.zxb" "
is shown. When dataArrayLen is taken down to a much smaller value, the project successfully compiles.

First issue: should the compiler return a more specific error?

Second issue: in the first module I have the following declared based on a previous post (http://www.zbasic.net/forum/about1063.html); I thought the RAM declaration was correct:

Code:
'----------- Configurations ---------\\
Option TargetCPU zx1280n
Option ExtRamConfig On
Option RamSize 65536 - Register.RamStart
Option PortPinEncoding Off
Option TaskStackMargin 12
'-------------------------------------//


The .map file shows RAMsize correctly declared as 65024; why the error, then? With the array length set to 1k, it shows an actual size of 43590 for main(); the reason for this is also unclear to me.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 05 December 2008, 0:23 AM    Post subject: Re: "One or more errors occurred in the back-end build. Reply with quote

pjc30943 wrote:
First issue: should the compiler return a more specific error?
I agree that it would be more helpful to get a specific error message indicating that the aggregate size of the array is too large.

pjc30943 wrote:
The .map file shows RAMsize correctly declared as 65024; why the error, then?
If you're using 0-based indexing (which is the default), the array that you defined has 10,001 elements on one dimension and 4 elements on the other. Given that the size of a Single is 4 bytes, the aggregate size of the array is 160,016 bytes.

Even if you cut that array down so that it is smaller than the available RAM, there remains a limitation imposed by the back end compiler that no individual data item can have an aggregate size larger than 32768 bytes. At present, this fact isn't documented in the ZBasic manuals.

pjc30943 wrote:
With the array length set to 1k, it shows an actual size of 43590 for main()
I'm not sure what you mean here. Perhaps the 43590 is the code size for Main(). That would be unrelated to the issue of RAM size, of course.
Back to top
pjc30943



Joined: 02 Dec 2005
Posts: 220

Posted: 05 December 2008, 21:24 PM    Post subject: Reply with quote

For the following case:

Code:
public const dataArrayLen as integer = 6000
public twoDArray(dataArrayLen, 2) as unsignedinteger


6000*2*2 = 24k bytes, which is less than 32k, but the size error is given; for some reason the error arises for lengths longer than 5100 or so bytes.

Why the limitation in this case?
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 05 December 2008, 21:57 PM    Post subject: Reply with quote

pjc30943 wrote:
Why the limitation in this case?
Don't forget that array indices default to zero-based. The following compiles without error for me but if I change the constant to 8192, it fails.
Code:
Public Const dataArrayLen as Integer = 8191
Public twoDArray(1 to dataArrayLen, 1 to 2) as UnsignedInteger


Alternately, you can use the directive below to set the default lower bound for the module in which the array is defined.
Code:
Option Base 1

I misstated the limit in my earlier post. The limitation is that data items must have an aggregate size of less than 32768 bytes.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group