One or more errors occurred in the back-end build...

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

One or more errors occurred in the back-end build...

Post by pjc30943 »

When compiling with the following in a header:

Code: Select all

'data storage arrays:
public const dataArrayLen as long = 10000
public threeDArray(dataArrayLen, 3) as single
the error
"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: Select all

'----------- 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.
Paul
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: "One or more errors occurred in the back-end build.

Post by dkinzer »

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.
- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

For the following case:

Code: Select all

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?
Paul
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

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: Select all

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: Select all

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.
- Don Kinzer
Post Reply