Hacker News new | ask | show | jobs
by unwind 5766 days ago
The Amiga remains magical to me, having grown up programming it and having had more "aahaa!" moments thanks to it than any other computer in particular.

I still have things like this, floating around in my brain somewhere[]:

  .loop: move.w $dff006,$dff180
         btst.b #6,$bfe001
         bne.s  .loop
It was so awesome, a computer with a great CPU, intriguing and poweful custom hardware for graphics/sound, and still a very decent operating system on top. It had it all. Sniff.

[] Somewhere slightly shady, since I mis-remembered the two first register addresses, and also the sign of the /FE0 bit being read by the third instruction. Still, it's been 14 years since I switched to Linux, so I'm kind of happy.

1 comments

What does this code do?
$dff006 is the vertical raster position register, $dff180 is the background color register, and $bfe001 is one of the registers belonging to one of the two CIAs of the Amiga; the piece of code copies 16 bits of data (on the amiga referred to as a "word") from $dff006 to $dff180, checks if bit 6 in $bfe001 is high - the bit that contains the status of the left mouse button of joy/mouse port #1 - and then branches back to the .loop label if the comparison resulted negatively - that is, if the bit was not high.

In plain-speak, it renders vertical green/blue/cyan gradients in the background until the left mouse button is pressed.

(as a side note, I spent 4-5 years coding on the Amiga in the early 90s.)