English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 30 June 2017, 20:50   #41
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Thank you all for your generous contributions! This thread has proven to be way more valuable than I'd ever imagined. I should probably even change the subject, actually..

As mentioned earlier, I'll be fine with AsmPro for a while, being the noob that I am, experimenting on the quite-low-level hardware that I have. However, I'll hopefully reach the point were I'll have some of my own libraries, which should be reusable across projects and independently developable (not sure that's a word, though). Anyway, would that be the point to start looking out for the next step? Because that'll probably require some control over how things are compiled and linked -- ie, something like a makefile, I guess.

First on the list would be PhxAss, as it has been mentioned several times -- and not only by its developer. If I understand correctly, this is 'only' an assembler -- I mean, just like in the vasm scenario, you'd need a linker (eg, vlink) and an editor (and preferably also a debugger) on top of that to do the 'makefile scenario' above. Is this about right?

I'd also like to take a look at devpac, *the* reference m68k assembler. I'm not entirely sure what that means, but it sounds profound enough to at least give it a go. Can't seem to find it on aminet, however, and highsofts site seems to be abandoned. Where can I get it?
guy lateur is offline  
Old 30 June 2017, 21:20   #42
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by guy lateur View Post
As mentioned earlier, I'll be fine with AsmPro for a while, being the noob that I am, experimenting on the quite-low-level hardware that I have. However, I'll hopefully reach the point were I'll have some of my own libraries, which should be reusable across projects and independently developable (not sure that's a word, though). Anyway, would that be the point to start looking out for the next step? Because that'll probably require some control over how things are compiled and linked -- ie, something like a makefile, I guess.
Some things are much faster to code in C and performance isn't always important so you may want to mix assembler and C as well as breaking assembler code into modules. This is where vasm becomes more convenient, especially if cross-compiling/assembling. There are features, flexibility and optimizations which make some assemblers nicer than others. I really like assemblers which can optimize branches in both directions for example but this isn't as important for someone learning.

Quote:
Originally Posted by guy lateur View Post
First on the list would be PhxAss, as it has been mentioned several times -- and not only by its developer. If I understand correctly, this is 'only' an assembler -- I mean, just like in the vasm scenario, you'd need a linker (eg, vlink) and an editor (and preferably also a debugger) on top of that to do the 'makefile scenario' above. Is this about right?
PhxAss and vasm can both create an Amiga executable without an external linker.

Quote:
Originally Posted by guy lateur View Post
I'd also like to take a look at devpac, *the* reference m68k assembler. I'm not entirely sure what that means, but it sounds profound enough to at least give it a go. Can't seem to find it on aminet, however, and highsofts site seems to be abandoned. Where can I get it?
Devpac comes with an editor and debugger and is very professional. It is AmigaOS friendly and worked with RTG last I tried. It is certainly worth taking a look at. There should be versions on the EAB file server. The down sides are that the assembler is slower than vasm, it needs more resources than most other assembler environments and it is no longer supported.
matthey is offline  
Old 30 June 2017, 22:18   #43
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by matthey View Post
Some things are much faster to code in C and performance isn't always important so you may want to mix assembler and C as well as breaking assembler code into modules.
Well my original plan actually was to code in C. I'll be going for something demo-like, so performance might be an issue, but I could probably add some assembler code into the mix if necessary. Still, the most comprehensive beginner tutorial towards programming a demo is Photons series, afaik, so I decided to take a closer look at the assembler way. I haven't learnt how to break assembler code into modules, atm, I'm afraid..

Quote:
Originally Posted by matthey View Post
This is where vasm becomes more convenient, especially if cross-compiling/assembling.
Cross compiling is still on my to-check-out list. I've also been looking into this, btw: http://eab.abime.net/showthread.php?t=85474
I'm not really sure why I'm still trying to develop on the actual hardware, tbh. I'm used to code in visual studio, for crying out loud!

Quote:
Originally Posted by matthey View Post
PhxAss and vasm can both create an Amiga executable without an external linker.
Does that include the case when you only have an .object file of the lib you want to use? In visual studio parlance: can you reference a .dll/.lib file?

Quote:
Originally Posted by matthey View Post
Devpac comes with an editor and debugger and is very professional. It is AmigaOS friendly and worked with RTG last I tried. It is certainly worth taking a look at. There should be versions on the EAB file server.
Alright, I'll check that out.
guy lateur is offline  
Old 30 June 2017, 23:32   #44
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Saw this and made a small update to AsmTwo tonight (same link)

- supports absolute paths for all includes via : in path
- incdir "" to fix relative paths from older AsmOnes is not required anymore

The archive is compressed on Amiga and will preserve Amiga file system attributes, but only if decompressed on the Amiga. (Just a difference in file systems, my usual CLI 'magic' is "protect [file] rweds".)
Photon is offline  
Old 01 July 2017, 00:15   #45
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by guy lateur View Post
Does that include the case when you only have an .object file of the lib you want to use? In visual studio parlance: can you reference a .dll/.lib file?
A .dll (Windows Dynamic Link Library) or .so (Linux Shared Object) are shared link at run time objects but the 68k AmigaOS has nothing similar. AmigaOS 4 did introduce .so objects in PPC to make porting Linux code to the AmigaOS easier. Some people think this was a bad move and that they should convert all .so files to AmigaOS .library files as .so files are picky about having the exact version, they use CPU power at run time and the CPU needs efficient large PIC (Position Independent Code) support. PIC support on the 68000 is only efficient with small code sizes, the 68020 ISA is much better and I showed how a 68k ISA extension could make the 68k have one of the cleanest and most efficient large code PIC supports of any CPU not that very many people cared or noticed. I still don't know if .so files are a good idea to introduce to the 68k. It might be possible to build .so files for 68k AROS (I believe requires 68k ELF link files which AROS uses) already but I don't know of any support in AROS.

Link (at compile time) libraries for the 68k AmigaOS use the .lib suffix for SAS/C and vbcc (.lib files in Windows may be something completely different). GCC link libraries use the .a suffix. Usually .so or .dll files can be turned into link libraries for the 68k. You would need a linker for combining multiple link libraries (.lib) and/or object files (.o) at compile time. I use the linker all the time with a CED ARexx script (assemble+link) as the linker has more features. If wanting to share code, there is documentation on Aminet on how to make shared AmigaOS libraries (.library).
matthey is offline  
Old 01 July 2017, 02:11   #46
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
I used to use Devpac 3 and from what my memory tells me, I switched to AsmOne because Devpac didn't support some things like local labels.

I was using AsmTwo for a while but I switched to the latest version of AsmOne due to the extended features of the latest version of that and also for the support for assembling code for 68020+ and the FPU. If AsmTwo was branched off the latest version of AsmOne then AsmTwo would be epic.

Maybe AsmThree will be made one day combining all the features of everyone's favourite Amiga assemblers so we can then all universally agree that AsmThree is the assembler to use :P
Nightfox is offline  
Old 01 July 2017, 09:34   #47
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by guy lateur View Post
However, I'll hopefully reach the point were I'll have some of my own libraries, which should be reusable across projects and independently developable (not sure that's a word, though).
Yes, own libraries is a very good thing to have and makes your life easier. Can't live without mine.


Quote:
Originally Posted by guy lateur View Post
Does that include the case when you only have an .object file of the lib you want to use? In visual studio parlance: can you reference a .dll/.lib file?
You don't need to. In VS you include the .lib to either use some .dll or for use of stactically linked functions, but on the Amiga you just OpenLibrary() something and then call the functions.

However, as the average libs: dir is quite full of various libs from various people, it may be better to use simple include files containing your own reusable functions. By using conditional assembly you can avoid including what you don't use in your current project ; this is what i did.
meynaf is offline  
Old 01 July 2017, 16:50   #48
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by meynaf View Post
You don't need to. In VS you include the .lib to either use some .dll or for use of stactically linked functions, but on the Amiga you just OpenLibrary() something and then call the functions.

However, as the average libs: dir is quite full of various libs from various people, it may be better to use simple include files containing your own reusable functions. By using conditional assembly you can avoid including what you don't use in your current project ; this is what i did.
Well the .library approach may be a little clumsy to use, but it's well known and definitely something I'd like to know how to do. So I've been trying to assemble this project: http://aminet.net/package/dev/asm/Random250Lib. This should allow me to assemble the random250.library from its assembler source -- giving me both an example of how to do this and an actual random number generator (always nice to have). Remember I'm still using AsmPro.

When I first tried to assemble it, it gave a file error in the first include (Exec/Types.i). According to the AsmPro docs, I should put my include files in AsmPro:Include, but this unfortunately doesn't seem to work. I can only get it to assemble if I copy the exec folder (from Include_i, from NDK39) to the folder that contains the source. Neither of the above solutions seems satisfactory to me, as they both involve copying folders and files around. I could not find another way to add an include path to AsmPro. Am I missing something? Can I maybe set something like a (linux) symbolic link in my project folder to where the SDK actually is?

Also, having assembled it without errors, I can't see any output. I was expecting that it would generate the random250.library file, but it doesn't (I've renamed the one that came precompiled). Here also, I'm clearly doing something wrong. I guess it compiles to memory, and I should redirect that or something?
guy lateur is offline  
Old 01 July 2017, 16:53   #49
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by Photon View Post
Saw this and made a small update to AsmTwo tonight (same link)
Great to see you on this thread, Photon, and even better to see you're still working on this.

And many thanks for the tutorials; they're a real eye opener to me -- and I'm not even halfway through them..
guy lateur is offline  
Old 01 July 2017, 17:31   #50
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by guy lateur View Post
Also, having assembled it without errors, I can't see any output. I was expecting that it would generate the random250.library file, but it doesn't (I've renamed the one that came precompiled). Here also, I'm clearly doing something wrong. I guess it compiles to memory, and I should redirect that or something?
Ok, I need to assemble it and then use 'write object' to save to file, apparently..
guy lateur is offline  
Old 01 July 2017, 17:34   #51
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by guy lateur View Post
When I first tried to assemble it, it gave a file error in the first include (Exec/Types.i). According to the AsmPro docs, I should put my include files in AsmPro:Include, but this unfortunately doesn't seem to work. I can only get it to assemble if I copy the exec folder (from Include_i, from NDK39) to the folder that contains the source. Neither of the above solutions seems satisfactory to me, as they both involve copying folders and files around. I could not find another way to add an include path to AsmPro. Am I missing something? Can I maybe set something like a (linux) symbolic link in my project folder to where the SDK actually is?
Ah, the joy of system includes... Well, it's not for nothing that i just never use them

You don't need a symbolic link, just to find some include directory config in AsmPro - there ought to be some !
If you don't find how to do that (i can't help with AsmPro itself, sorry), at last resort some INCDIR directive in the source will do.
meynaf is offline  
Old 01 July 2017, 17:59   #52
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by meynaf View Post
You don't need a symbolic link, just to find some include directory config in AsmPro - there ought to be some !
One would think so, indeed, but I can't seem to find it. If anybody knows how to set this in AsmPro, please let me know.

Quote:
Originally Posted by meynaf View Post
If you don't find how to do that (i can't help with AsmPro itself, sorry), at last resort some INCDIR directive in the source will do.
Excellent advice, thanks, that works! Seeing as this will usually be very similar from project to project, I could even actually live with this.
guy lateur is offline  
Old 01 July 2017, 20:15   #53
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
My asm-one code compiles fine in asm-pro 1.17:
Code:
	INCDIR	"Work:Developer/Include/"
	INCLUDE	"intuition/intuitionbase.i"
	INCLUDE	"intuition/screens.i"
Just use INCDIR to point where you have all the include files.
a/b is offline  
Old 01 July 2017, 20:46   #54
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by a/b View Post
My asm-one code compiles fine in asm-pro 1.17:
Code:
    INCDIR    "Work:Developer/Include/"
    INCLUDE    "intuition/intuitionbase.i"
    INCLUDE    "intuition/screens.i"
Just use INCDIR to point where you have all the include files.
Thanks for your input, but we've (well, meynaf, really) already established this is indeed a working solution.

I'm still not sure this is actually the way you're supposed to do it, though. Is there really no way to set an (and preferably several) include path(s) in AsmPro? So you don't have to modify the source?
guy lateur is offline  
Old 01 July 2017, 22:10   #55
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Ah, damn... Yeah, I missed that somehow. After several reinstalls of windoze, drivers and other crap my eyes are bloodshot and my brain cells are too busy commiting suicide to pay attention to details ><.

Hmm, not sure. If it's heavily based on the original Asm-one source by R.G.M., which I think is the case, it only supports one include directory (which you can change multiple times with INCDIR).
a/b is offline  
Old 01 July 2017, 22:39   #56
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by a/b View Post
Ah, damn... Yeah, I missed that somehow. After several reinstalls of windoze, drivers and other crap my eyes are bloodshot and my brain cells are too busy commiting suicide to pay attention to details ><.
Don't worry about it; you apparently still have enough brain cells to point me into a working direction.

Quote:
Originally Posted by a/b View Post
If it's heavily based on the original Asm-one source by R.G.M., which I think is the case, it only supports one include directory (which you can change multiple times with INCDIR).
I still don't know how to properly set this include path in AsmPro, unfortunately, other than adding an IncDir in the source..
guy lateur is offline  
Old 01 July 2017, 23:07   #57
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Hmm, doesn't it use the default directory? You can set that by pressing ramiga-[. Then if you don't use INCDIR it should look for includes in that directory.
You can also use V (command line) to set it or print its contents (so it should tell you to what exactly it's currently set). Something like cwd/pwd change/print working directory on unix.
So in my case, I would use "V Work:Developer/Include/" and as long as all the includes are there it would work.
a/b is offline  
Old 02 July 2017, 09:42   #58
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by a/b View Post
Hmm, doesn't it use the default directory? You can set that by pressing ramiga-[. Then if you don't use INCDIR it should look for includes in that directory.
You can also use V (command line) to set it or print its contents (so it should tell you to what exactly it's currently set). Something like cwd/pwd change/print working directory on unix.
So in my case, I would use "V Workeveloper/Include/" and as long as all the includes are there it would work.
Yep, setting the 'default dir' to the system include path apparently seems to work. I thought that this was used for something else, though..
guy lateur is offline  
Old 02 July 2017, 09:46   #59
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Oh, and it also looks in the dir containing the source. (which was where I thought 'default dir' needed to point to for this to work)
guy lateur is offline  
Old 04 July 2017, 19:00   #60
Knocker
Registered User
 
Join Date: Jan 2016
Location: Santa Cruz/US
Posts: 48
The assembler you pick also depend on if you program on real HW, or if you use an emulator. I've been using WinUAE and started with DevPac 3, as that's what I used 20 years ago. But I quickly changed to using my favorite PC text editor and assembling with vasm. By doing that I'm not limited by the small screen size and the assemble time is instantaneous.
Knocker 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
AsmOne installation lunecat Coders. General 1 19 September 2015 00:05
Linker to use with AsmOne (68000) nandius_c Coders. Asm / Hardware 10 10 December 2014 11:53
Playing around with AsmOne on Winuae.. jimmy2x2x Coders. Asm / Hardware 13 18 November 2014 18:22
AsmOne: Undefined symbol copse Coders. Asm / Hardware 2 02 April 2012 01:41
AsmOne even directive...? pmc Coders. General 30 04 December 2009 09:33

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 18:02.

Top

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