English Amiga Board


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

 
 
Thread Tools
Old 25 April 2020, 21:10   #1
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 45
Posts: 363
eClock.include

I just used eClock.include, which comes with AB3 and is written in 2006 by Thilo Koehler.

usage:
Code:
xInclude eclock.include.bb2

eClock_start{1000}  ;timebase ms
..do something
time.l = eClock_Stop{}
First it ran fine on an emulated A1200 with AB3, but then I found out it won't run on 000 or 010 cpus.
The programm immediately throws Error "8000 0003" suspend or reboot.
I tried it on a real A500 and emulated A500/A600.

It even does this on <020 cpus when you include eClock without calling any function of it.

Its a shame because eClock is made for benchmarking, but exluding the mentioned cpu is a no go.

Am I missing something here?

If not, is there a way to fix the include so it will run on cpus less than 020?

Any other good way to measure runtime (preferably milliseconds)?

Details:
I compiled on Winuae with AB3.7.3 using all.res for this include.

Edit:
eClock.include allows for direct compiling. A small demo of about 10 code lines gets compiled and prints the clocked value each second. In my experience also this works well on (real or emulated) A1200 and crashes on A500. I can upload this program to the zone if it helps.

Last edited by Nightshft; 25 April 2020 at 21:19. Reason: added information
Nightshft is offline  
Old 25 April 2020, 21:28   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,686
First thing to try is to check the optimisation flags for any includes (including includes added by eclock.include itself). Most includes have the optimise flags set for integer, some have it for FPU. If you turn off those optimisations, that could solve the issue. Other than that, there could well be a misaligned memory access somewhere in it, which isn't allowed on a 68000 but can sneak into your code surprisingly easily.
Daedalus is offline  
Old 25 April 2020, 23:19   #3
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 45
Posts: 363
It includes "error.include.ab3".
Which also runs on 020 but not on 000.
Guru is 8000 0020, which maybe is "trap, pgm out of control"?

(it can be compiled directly into a demo too)
I'm looking into it, but as a AB beginner this is challenging

On a sidenote: It uses for example the type .EasyStruct.
Which comes from the resident, so I can't see it's definition, right?

Edit:
Thilo also often uses:

If foo then bar:Else baz

Is this still valid syntax? I'm expanding it to if..else..endif meanwhile.

Edit2:
Expanding the "if"s didnt change anything.

Last edited by Nightshft; 25 April 2020 at 23:31.
Nightshft is offline  
Old 26 April 2020, 00:05   #4
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 45
Posts: 363
Looks like removing error.include from eclock let's it run on 000 without Guru

(Error handling of eclock however is disabled until replacement is found/written.)
Nightshft is offline  
Old 26 April 2020, 13:23   #5
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,686
The different optimisation levels will affect the CPU requirements for the executable, and the optimize command is interpreted by the compiler in the order in which it's found. So, even if you drop it to 0 (or 4 as required), any further includes can change it for their own internal code. So you would have to drill down through every used include to disable the optimisations.

The resident files don't include any CPU optimisation stuff (and generally don't even include any actual instructions). They're simply lots of definitions, so aren't affected.

In New Syntax mode, that syntax is valid indeed.
Daedalus 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
Devpac include files? anotheramigafan Coders. General 2 21 August 2018 21:44
Illegal Operator on Include marduk_kurios Coders. Asm / Hardware 8 04 August 2017 20:09
VBCC and #include majikeyric Coders. C/C++ 3 03 March 2016 15:07
DevPac Include disks h0ffman request.Apps 4 23 September 2010 19:54
Include setup with SAS C TheDarkCoder Coders. General 1 31 December 2009 18:01

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 23:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06658 seconds with 14 queries