Re: A89: Starting out assembly, need help
[Prev][Next][Index][Thread]
Re: A89: Starting out assembly, need help
>
>In a message dated 11/29/98 9:41:57 PM Eastern Standard Time,
>assets@eden.rutgers.edu writes:
>
>> move.w #10,a0 will move 10 into
>> the lower word of a0. On the other hand, indirect addressing moves an
>> immediate value or another register into the memory pointed to by one of
>the
>> address registers (those would be a0-a7): move.w #10,(a0) (the
parethesis
>> indicate indirectness) will move the word 10 into the memory addressed
by
>> a0; so, if a0 was $10000, then that instruction would move 10 into
>($10000).
>> The 68k is particular in indirect addressing in that you can only
indirect
>> address on even bytes of memory (otherwise you get the address error
>> exception)
>
>So this is sort of equivalent to the Indirection # in TI-Basic?
I don't know what indirection is in TI-BASIC (I haven't looked at the 89's
BASIC yet). But what you are doing is simply moving 10 to external memory
(RAM) rather than moving 10 to internal memory (registers). Address
registers are used as the _pointers_ to the external memory so that it can
be determined what memory should be addressed indirectly.
>
>> The pre-decrement and post-increment features of the 68k will increment
or
>> decrement the address register by a word or a longword. Pre-decrement
will
>> have this effect: move.w #10,-(a0) will decrement a0 (the pointer) by a
>word
>> and then move the word 10 into the new (a0).
>
>What does decrementing the pointer by a word mean?
Decrementing by two bytes, as opposed to decrementing by a longword (if it
was move.l #10,-(a0)), which would decrement by 4 bytes.
>
>> Post-increment will have the
>> effect: move.w #10,(a0)+ will move the word 10 into new (a0) and then
>> increment a0 by a word. These two addressing methods can be used to
fill a
>> large space (post-increment's faster than <move.w #10,(a0) / add.l
#2,a0>)
>> and are especially useful in pushing / popping.