16 October 2014, 00:25 | #1 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
Help with compile
Can you someone look at the attached code and tell me exactly what I need to compile it on an Amiga?
I know absolutely *nothing* about C code, except what it looks like when you disassemble the assembly code. I need to compile the tester program, which is an instruction set tester that was written in C. I need to run this on an Amiga (and Amiga emulators) to test the instruction set accuracy. Thank you!! Jim |
16 October 2014, 00:39 | #2 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
From looking inside the makefile, it looks to me like it is designed to be compiled with GCC on Windows or OSX.
|
16 October 2014, 03:34 | #3 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
Yes, but the docs in the github elude to the fact that it was created on an Amiga... the samples were for sure. I would assume that it can be compiled to run on an Amiga changing the make file. I installed gcc on the Amiga and tried to compile it, but got all kinds of errors about missing .h files. My goal is to turn this into 68K assembly that can be used on Amiga and Mac emulators to test the instruction set accuracy.
|
16 October 2014, 14:05 | #4 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,889
|
do you mean that they never were accurate in your past products?
|
16 October 2014, 14:43 | #5 |
Registered User
Join Date: Aug 2012
Location: Champaign IL USA
Posts: 22
|
Hi Jim,
Did you use gnu make along with gcc to compile? From a quick look a the source, it doesn't appear to use any exotic system include files, but it uses a gnu make extension to build the compiler options that specify where to find the .h files in the source tree. I don't know much (anything, really) about the state of gcc/g++ on the Amiga, but the makefile refers to version 4.7 and lists a couple language options that may not be available on the Amiga (-std=gnu99, -std=gnu++0x). I'm not sure if the source actually uses new language features that require these options. There are only a few source files in the base executable, so you could try compiling by hand rather than chasing down the correct version of make. Here are the compiler commands the makefile invokes when I run make DEBUG=1 on my mac. g++ -I. -Ilib/ -O0 -g -Wall -c 68k/68k.cpp -o obj/68k.o g++ -I. -Ilib/ -O0 -g -Wall -c 68k/exception.cpp -o obj/68kexception.o g++ -I. -Ilib/ -O0 -g -Wall -c main.cpp -o obj/main.o g++ -I. -Ilib/ -O0 -g -Wall -c results.cpp -o obj/results.o g++ -I. -Ilib/ -O0 -g -Wall -c tester.cpp -o obj/tester.o g++ -o out/portable68k obj/68k.o obj/68kexception.o obj/main.o obj/results.o obj/tester.o I edited the makefile to remove the -std=gnu* options. I got a couple compiler warnings (signed vs unsigned comparison, recommended parentheses around an expression), but nothing too dire. I suspect the -std=gnu* options aren't needed, but I haven't tried to run the program to find out. Those commands use unix syntax to refer to the current directory, so you'll need to change -I. appropriately. I think that'd be -I"" or -I "" on the Amiga. Robert Last edited by TCD; 18 October 2014 at 03:28. Reason: Back-to-back posts merged. |
16 October 2014, 18:25 | #6 | |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
Quote:
Robert, can you attach the changes you made. I know absolutely nothing about C code. I couldn't write a 'hello world' program in C if my life depended on it. I could do it in a dozen different assembly languages, but not C. I have no use for portability so C has never been a requirement for me. Last edited by TCD; 18 October 2014 at 03:29. Reason: Back-to-back posts merged. |
|
16 October 2014, 18:44 | #7 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 728
|
I've cross-compiled it, but I don't think it runs well. (on emulated A1200)
It ends up with "Errors: 352". If I compile it for linux, I get no error(s) on the output. "Errors: 0" Is that supposed to happen? Oh, and it's not C code. It's c++ Last edited by alkis; 16 October 2014 at 18:45. Reason: c++ remark |
16 October 2014, 20:25 | #8 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
Are these compiler errors or is the results from running it? If from running it, can you attach the Amiga executable so I can disassemble it and check it? Thanks!
C/C++/C#/C!/CC = it all equals some form for C. |
16 October 2014, 20:45 | #9 |
Registered User
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
|
The "Errors: xxx" is output from the compiled program after running all the individual tests.
|
16 October 2014, 20:50 | #10 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 728
|
Those were results from running it.
It's in the zone for you. (portable68k.zip) Needs ixemul.library and a pretty huge stack. I was getting crashes with 50k stack. So I went 'stack 2000000' (2mil) and got it running. |
17 October 2014, 02:08 | #11 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
Thanks... I will check it out!
Yeah, there is definitely something wrong with the compiled code. A real Amiga shows 352 errors as well. Last edited by TCD; 18 October 2014 at 03:30. Reason: Back-to-back posts merged. |
17 October 2014, 10:42 | #12 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
|
18 October 2014, 01:45 | #13 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
Code:
#include system.gs Main: lea HelloString(pc),a0 CALLFUNC OutputString rts HelloString .db "Hello World!",LF I am still stuck trying to get the portable68k code to work on an Amiga. Anyone have any ideas? Thanks!! Last edited by JimDrew; 18 October 2014 at 01:51. |
27 October 2014, 08:12 | #14 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,377
|
I am wondering how a compiled program can test cpu compatibility... Hum... Isn't this the task for pure asm instead ?
|
27 October 2014, 10:03 | #15 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
I haven't looked into the source, but it could be using some inline asm at critical points?
|
27 October 2014, 13:45 | #16 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,569
|
The 68k subdirectory contains a simple 68k emulator.
So I doubt the program makes any sense for the original poster, as just the emulator will be tested. |
27 October 2014, 13:47 | #17 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
In that case, you might as well run the program on a PC rather than try to make it run on Amiga?
|
27 October 2014, 15:42 | #18 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
The goal is to remove the "tester" portion so that it will run on a real 68K, not through the emulator. A bunch of us are after a means to test 68k CPU cores (software and FPGA based). This is the only thing I can find that will test all of the 68K instructions. If I can get this compiled to run on an Amiga, I can disassemble it and turn it into a 68K hunk that can be inc'd into any test code.
|
27 October 2014, 16:58 | #19 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
But testing an emulator and the real thing are very different tasks. With the emulator, the testing software can control the time stepping in the emulator and log all required data from the outside. It needs to run much faster than the system it is testing. This is somewhat equivalent to hooking up a digital analyzer to a real Amiga and logging all relevant signals.
I don't see how it is possible to reliably test the system you're running on, at least not if you're going for clock accurate timings. |
27 October 2014, 17:13 | #20 |
Registered User
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 742
|
We don't care about clock cycle accuracy. We are after something that will test every instruction with every possible addressing mode, and compare the results to what a real 68K would have. There are several bugs in the TG68K code for example with certain instructions being used in certain ways.
There are tons of testers for Z80, 6502, 6809, etc. but nothing we can find (other than this program) that will test the 68K series. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile issues using PhxAss | NovaCoder | Coders. Asm / Hardware | 51 | 30 December 2014 22:52 |
How compile WinUAE... | WCoder | support.WinUAE | 57 | 17 April 2014 17:42 |
Heart of the Alien: How to compile. | XDelusion | support.Apps | 10 | 28 December 2011 01:54 |
GFA compile | xc8 | Coders. General | 31 | 19 May 2009 18:21 |
Compile WinUAE ????? | Myriel | support.WinUAE | 14 | 10 January 2004 17:06 |
|
|