03 February 2010, 16:08 | #1 |
Posts: n/a
|
How to start Amiga Programming? (ASM/C)
Hey,
I'm sure this has been asked many times, however... Can anyone point me to some guides for starting to program for the Amiga in ASM and/or C? Specifically, I'm interested in graphics (well, game dev) so anything about how to access OCS/ECS, Blitter... Copper etc I've been looking at ASM-One recently, is that a good assembler to use for e.g. A500 coding? Is it better to program the older Amiga's in ASM, or will C just be as fast (I guess that depends on the compiler?)? Finally, Is it better to learn 68K ASM from a "general" tutorial (since the 68K was used in many computers there must be many guides) or a tutorial/guide that's more Amiga specific? Thanks for any help, Alex. |
03 February 2010, 17:06 | #2 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
Quote:
Asm is the only choice if you want the fastest code (you can write parts of the code that are non speed critical in C of course), good optimized 68000 ASM code will always be faster than any compiled code, at least so far I beat any C Compiler on Amiga easily. |
||
03 February 2010, 18:01 | #3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
I don't know of any good guides or tutorials. The HWRM is something you need though as it says it's a reference and not much of a tutorial or guide on programming. Starting on the Amiga is not like taking up programming in Python or C# but it sinks in eventually so don't become discouraged if it seems too much at first.
ASM-One is neat and has lots of utility built in, though there are a few bugs. V1.20 works fine on the A500 with Kickstart 1.3, but the built in debugger requires 68020. You can download it from http://www.theflamearrows.info/. If you're used to Windows, OS X or Linux you might find that the ASM-One editor is a downgrade even from a standard edit box in more modern systems, and I usually recommend people to find a comfortable editor of choice and then check out vasm, vbcc and vlink. These are a macro assembler, a C compiler and a linker, and they make an excellent development suite. They're fully portable and easy to install and use via command line. I only keep ASM-One as a complement and for very quick testing myself. You can download the complete v-suite from Frank Wille's webpage at http://sun.hasenbraten.de/~frank/ When you've decided on a development environment you should get the 68000 programmers reference manual from www.freescale.com, and on http://cyberpingui.free.fr/sourcesMenu.htm you can find lots of intro source codes to have a look at. There are lots of people in this forum who know the hardware and graphics programming, and people are happy to help so if you get stuck then here's where you want to ask. |
03 February 2010, 22:26 | #4 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
IMHO when you are starting to code (read: just playing around a bit, testing things etc) you don't really want to deal with linkers, compilers etc. Thus I think ASM-One is perfect [if you intend to code asm that is ], all you need in one package, perfect for beginners. I see where you are coming from but for a beginner this is "too much" I think. Just my opinion of course. =)
|
03 February 2010, 22:59 | #5 | |
Registered User
Join Date: Aug 2004
Location: 19 Jump Street
Posts: 238
|
Quote:
Code:
vasm68k -m68000 -nosym -Fhunkexe demo.s -o out.exe Code:
sc demo.c -o out.exe To answer the original poster, coding 68k ASM on the Amiga is difficult when you first start off and requires dedication. Your first step would be to learn about the 68000 specifically, then get to the Amiga specifics. I would start with learning about registers, then moving onto basic instructions like moving around memory, loading in addresses, branching, comparing, etc. Once I'm comfortable with that, I would start with some Amiga specifics, like learning how to detect a mouse click and poking at $DFF180 to get pretty colors on screen After that, I would start with something like the copper. It's about this time that you look at the Hardware Reference Manual. I've found that the book Mapping The Amiga is an invaluable resource for some quick referencing. Look up mapamiga.txt on Google for links. In my mind, the ASM Course on Aminet ( http://aminet.net/package/dev/asm/Asm_course ) is by far the best tutorial to teach you the basics in a short time. Get it, extract it, and refer to the 1.s, 2.s, 3.s, etc. files in the "assembler course" directory. Once you have the basics down, start looking at sources to anything that you can find. Look for demos as they hit the hardware in some great ways. As for game development on the Amiga using C, no idea really. As I've said in another thread, there's never really been a good C game API on the Amiga. GameSmith has been uploaded to the Zone (might still be there) which might be good, but I've never used it to know. That might be worth checking out. |
|
04 February 2010, 09:27 | #6 | |||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
Quote:
My recommendation for a cheap and very good book on the 68000 is: http://www.abebooks.co.uk/servlet/Se...n=68000+Primer Cheapest price on this excellent book (not including shipping) is currently £0.64! If you like that you can then follow it with this by the same guys: http://www.abebooks.co.uk/servlet/Se...ing+by+example Also £0.64 and also excellent. |
|||
04 February 2010, 18:05 | #7 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,696
|
Hi and welcome
There are no books as accurate as the HRM, however it has basically no examples of 'how to actually do it' in assembler, so you *will* need an include file with the video etc register names it refers to. I agree Asm-One is a great all-in-one package and perfect for asm coding. Later versions might leave very little memory if you have an unexpanded machine, but I have put a zip of the Asm-One 1.02 disk folders in the Zone. It's excellent and has a small footprint. There are include files and examples on the disk, so you can look at them and look stuff up in HRM to understand what they do. If you don't know 68000 assembly language, go with one of the recommendations above but also download the 68000 programmer's manual from Freescale. It's perfect for looking up exactly what an instruction does. Learn to use the debugger and monitor, those are the tools of the trade to verify that you've programmed everything correctly Last edited by Photon; 04 February 2010 at 19:01. |
04 February 2010, 23:28 | #8 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 125
|
I've struggle a bit with AsmOne's debugger/monitor, especially for anything where I'm banging the hardware, cos I've not properly worked out how to use it. As soon as I've dumped stuff and setup my own copper list it seems to fall over. Best I seem to manage is dumping memory after running, or cutting and pasting specific bits of code into a separate file and stepping through them clean.
Are there any good docs for the latest version of AsmOne? I had a hunt about when I first got my Amiga online and only found a couple of really short AmigaDoc files. Sorry if that's a bit noob |
05 February 2010, 01:41 | #9 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
The AmigaOS needs to be running so ASM-One and its debugger in turn can run, so you can't turn multitasking or interrupts off, or poke the hardware other than possibly the audio, and I would guess that triggering interrupts and other exceptions might crash it as well. The debugger works for clean code as you said, verifying algorithms, program flow etc.
|
05 February 2010, 08:58 | #10 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@ korruptor - what Leffman said. If the code you're running through the debugger (same thing happens using the Devpac debugger...) kills the OS and takes over the system it takes the debugger with it.
What I do to get around this is take sections of my code that perform a certain operation I want to check works correctly and put these into "wrappers" - other little pieces of code I write that push all the values I need into the correct regs and contain any tables or data structures the code section needs to work correctly. Then I just step through this section of code using the debugger. That way the OS doesn't get killed and I get to see if the code works as intended. This method helps massively with me getting my code to work - I can usually instantly see why something doesn't work and why as soon as I see the wrong value appear in a register or an unexpected branch get taken etc. |
05 February 2010, 12:05 | #11 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 125
|
Yeah, that's what I'm doing already, just wondered if there were any other tricks. Tbh, I can probably get by with WinUAE for low level stuff, except the debug window is too big for the screen on my Netbook
Cheers all |
08 April 2010, 14:25 | #12 |
Posts: n/a
|
Woops, just found this thread... sorry I didn't reply sooner.
Thanks for all the responses, since I have some time off finally now I'll try and look at all these resources... Cheers, Alex. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wanting to start learning to code amiga in asm | fishyfish | Coders. Asm / Hardware | 5 | 03 March 2012 06:11 |
Programming Amiga? | Amiga Forever | Coders. General | 14 | 03 April 2011 18:33 |
Amiga Programming | JDunlap | request.Apps | 5 | 16 January 2008 05:29 |
Amiga programming | magnox | Coders. General | 6 | 28 April 2006 00:33 |
command line to start a confil + start the game | Unregistered | New to Emulation or Amiga scene | 4 | 17 October 2004 10:31 |
|
|