public

Learning Assembler on Amiga #2 - Development Environment Setup

Learn how to build your first demo in assembler (you are not writing it, just yet) with vasm assembler and run it from your macOS machine.

6 years ago

Latest Post The Great Escape Tunnel by Mario Esposito public

In the previous lesson, I gave you the reasoning of why I am learning Amiga Assembler nowadays when there are so many other ways to use modern means than a boot in the past via an emulator. It's a hobby and revenge over when I couldn't wrap my head around the problem back when I was a teen.

In this lesson, we’re going to pick an assembler to work with. As a great community contributor, Henrik at Coppershare.org properly lists, that you have several options when it comes to choosing an assembler. Unless you have used something in the past that makes you feel more comfortable with shortcuts and other mechanical details, there isn’t a ton of difference between one or the other.

My dilemma of which one to pick was between VASM and Asm-One.

vasm is a portable and retargetable assembler to create linkable objects in various formats or absolute code. Multiple CPU-, syntax and output-modules can be selected.Many common directives/pseudo-opcodes are supported (depending on the syntax module) as well as CPU-specific extensions.

VASM is a pure assembler (multi-platform) with no other fanciness, such integrated editor and stuff like that. Reaktor.com has a very good article about an assembler crash course where vasm is used. Check it out. At the time when I started this new hobby of retro development, that article was too intense for me. If you do pick that option you may become a guru... Say in Raspberry PI.

Asm-One was built for Amiga by a German company called Rune Gram-Madsen (Also known as Promax), last time they sold it was in 1992. Its features should cover pretty much everything that an assembler newbie can wish for. The whole story written by who actually coded some of the latest incarnations is here. Have a read, enlighting!

Features

My choice has fallen on Asm-One. At this point, you probably guessed it. However, what you likely did not guess is that I am also going to provide a one-off vasm tutorial as I believe it will help the many that run into Reaktor.com article and got slammed as I did for lack of knowledge.

Code

All source code, from now on will be placed on this GitHub repo under the folder 68K. Eh! How original of me…

Lesson One (Off)

Before we go ahead and start typing our own code, let’s achieve one simple goal that can result in quite a rewarding moment if properly executed. The intent behind this exercise is to provide the help I didn’t find on Reaktor.com and to allow you to build up some brain muscles around the basics of deploying code.

Our objectives will be:

  1. Download the code for vasm
  2. Build it for your platform to generate Amiga (68K) code
  3. Download source code for an Amiga demo-intro from this great collection of demos
  4. Build that code using vasm
  5. Deploy on an Amiga (emulated or physical hardware)
  6. Open a bottle of wine and celebrate or just play Silk Worm which ever makes you screaming more

STEP ONE

If you don’t have the command wget installed. Via homebrew install it using

brew install wget

then use the following to download vasm

wget http://sun.hasenbraten.de/vasm/release/vasm.tar.gz

Unzip, walk into the folder where vasm has been unpacked and build the flavor of the compiler that we need to generate Amiga assembler 68000. This means, doing the following:

tar zxvf vasm.tar.gz
cd vasm
make CPU=m68k SYNTAX=mot

Using the same exact steps, we are going to download Amiga Down Under demo, unpack it, compile it using our brand new built vasm. Like so:

wget http://cyberpingui.free.fr/dl.php?id=800 -O aduintro1.zip
unzip aduintro1.zip
cd aduintro1
../vasm/vasmm68k_mot AmiDwnUnder.s -o AmiDwnUnder.bin -Fhunkexe -nosym

Now, the file that has been generated is AmiDwnUnder.bin and in its current form and structure, it says “I am an Amiga binary”. However, since we are going to copy it over our emulated Amiga environment we set up in lesson #1, we are going to use the following command to guarantee compatibility with the Amiga filesystem. From a terminal window type the following

file AmiDwnUnder.bin

If you are not sure about the UNIX command File, have a look at this guide.

In lesson #1 we set up our virtual folder-hard drive to AmigaHD. Copy the at .bin file in that folder. Boot your emulated Amiga.

Kick-Off

At this point you should see your Workbench, which looks something like this:

It is possible that the folder appears to be empty and that is only because probably you haven’t set the right option in the WB menu.

double click on AmiDwnUnder.bin, you will be asked to confirm that you want to launch the file.

Hit OK and enjoy the result of your work. The demo will kick in. To exit just hit the left button of your mouse.

Conclusion

We learned how to compile and use vasm. Learned a few UNIX commands in the process and successfully deployed an intro code. Of which you have the code and if you feel adventurous you can mess, build, rinse and repeat.

A99 out, see you next time.

Mario Esposito

Published 6 years ago