问题
I would like to program an application for the Amiga, just for fun!
Please could someone post a step by step howto based on the following?
- Exactly what programming tools I should use, are there any already installed?
- Am I limited to plain text editors, or are there IDEs and debugging tools available?
- If no tools are already installed, how can this done? Are there free ones?
- I'd like to learn a traditional Amiga language, could you reccomend one?
- What should I use to compile the language you suggest?
- Please could you suggest tools I may use to debug the suggested language?
- Are there any libraries I should be aware of, such as GUI libraries?
Some things to note...
- I'm running Workbench 3.1 from within the WinUAE emulator.
- From Workbench, I can access files from my Windows hard drive.
- I'd like to code and compile it from Workbench if possible.
- I'm running WinUAE in A1200 mode, not sure if that matters.
- There's an application already installed called MEmacs.
- I know C++ and C# very well, maybe there's a similar Amiga language.
- I'm aware that you can code with C and C++, but I want to learn a new language.
Update:
I have answered my own question, but please do contribute more answers as I intend on extending my answer. Thanks to all that have contributed so far, you've been very helpful!
回答1:
Note: Please don't be put off answering; this is an ongoing thread.
Thanks for all your answers so far :-)
Spent a few days figuring it out. These instructions are for AMOS Pro, please feel free to either post your own answer for a different language, or update this answer (it's a community wiki).
Workbench Instructions:
- Install Amiga Forever 2008 (the plus version includes Workbench 3.1).
- Use either Amiga Forever or WinUAE as the emulator (I prefer WinUAE).
Install Amiga Workbench 3.1 to a custom hard drive.- If using WinUEA, just use the af_3x config file (installed with Amiga Forever).
- Familiarize yourself with Workbench and the Amiga Shell (see resources).
AMOS Pro Instructions:
AMOS Pro is an IDE which looks a bit like something off an old hacker flick, plus you can even turn on those irritating sounds you hear in the movies. Isn't that great? Anyway, on to the howto...
- Acquire the disks for AMOSPro (there are 6 disks in total in v2.00).
- Insert AMOSPro_System disk and install AMOS Pro as per the instructions.
- Once installed, open the AMOS_Pro directory, and run AMOSPro.
- If you don't know AMOS, learn some AMOS coding basics.
- Type:
Print "Hello world!"
- Press F1 to run (does the same as the red triangle to the right of the AMOS logo).
- Rejoyce as
"Hello world!"
appears in white text on an orange background. - TODO: Find out how to compile this as a binary (?) that can be run from Workbench.
AMOS Pro: Hello world! http://img7.imageshack.us/img7/7867/001tpe.png
Here's some more AMOS code for fun.
Input "Who are you? ";S2$
S1$="Oh, hello "
S3$=", nice to see you!"
Print S1$+S2$+S3$
Amiga Tips:
- [Left Amiga] is the Windows key, [Right Amiga] is the Context Menu key.
- Press [Left Amiga]+A to switch between AMOS Pro and Workbench.
- British [@ '] key produces either the # or @ (shift) character.
- British [~ #] key produces either the \ or | (shift) character.
- British [¬
] key produces either the ' or ~ (shift) or
(alt) character.
Resources:
- AMOS Factory - Forum and resources for AMOS
- Amiga Forever - My Amiga emulator package of choice (includes WinUAE)
- *
The Green Amiga Alien guide: Workbench 3.1 - Workbench customisation - Amiga stuff for newbies - Tips for Amiga Shell and Workbench
- Amiga OS Development - Forum category on on Amiga.org
*Not neccecary when using WinUAE Amiga Forever config (af_3x).
TODO:
I will try and do a howto for each language as follows.
- Draco (thanks to avery-payne)
- Amiga E (thanks to Paul Ruane)
- SAS/C (thanks to Hank)
- Modula-2 (thanks to JasonTrue)
- ARexx (thanks to Nik)
回答2:
This has to be the strangest and at the same time quite inspiring question.
Forgive me, as an ex-Amiga developer, I've given up on the platform. The idea of writing something now is, for me, quite abstract.
However, duty bound to a platform that once I believed could be number one I must diligently answer your questions.
Programming tools; either 68k assembler or C with SAS/C
Personally I always used CygnusEd for edtting, and I don't know of any IDE's. I think SAS/C had some sort of nebulous IDE but I can't be sure as a I only used the source level debugger (a very new thing at the time for me).
In terms of free tools I was involved in making GCC and libraries available on the Amiga, but I have no idea what happened to this project. There probably is something on my A3000 in the Barn, but little reason to find out.
The only traditional Amiga language is native 68k assembler. But you can do a lot with C providing that you've read the 15" of RKM in detail.
BTW Amos was rubbish. A toy in its time.
To debug I only ever used SAS/C (or Lattice as it was formally known).
Are there any libraries I should be aware of, such as GUI libraries?
Lots. To code effectively on the Amiga you really need to have learnt how a lot of things about the layers of the OS hang together. At the time this was the biggest hurdle pre-internet when information and knowledge was a lot harder to come by.
Workbench 3.1 is the first of the best. I could bore you with the details if only I could remember them.
The most similar Amiga language to C++ is C, and knowing C will only get you a small part of the way, as the devil is in the detail of the system calls/libraries.
If you want to learn a new langauge then maybe don't pick an almost dead platform.If I had time I'd be learning lua.
Amos is still rubbish, even now.
回答3:
You should certainly use an emulator -- a modern PC running UAE is a world apart from an A1200. You can run with a nice high screen resolution, and CPU performance orders of magnitude faster (if you want it to be faster that is, all optional of course). Oh, and you can actually access PC hardware through Amiga libraries provided by the emulator if you want.
The Amiga Reference Manuals would be the place to start if you want to hit the 'hardware'. Devpac was the assembler of choice for most people.
There were a few C compilers, and at least one C++ compiler, SAS/C. Here are links to a few more Amiga compilers
If you're looking to learn a new language then Modula-2 might be an option, but really C was the language of choice for most people. The OS itself was written in C (at least from 2.0 onwards -- BCPL prior to that), and the libraries all had C headers provided for accessing them.
Assembly language was hugely popular too for games and demos, and I can personally vouch for that being a whole lot of fun. Good books for this:
- Motorola Programmer's Reference Manual for 68k-68040, the most comprehensive book on the instruction set. Available free to download here
- Amiga Hardware Reference Manual, for a complete list of all the hardware registers, how they work and how to use them. Old copies for sale here
One other fun option might be the fairly powerful ARexx scripting language. You could do quite a lot with this, such as controlling other applications through their 'ARexx port' to gain access to their functionality. Much more high level than the other options, but quite easy to get it to do interesting things.
回答4:
There is the Amiga Developer CD 2.1 which contains everything needed: All the SDKs (including the classic ones for 1.3, 2.0 and 3.1, and the newer one for 3.5 that can also be used on 3.9 to my knowledge) and a suitable 68k C-Compiler.
It's still available from some vendors, and I remember writing some stuff with it. It's C, so it should be rather straight-forward.
No Support for AmigaOS4 though, but then again, Workbench 3.1 was the last real AmigaOS.
回答5:
Don't forget ARexx which comes with most Amiga installations. It is a truly wonderful language, surprisingly readable and easy to write. Most existing applications on the Amiga have hooks for ARexx so that you can cobble together larger applications from many smaller ones quite easily and efficiently. One of my favorite aspects of ARexx is its versatile string handling. Even though it is an interpreted language it is surprisingly fast, particularly if you made good use of its connection to other programs to do low-level stuff for it.
回答6:
Exactly what programming tools I should use, are there any already installed?
Basic and AREXX were the only languages to come pre-packaged, and even then, BASIC came in two dialects (ABasic, and AmigaBasic). You'll want to look at the Fred Fish collection or AmiNet for more tools.
For purchasing commercial compilers, try Amiga Developers CD that is available at Vesalia Online, although there may be others.
Am I limited to plain text editors, or are there IDEs and debugging tools available?
You're pretty much back to edit-save-compile-link-run-crash-whycrash-doh-fixit-edit cycle, IDEs are not readily available. I would look at something like DME (Dillon's Macro Editor), also available on the Fred Fish collection or AmiNet (http://wuarchive.wustl.edu/pub/aminet/). It provides some basic macro construction facilities that will help.
If no tools are already installed, how can this done? Are there free ones?
Yes. Again, Fred Fish, or AmiNet.
I'd like to learn a traditional Amiga language, could you recommend one?
Draco. It was written by Chris Grey. It's a little "primitive" but it should provide you with all that you need to get going, including the proper bindings and constants. The language is compiled and runs at speeds comparable to C.
What should I use to compile the language you suggest?
Manx or Lattice C were the C compilers of the time (if you can find them, good luck), with Manx tending towards 16bit and Lattice towards 32bit. There were a few tiny C-based compilers. There is 68k assembly (a neato instruction set IMHO), Draco, a pascal dialect, possibly Modula-2, as well as DICE (a free C compiler, but you're looking for something else)...
Please could you suggest tools I may use to debug the suggested language?
Again, commercial tools are far and few between, you're going to have to dig through the public domain archives to find anything.
Are there any libraries I should be aware of, such as GUI libraries?
The libraries are all built in. intuition.library is the name of the library that provides basic windowing support. gfx.library will provide you with high-level primitives, and layers.library will provide you with support for handing the unique bit-plane approach to graphics. Before you get that far, you'll want to look at exec, which was the heart & soul of the OS. It provides pre-emptive multitasking, built-in linked list primitives, message passing primitives, IO primitives, etc. and was heavily re-used throughout the system. If you understand exec, you'll understand the low-level innards of the rest of the system.
Keep in mind that the state of the system will look more like an embedded game console, as there will be no memory protection, SMP support, etc. All of these things could not easily be added due to design constraints that were introduced just before the first Amiga shipped. I seem to recall that the issue was surrounding how it would handle multiple processors and memory protection given that the entire microkernel runs in a non-priv CPU mode.
Last but not least, the magic number is 4, which is a memory address. That address is the pointer to the exec (which is not only a microkernel but also a library) and with it you can bootstrap into the rest of the system via OpenLibrary() calls. Libraries that could not be located will automatically be loaded from disk via AmigaDOS. This is how the Amiga dealt with the issue of portable code - all of the code was written using offsets into a pointer to the "base" of a library and there were no fixed addresses, other than address 4. Every library has a call table of 6 bytes per entry (a jump instruction) that then vectors off into the correct entry point. It was easy to write your own library, provided you had the correct format for your "header". Device drivers "borrowed" the structure of libraries and used the same concept to provide default I/O handlers.
Sorry if the names are slightly wrong, this information is off the top of my head from nearly 20 years ago...
There may be other avenues of information. Someone made an effort with a wiki and with some searching I'm sure you can find out even more.
Some things to note...
I'm running Workbench 3.1 from within the WinUAE emulator.
Cool. You're set. That was the last great "classic" workbench.
From Workbench, I can access files from my Windows hard drive.
It'll help, but you'll want to go "native" as much as possible.
I'd like to code and compile it from Workbench if possible.
See above.
I'm running WinUAE in A1200 mode, not sure if that matters.
It's the model of hardware you're emulating; it was a good budget machine, but try setting it for A3000 if possible, that was a nice high-end machine before Commodore had trouble.
There's an application already installed called MEmacs.
Give it a try, if Emacs is your thing...otherwise I would look at some of the native tools.
know C++ and C# very well, maybe there's a similar Amiga language. I'm aware that you can code with C and C++, but I want to learn a new language.
Then Draco is for you. It has most of the bindings for libraries, compiles cleanly, and it's officially a "dead" language given it's tied to a specific hardware platform. Very Amiga-specific. :)
Good luck! Let everyone know how it turned out...
回答7:
Emulators
- UAE
Operating systems
- AROS (an attempt at bringing back to life AmigaOS)
Programming resources
- Kickstart ;)
回答8:
Hey, if you want to do Amiga programming for fun, there is a NEW piece of software, that will rock your world:
Hollywood 4.5 from Airsoft Softwair
It is a very easy and fun language, mainly targeted at multimedia presentations. It's a scripting language, based on the Lua syntax, but it also reminds me a little of good old Amos because of it's many and powerful gfx and sound functions. It is very easy to use, comes with an excellent documentation and many examples. Also, it is multiplatform, the interpreter/compiler works on all the different Amiga platforms (incl. OS 3.1, AROS, MorphOS...), and the finished, compiled scripts even runs without effort on both Windows and Mac OS X!
You might find it a little pricy at 89 euros, but I can tell you that it is worth the investment, if you want to have fun programming, and I haven't seen anything like it on any other platform!
You might want to test one of my creations :-). It's a fighting game with real actors, it is done in Hollywood and the Windows version can be downloaded right here:
http://dl.dropbox.com/u/2920309/BEF-win32.zip
回答9:
There was a big programming tool for Amigas that had the same name as someone in the Bible....
AMOS
That was it.
回答10:
http://en.wikipedia.org/wiki/AmigaE
This was like C, but without the pointers. I still have my system API books at home somewhere.
回答11:
I was an Amiga programmer for some time and used 68k Assembly Language exclusively. The Amiga Reference Manuals were the bibles and indispensable. As for fun programs, I suspect most have been done to death on the Amiga... just search for any idea you have and I'm sure you'll find an existing piece of code.
Playing with the blitter was always fun for me but that's the area I was working in anyway.
回答12:
I'm sure you can find an emulator as other people have mentioned, but I wanted to add that Modula-2 was fairly popular with Amiga programmers.
回答13:
AMOS, as previously mentioned, is a pretty decent basic dialect, though I would probably take a look at Blitz Basic instead. Or straight 68k assembly using Asm-ONE of course. Asm-One is an IDE of sorts, just don't expect Visual Studio level support tools.
SAS/C was my weapon of choice on the Amiga platform, though there are ports of other C compilers as well.
回答14:
Step one, buy one of these.
Step two, buy one of these, and install it.
(You might also need to wait around for one of these to be invented.)
Step three, get up to 88 miles per hour.
来源:https://stackoverflow.com/questions/705863/how-do-i-code-and-compile-an-amiga-application