
How to code a sine scroll on Amiga - erickhill
http://www.stashofcode.com/how-to-code-a-sine-scroll-on-amiga-5/
======
jepler
"So, it should be considered mandatory to read the documentation of a
technology to masterize this technology. By documentation, I mean the
reference manual, not a popularized version. The authors who popularize
documentation often treat it loosely, using shortcuts that lead to a dead end,
misleading talent and flattering mediocrity."

------
onion2k
I made one of these in JS a while ago -
[https://codepen.io/onion2k/pen/zPQvrv](https://codepen.io/onion2k/pen/zPQvrv)

And a nicer 2D wobble -
[https://codepen.io/onion2k/pen/rYgxdJ](https://codepen.io/onion2k/pen/rYgxdJ)

Porting old demo effects to browsers is a lot of fun.

------
kazinator
> _And it is far more easy to remember the contents of this stack than the
> contents of 13 registers._

Get a macro assembler, or at least a preprocessor; then give the registers
names.

~~~
chillingeffect
i think they mean its more about remembering which variables are in which
registers. i dont think macros can keep track of which registers are available
for new use.

~~~
kazinator
Macros help remember which variables are in which registers by giving alias
names to registers. I didn't think this requires explanation.

If a register is used for more than one purpose and there are multiple macros
aliasing for it which look like distinct variable, that could be a problem. If
there are enough registers so that a function can avoid this, then it isn't a
problem.

~~~
chillingeffect
i'm curious if you've written optimized code for these platforms...

it's not about remembering the registers within a routine. it's about
maximizing register use across several routines.

E.g. You call "circle" which uses registers d0-d3. Then it calls "line" which
uses d4 and d5. Then you _want_ to call "draw_point" which uses d3 and d7, but
you realize you don't want to stomp on d3, so you write an alternate version
of draw_point which uses d6 and d7 instead.

The OP is that platforms with few registers, such as x86, rely on the stack
and don't have this problem. Macros won't help either, bc it's not about
naming, it's about resource allocation. A good C compiler could do it well,
but OP was talking about programming in Assembly.

