Re: A89: Run Down on some Things


[Prev][Next][Index][Thread]

Re: A89: Run Down on some Things




At 23:21 1998-12-05 -0500, you wrote:
>- can someone give me a rundown on variables [ex, the z80 equiv of let's say
>var: .db 0] and how to manipulate it [ld a,(var) \ inc a \ ld (var),a]...

var: ds.w 10

 move.w (var),d0
 addq.w #1,d0
 move.w d0,(var)

Note that in 68k, you usually always deal with words instead of bytes,
as the 68k is a 16-32 bit cpu.

>- is a0 the equivelent of hl? it is used for text and sprites then,
>depending on the loop?

Unlike many processors, few registers on the 68k have any special
function. For instance, the dataregister d0-d7 are all "equal" in
that no instruction uses them for a specific purpose. The same thing
can be said about the address registers, a0-a7, except that a7 is
used for the stackpointer (and the pea instruction always uses it)
and shouldn't be messed around with.

So, any register A0-A6 could be called "equivelent of hl" if you're
intending to use it as an address.

>- what's the "\blah" in compared to "blah:" what's the difference?

Variables starting with a backslash (\) are local variables. I don't
remember exactly how it worked, but in macros you need local variables
if you invoke the macro more than one time, since else the same variable
would occur more than once. You can alsu use local variables in other
places, but I don't remember if that had any effect. I know one reason
for the latter use - A68k doesn't allow that many ordinary labels and
can cause extremely strange error messages if you override this limit.

//Jimmy Mårdell

E-mail: yarin@acc.umu.se
Homepage: http://www.acc.umu.se/~yarin/


References: