English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 11 August 2019, 21:27   #1
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Creating an array gives me a Guru

In my code I have a line that's exactly like this:

Code:
Dim map.b(15,375)
It's an array I create to store data read from a file.

when I run the code on Winuae it works flawlessly.

when I try to run on my A600, this line gives me a "Program Failed (error #80000003)" message and then a Guru. Sometimes just a straight reboot+Guru

This is with the debugger on.


if I change it to

Code:
Dim map.w(15,375)
I don't get the guru but then the code to read the data from the file and write it in the array doesn't seem to work properly. (all I get is 0s - not discarding I could try to understand why I switch to Words on real hardware I get 0s, but Byes on emulator work)


Anyone has any idea of what's happening? It's really weird for me when code runs on Winuae but then fails on real hardware (and it happens more than I would like)

EDIT: I tried to create the array at the FIRST line of my code, too see if something else done before was the culprit, still got the Guru.

If I make a program with just this line and nothing else I have no problems. What the hell.....

Last edited by Shatterhand; 11 August 2019 at 21:34.
Shatterhand is offline  
Old 11 August 2019, 22:29   #2
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
Quote:
Originally Posted by Shatterhand View Post
In my code I have a line that's exactly like this:

Code:
Dim map.b(15,375)
It's an array I create to store data read from a file.

when I run the code on Winuae it works flawlessly.

when I try to run on my A600, this line gives me a "Program Failed (error #80000003)" message and then a Guru. Sometimes just a straight reboot+Guru

This is with the debugger on.


if I change it to

Code:
Dim map.w(15,375)
I don't get the guru but then the code to read the data from the file and write it in the array doesn't seem to work properly. (all I get is 0s - not discarding I could try to understand why I switch to Words on real hardware I get 0s, but Byes on emulator work)


Anyone has any idea of what's happening? It's really weird for me when code runs on Winuae but then fails on real hardware (and it happens more than I would like)

EDIT: I tried to create the array at the FIRST line of my code, too see if something else done before was the culprit, still got the Guru.

If I make a program with just this line and nothing else I have no problems. What the hell.....
Odd address error perhaps on 68000 CPU.
Don_Adan is offline  
Old 11 August 2019, 23:15   #3
aeberbach
Registered User
 
Join Date: Mar 2019
Location: Melbourne, Australia
Posts: 420
You are the guru Don Adan... there is no substitute for real hardware.
aeberbach is offline  
Old 11 August 2019, 23:21   #4
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Any idea of how to solve it?
Shatterhand is offline  
Old 11 August 2019, 23:50   #5
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
Quote:
Originally Posted by Shatterhand View Post
Any idea of how to solve it?
I dont know blitz, but perhaps data must have even length or data must be stored at even addresses. In asembler you use "even" command for this.
Don_Adan is offline  
Old 12 August 2019, 01:12   #6
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Urr.. no idea of how to do that, I think the compiler is supposed to take care of this kind of thing by its own.

I made the rest of the code work with Word instead of Byte, but now it's using double the memory it needs.

This is insanely weird
Shatterhand is offline  
Old 12 August 2019, 08:33   #7
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
You may try something like :
Code:
Dim map.b(16,375)
or :
Code:
Dim map.b(15,376)
to see if it's alignment problems.

If it doesn't help you'll have to post more of the code, because it's probably not the definition of data that causes the trouble but the actual use of it.
meynaf is offline  
Old 12 August 2019, 08:37   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by Shatterhand View Post
when I run the code on Winuae it works flawlessly.

when I try to run on my A600, this line gives me a "Program Failed (error #80000003)" message and then a Guru. Sometimes just a straight reboot+Guru
Did you have 68000 + more compatible ticked? Only more compatible (and more accurate modes) emulate 68000/010 address errors.
Toni Wilen is online now  
Old 12 August 2019, 10:05   #9
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
You can use the EVEN command also in Blitz Basic, since inline assembly is supported. I don't know if it will fix the problem though.
MickGyver is offline  
Old 12 August 2019, 15:50   #10
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 862
Can you change it to (16,376) and see if that works?
Coagulus is offline  
Old 12 August 2019, 15:53   #11
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Ok, lots of suggestions , thank you guys, a lot! . I'll only have time to play with my Amiga again in a few days, so it will take a while to test all of this

Quote:
If it doesn't help you'll have to post more of the code, because it's probably not the definition of data that causes the trouble but the actual use of it.
Actually I tried to make this the very first line of the code and still got the Guru. I get the error when CREATING the array, not when using it. I thought some stuff I was doing before on the code could be creating the error, but even when the first thing the code does is to create this array, I get the same error. It's really very weird.

Quote:
Did you have 68000 + more compatible ticked? Only more compatible (and more accurate modes) emulate 68000/010 address errors.
Yes, though only now I noticed my "emulated" amiga actually uses an 040. It's an old config I had ready here.

I complained "I get errors on real hardware that I don't get on Winuae" but its probably because of the different configurations.

Quote:
You can use the EVEN command also in Blitz Basic, since inline assembly is supported. I don't know if it will fix the problem though.
Don't even know how to use Assembly in Blitz, I know its supported, I have no idea of how to use it, I probably should start learning it because I am getting "Use Inline Assembly" as an answer a lot from my Blitz queries
Shatterhand is offline  
Old 13 August 2019, 14:12   #12
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Quote:
Originally Posted by Shatterhand View Post
Don't even know how to use Assembly in Blitz, I know its supported, I have no idea of how to use it, I probably should start learning it because I am getting "Use Inline Assembly" as an answer a lot from my Blitz queries
You just write the assembly code where you want it, it's basically that simple. You can access variables with GetReg (set dX register to value of a variable) and PutReg (set variable to value of a dX register). You can also have statements and functions that are assembly only.

Code:
myvar.w=4
GetReg d0,myvar ; d0 will be set to the value of myvar (4)
mulu.w #10,d0 ; inline assembly, multiply d0 with 10
PutReg d0,myvar.w ; myvar will be set to the value of d0 (40)
MickGyver is offline  
Old 13 August 2019, 15:23   #13
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Shit, it's that simple?

I hoped it would be a very complicated thing, so I could say "Oh that's too much hassle" as an excuse to not learn assembly.

Damn it.
Shatterhand is offline  
Old 13 August 2019, 20:18   #14
clenched
Registered User
 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 771
1 - w/68000 CPU most compatible, CE, WinUAE guru happens.
2 - REDDebugger is at fault. The mere act of invoking it, not this array, causes guru.

One error trying to move long word "REXX" to odd. Another trying to go odd w/D0.L. That's enough to consider it a lost cause. This type of crash also plagues one of the tracker libraries.

The only recourse I see is replacing defaultdbug file with the (~32k) one on Blitz2 floppy. It is crude by comparison but does work w/68000.

Last edited by clenched; 15 August 2019 at 21:41. Reason: typo; forgot most compatible
clenched is offline  
Old 13 August 2019, 20:54   #15
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
The annals of computer programming must be littered with stunned developers staring at the screen in disbelief, muttering to themselves "how did this thing ever work?"
E-Penguin is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 2000 Rev4.4 Resistor Array types ronybeck support.Hardware 2 14 August 2019 13:17
Array putting garbage in register Locash Coders. Asm / Hardware 8 04 March 2018 13:03
Limited Array Of CDTV Games fondpondforever Retrogaming General Discussion 9 23 July 2015 14:20
Blitz2: Pointer to array idrougge Coders. Blitz Basic 3 26 March 2015 21:44
Guru! Fackamato support.WinUAE 17 15 September 2004 22:57

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:08.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.15616 seconds with 15 queries