
Crash course to Amiga assembly programming - nallerooth
https://www.reaktor.com/blog/crash-course-to-amiga-assembly-programming/
======
matthewwiese
Awesome article OP, thanks for linking it here; I've been looking for
something along these lines for the Amiga for a while, actually.

Tangentially related: if you haven't already, I'd suggest dabbling in
development for these "retro" systems. Not only will they teach you about
memory management, &c but you will also be able to familiarize yourself with
architecture of decades past. Much like a Shakespearean scholar doesn't just
reader William's texts, but also attempts to understand the sociopolitical
climate in which they were written; so, too, ought a proficient programmer see
where she has come from to integrate not just "best practices" but an optimism
which guides her progress.

Or one could just read Stack Overflow. _shrugs_

~~~
jl6
I'm a huge Amiga fan, but what is there to learn from it that couldn't be
obtained by working at the lower levels of a modern system?

~~~
white-flame
Devices are memory-mapped without going through many nested protocols (USB,
PCIe, etc). What drivers do is completely transparent. Library calls are a
simple subroutine which jumps into the real details, without a privilege
barrier.

Much of the accessibility of the architecture is that it's a single address
space, with no MMU interference to speak of (later models had MMUs, but where
only used for a few enhancements here & there at best).

Besides, 680x0 code is _much_ more pleasant to deal with than x86. But that's
the case for pretty much any non-x86 ISA. ;-)

------
tezza
Nice to see articles on how to code from a modern host. Last time I coded
Amiga assembly was on an actual Amiga 2000. Blitter, Copper, non maskable
interupts, ahh the memories

as an aside, the VR community right now in 2017 is in the very early Amiga
stage. Theres Atari ST vs Amiga, ( Oculus vs Vive ). Also individual coders
can have a widely played and adopted game / experience. The games are fun and
not overly complex and there's some great early adopter communities ( /r/Vive
)

~~~
Flow
What did you use NMI for?

I've coded a lot of asm, blitter and coppper on the Amiga but I don't recall
ever using NMI's.

~~~
tezza
1) I think the debugger used it 2) I had an Action Replay that used it 3) It
existed 4) I had some off computer hardware I was talking to

memory a bit hazy !

------
tombert
It seems like every month or so on HN there's a new Amiga post, and this has
resulted in me becoming slightly obsessed with the machine (even though I
never had one as a kid since they weren't terribly popular in the US).

Learning the assembly sounds like it could be a fun weekend project, so thank
you!

------
josteink
The beauty of old school 68k assembly is _astounding_ compared to the
unstructured, messy piece of garbage that is X86 assembly.

Intel should be ashamed of themselves for 20 years later still not having
cleaned up their act.

~~~
hota_mazi
Indeed.

    
    
        mov esp, 0
    

"Move 0 into esp".

Seriously, X86? Who came up with that?

~~~
wolfgke
What is wrong with that? Besides the fact that the canonical way to zero a
register on x86 if flags are of no concern is

    
    
      xor reg,reg
    

(recommended way) or

    
    
      sub reg,reg

~~~
Jach
It's wrong if you try to read it as "move 0 into esp" because the source and
destination are reversed in code from how it's expressed in English. The way
to fix that is to use the other syntax, or change how you think of the
English. If read like Lisp, then it's "set esp to 0" and 'mov' is just a poor
mnemonic.

------
logiseye
If you think that article is awesome, you should fasten your seatbelts and
check out this video tutorials by Photon of Scoopex (Demo Group).

[https://www.youtube.com/watch?v=p83QUZ1-P10&list=PLc3ltHgmii...](https://www.youtube.com/watch?v=p83QUZ1-P10&list=PLc3ltHgmiidpK-s0eP5hTKJnjdTHz0_bW)

~~~
nallerooth
That looks awesome - thanks!

------
mrspeaker
Arrrgh! Great article (and there goes my weekend) - but this article reaches
my eyes 25 years too late. I would have killed for this information as a kid!

~~~
baldfat
I actually got started coding Assembly on the C64. I found the C64 was much
easier to code to. I keep telling my kids, "If I had youtube tutorials when I
was a kid I would be ruling the world."

------
mreid
I saw this at the end of the article, was hit by a huge wage of nostalgia, and
had to comment:

> Update 9.10.2015: exec.library base address is stored in > memory address
> $4. The library base address itself is not $4.

I learnt 68k assembler for the Amiga in high-school and made _exactly_ this
mistake. After many "guru mediations" (the flashing red and black box) and
much head-scratching I finally realized the problem.

It was a big breakthrough in my early days as a programmer and taught me a
solid lesson about indirection and pointers.

------
cr0sh
This was an interesting read, though I've never really delved into 68k
assembler, even when I was playing with the Amiga.

In the early 1990s I purchased an Amiga 2000, then a couple of years later an
Amiga 1200. A few years after that, Commodore "died" and I moved to a 486 and
Windows (though I had used a DOS-base laptop prior to that). A few years later
I move to Linux.

I still have my Amigas, and my 1080S - but I have no idea if any of it still
works; they haven't been booted in over 20 years (though I have kept them
stored well). I've thought about getting them running again; maybe someday
(I've got more actual retro hardware than I have time and space for,
honestly).

------
Jaruzel
Great Article!

The Amiga community is 100% alive and well, with new software and hardware
being developed all the time. If you were a fan of the Amiga then now is a
great time to jump back in and see the fun stuff that the community is doing.

------
1ba9115454
I'm tempted to jump back in. Back in the day programming involved books and a
lot of guess work. Now I can google the hell out of any problem.

------
sdnguyen90
A bit off topic:

I'm looking to get an Amiga mainly to run Octamed and get that Paula chip
sound. Can someone suggest a model to buy?

~~~
renaudg
Paula is exactly the same across the whole Amiga range AFAIK, so no difference
when it comes to sound.

Not sure how much resources Octamed requires though.

An A1200 with CF hard disk + ACA board seems like a safe bet

~~~
vardump
There are differences in audio low pass filters between different Amiga
models. It can't be ever entirely disabled. I think Amiga 1200 filter affects
the sound the least.

IIRC, AGA chipset (Amiga 1200, 4000) is also capable of up to ~56 kHz sample
rate.

OCS/ECS is just up to 28 kHz.

