English Amiga Board


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

 
 
Thread Tools
Old 24 July 2014, 13:39   #1
xArtx
Registered User
 
Join Date: Jun 2013
Location: Australia
Posts: 685
Inline ASM

Hi Guys,
I'm going to come back and annoy you lot again until a goal is achieved
I'm close to having the real hardware together for the first time in a long time
and I didn't start programming till I was done with the Amiga unfortunately.

I was wondering if inline assembler can be used in any Amiga C compiler,
and if that locks you into it's kind of "safe shell" that prevents you doing
hardware tricks without playing with the binary, etc. such as using real interrupts, etc. ?

Also is it a waste of time starting without a HDD?
I understand the ASM compiler has to at least write the compiled binary,
but for a tight assembler program is there a lot of disk access going on at compile time?
Cheers, Art.
xArtx is offline  
Old 25 July 2014, 00:43   #2
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by xArtx View Post
I was wondering if inline assembler can be used in any Amiga C compiler,
and if that locks you into it's kind of "safe shell" that prevents you doing
hardware tricks without playing with the binary, etc. such as using real interrupts, etc. ?
Assembler inlines work in most C compilers including GCC and vbcc. GCC has the most powerful inline assembler interface. Vbcc has a simpler interface that is easier to use, more readable and uses a more powerful assembler in vasm. They both give complete control in the assembler inlines so hardware tricks are possible with care not to destroy your C environment.

Quote:
Originally Posted by xArtx View Post
Also is it a waste of time starting without a HDD?
I understand the ASM compiler has to at least write the compiled binary,
but for a tight assembler program is there a lot of disk access going on at compile time?
Using a C compiler without an HD is going to be difficult because of limited storage space and slowness. I wouldn't recommend it without several MB of memory and a 68020+. SAS/C is probably the best Amiga compiler in such environments because of it's small footprint and smart buffering. It does support assembler functions but I'm not sure about it's assembler inline capabilities. If you are just using an assembler, then the requirements are much lower and development can be done on a low spec Amiga. There may be some cheaper hardware coming for 68000 Amigas that would give a much faster CPU, 128MB of memory, SD card for a HD, etc. that would be more than adequate for development. The fpgaArcade is also high enough spec for comfortable development using C while being reasonably priced.

Both vbcc and GCC have 68k cross-development compilers which provide a much nicer environment than low spec Amigas. AmiDevCpp is powerful and easy to use for 68k cross-compiling using GCC under Windows. Vbcc is lightweight with few dependencies for cross-compiling from many different operating systems and environments. AmiKit or AROS Vision using UAE give a highly functional and fast Amiga environment and allow a quick install of vbcc on many modern computers.

Last edited by matthey; 25 July 2014 at 00:48.
matthey is offline  
Old 25 July 2014, 03:47   #3
xArtx
Registered User
 
Join Date: Jun 2013
Location: Australia
Posts: 685
Thanks for the reply, I forgot a C compiler will be wanting to disk access digging for it's libraries etc. as well.
I'm only going for an A500, but looks like I need to look out for an A590 as well.
Cheers, Art.
xArtx is offline  
Old 25 July 2014, 05:05   #4
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by xArtx View Post
Thanks for the reply, I forgot a C compiler will be wanting to disk access digging for it's libraries etc. as well.
I'm only going for an A500, but looks like I need to look out for an A590 as well.
You could always buy one of these instead:

http://www.apollo-core.com/bringup/apolloPhoenix.jpg
http://i.imgur.com/7yqUiVh.png
http://i.imgur.com/ZBT7XNC.png

It should cost less than a used A590 and be out before the end of the year but not all the functionality will be available at first.

http://www.amiga.org/forums/showthread.php?t=67716
matthey is offline  
Old 25 July 2014, 17:18   #5
Megol
Registered User
 
Megol's Avatar
 
Join Date: May 2014
Location: inside the emulator
Posts: 377
Quote:
Originally Posted by matthey View Post
You could always buy one of these instead:

http://www.apollo-core.com/bringup/apolloPhoenix.jpg
http://i.imgur.com/7yqUiVh.png
http://i.imgur.com/ZBT7XNC.png

It should cost less than a used A590 and be out before the end of the year but not all the functionality will be available at first.

http://www.amiga.org/forums/showthread.php?t=67716
Nice! Just waiting for a A600 version now.
Megol is offline  
Old 26 July 2014, 13:24   #6
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by xArtx View Post
I was wondering if inline assembler can be used in any Amiga C compiler,
Yes, most C compilers support some form of inline assembly. But it is always compiler-specific, so it should be avoided. Better write your assembler functions into an external source, which you link to your C object files.


Quote:
and if that locks you into it's kind of "safe shell" that prevents you doing hardware tricks without playing with the binary, etc. such as using real interrupts, etc. ?
There is nothing like a "safe shell" in C either.
You can always access hardware registers. But in C you sometimes have to give the optimizer hints that you are reading or writing I/O registers, using the volatile keyword.
Of course, special supervisor instructions, like rte or movec usually cannot be generated in C (although vbcc has a __interrupt attribute to save all registers and return with rte instead of rts).
phx is offline  
Old 26 July 2014, 21:02   #7
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
This is for A500?

It's not a waste of time starting to code Assembler without a HDD (but you will probably want two floppy drives to avoid disk swapping). For C packages I don't know, but at least for Assemblers there are bootable disk images you can use to get started and then just format a source disk and stick it in DF1:.

The reason it's not a waste of time is your projects won't be very big at the start(?) and so you'll be programming while you wait for stuff.

Agree with phx, inline asm is useful if most of the code is in C. And if you're accessing the hardware directly, C won't protect you.

And don't mess around with old interfaces and clunky harddisks, there's the same CF card solutions as for A600/A1200 available for the A500 now, ACA500 and Kipper2k.
Photon is offline  
Old 26 July 2014, 22:30   #8
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by phx View Post
Yes, most C compilers support some form of inline assembly. But it is always compiler-specific, so it should be avoided. Better write your assembler functions into an external source, which you link to your C object files.
It used to be true that assembler inlines were always compiler specific. Both GCC and Clang/LLVM assembler inlines are compatible now and a common standard considering the popularity of both of these compilers. IMO, it's a good format that I would love to see vbcc+vasm adopt although it would be a lot of work.

Quote:
Originally Posted by Photon View Post
This is for A500?
Yes, the accelerator is planned for Amiga computers with a 68000 in a socket including the 500, 1000, 2000 and CDTV.

Quote:
Originally Posted by Photon View Post
It's not a waste of time starting to code Assembler without a HDD (but you will probably want two floppy drives to avoid disk swapping). For C packages I don't know, but at least for Assemblers there are bootable disk images you can use to get started and then just format a source disk and stick it in DF1:.

...

And don't mess around with old interfaces and clunky harddisks, there's the same CF card solutions as for A600/A1200 available for the A500 now, ACA500 and Kipper2k.
I can't imagine starting a project with unreliable floppies in this day and age. Not with cheap memory and cheap storage media.
matthey is offline  
Old 27 July 2014, 02:03   #9
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Matthey, I was just asking xArtx if his question was for A500. Can I read more about your accelerator somewhere?
Photon is offline  
Old 27 July 2014, 07:34   #10
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by Photon View Post
Matthey, I was just asking xArtx if his question was for A500. Can I read more about your accelerator somewhere?
Oh, sorry. xArtx posted that he was using a 500 in the 3rd post of this thread so I figured you were asking me about the accelerator. There is no official announcement or website about the accelerator yet. The best public information about it is in the amiga.org thread I linked to.

http://www.amiga.org/forums/showthread.php?t=67716
matthey is offline  
Old 27 July 2014, 16:21   #11
xArtx
Registered User
 
Join Date: Jun 2013
Location: Australia
Posts: 685
Well I don't actually have an Amiga yet, but I got a good 1084S recently, and am motivated to get my old A500 setup I once had.
I'm all for emulators, but it's the hardware that will get me programming I think.
xArtx 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
Tool to convert asm to gnu asm (gas) Asman Coders. Asm / Hardware 13 30 December 2020 11:57
Need an ASM manual VoltureX Coders. General 2 17 November 2011 15:24
for ASM programmers meynaf Coders. General 29 05 August 2010 10:00
Storm C V4...using inline assembler NovaCoder Coders. General 11 26 February 2009 12:10
ASM Uni Course BippyM Coders. Tutorials 27 18 September 2008 10:37

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 17:53.

Top

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