Monday 24 June 2013

Starting to learn assembly language - the journey begins... where do I start?!

Final goal?

Write a game for the Amiga 500.  Bonus goal would be for the same game to run on the Sega Mega Drive (Genesis), but I'll work that out once the first goal is achieved.

Lets start!

I have an Amiga 500, and as mentioned before I'll be following the Amiga Format Bullfrog tutorials for writing a game in assembly language (I'll be writing separate blog posts for each tutorial).  OK so tutorial 1 was pretty straight forward, very basic beginnings pretty much incrementing a register to move a sprite position and understanding some basics.  I've had a quick flick through ahead of the future tutorials and it's pretty obvious that I'm going to have to do some extra research!

OK after some quick googling, I've come across the following websites:

Through those links I was able to download numerous pdf documents, text file tutorials and lots of other people discussing assembler. Great!

A few people had mentioned particular books that they recommended, which then put me on a mission to hit ebay for real world BOOKS! Ebay books for 68000 processor

Real world books I've ended up with, should keep me going for a while!

"Lets get real"

OK so coding on the Amiga 500 is great, I have DevPac 2 and I can run simple examples.  However, this is going to take forever!  Not only is assembly language slow to code (especially when I'm learning), but one of the biggest draw backs is the lack of resources on the machine. As in, I can't just Google something and try it out.  My Amiga 500 is on my desk and sits next to my laptop so yes I can Google stuff, but I have no way to transfer files across other than typing out line by line. What do I do?

Ebay to the rescue again... I've purchased an Amiga 1200 (with a broken floppy drive - hopefully I will blog to explain how I will fix it).  The great thing about the Amiga 1200 is that you can connect it to the internet, and also use a compact flash card as a hard drive!! 4Gb!!  It's still in the post, but I expect I will try and code on the A1200 and once I'm up to speed I'll try and create boot disks with my tests and trials for the A500.  Remember my goal is to write a game for the Amiga 500 not Amiga 1200!


What next?

I've read through most of 2 68000 books, and I think it's becoming clear that I'm learning vanilla 68k assembly language.  I need some Amiga specific references.  I'm using DevPac 2, but maybe I need to get my hands of DevPac 3, AsmOne or some other assembler package?  And then find a reference + tutorials for that package?

I have stumbled upon Easy68k, this is an Editor, Assembler and Simulator for the 68000 that runs in Windows.  Again this looks like just vanilla 68k, but looks like a great way to learn the basics without crashing my Amiga ever time!

Do you still code in Assembler?!

Would love to hear from anyone who still codes in assembler, especially for the Amiga machines.  Or maybe if you used to?  Any hints or tips you could recommend?

Comment here or get involved on twitter: @rich_lloyd

3 comments:

  1. Hi there,

    Well, don't get me wrong here; I will not kill your dream about making a game for Amiga 500, I just want to kick you in the right direction.

    First thing first. You will get lots of trouble while porting your game to Sega Mega Drive. Why? Well, Amiga 500 and Sega Mega Drive are using two different hardware architecture. To be honest, the only thing they have in common is the Motorola 68000 CPU, but everything else is different. For instance, Amiga 500 only have support for eight hardware sprites while Sega Mega Drive can use up to 60 (okay, the Amiga can compensate this by the blitter but that’s another story). You can just compare the hardware spec on Amiga 500 and Sega Mega Drive on Wikipedia and you will soon understand what I mean.

    Secondly, I think using the Easy68k is a bad idea, this because it do not simulate the Amiga Hardware, only the 68000 CPU (what I have read anyway). So, to do this you need an Amiga Emulator such as WinUEA for windows. This is because the Amiga do not only use the CPU, it uses the Copper and Blitter as well. I could explain this even further but I think it’s better that you read Amiga Hardware Manual to understand how the Amiga works bottom and up.

    Last thing. I use vasm to cross-develop for Amiga, and testing my routines in WinUEA and transfer the final executable file to the Amiga via an IDE to SD-card converter. But I use AsmOne to debug small stuff, you can read Chaozers tutorial here: http://www.algonet.se/~chaozer/asmtut.shtml and I would recommend you to start with this tutorial http://www.palbo.dk/dataskolen/maskinsprog/ instead of that Easy68k tutorial.

    Good luck with your programming!

    (and hope I will crack your game in the future ;D)

    ReplyDelete
  2. Better off doing you're dev either in an emulator as mentioned above, or directly on the Amiga 1200/500.. Also as a hack, there is a way of using a Raspberry Pi as a disk drive emulator, as well as other means to replace the disk drive with something usable..

    Good luck, looking forward to what you can come up with.

    ReplyDelete
  3. What I'd love to get/make is a floppy emulator for my A500 that links via Bluetooth to my PC. then write a program on the pc that pauses the A500 (Like a freezer cartridge does) then upload a new ADF (generated from project files on the PC) then reset the A500 remotely. that'd be the best dev set up for this hardware hitting 68k coding.

    If you get what I mean :P

    ReplyDelete