Re: A89: Run Down on some Things


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

Re: A89: Run Down on some Things




Thanks for the answers.. if I may elaborate to make sure I understand..
please see inside >>

Ahmed El-Helw <ahmed@ticalc.org>
   Program Ideas and Upcoming Programs
   the ticalc.org project - http://www.ticalc.org/
_______________________________________
http://hail.icestorm.com/asm/
ICQ: 3350394

>
>var: ds.w 10

is this defining var as a word with value 10?  .w = word i guess, and dc.b =
string or?  what's the 10 for, or is that the address or something? and if i
wanted another one, i would do var2: ds.w 11 or something?

>
> move.w (var),d0

this puts var into d0?  is this backwards in compared to the z80 where you
do ld a,(var), and here you do ld (var),a ?

> addq.w #1,d0

is addq = inc a or is addq add the words in d0 and #1.. so if i changed the
#1 to #2 it would add 2 to it or what?  and what's the number limit [65534
like hl?]

> move.w d0,(var)

i guess that just stores it back?

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

so there is no ".db", its all essentially ".dw", and whereas in z80 we have
.dw for two bytes, there is a 32-bit thing or something?

>
>>- 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.
>

i undertand.. a7 is like the sp in z80 then.. i think i see how that works
[since to display text you always do it]

>>- 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.
>

is it kinda like C++ where

int j=0;
int main(void)

would make j be accessable to any functions wheras if you did this

int main(void)
int j=0;

j would only be usable under main?  and what are macros used for?  everyone
has some kinda text macro at the top of their source codes...


>//Jimmy Mårdell

thank you for your help!



Follow-Ups: