A89: Re: help with assembly


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

A89: Re: help with assembly




> even
> get_string_stack:
> ;;;;;;;;;;;;
> ;
> ;Function ti take a string off the stack and return it
> ; to the memory location pointed to by (a2)
> ;  -> string must be 14 chars long
> ; a6 is volatile
> ;;;;;;;;;;;;;;
> move.l (a7)+,a6
> move.w #8,d1
> loop_strng:
> sub.w #1,d1
> beq     return(PC);

(PC) shouldn't not required here - Bcc is always relative.

> move.w (SP)+,(a2)+
> jmp loop_strng(PC)

Why not use "bra  loop_strng"?
Or a DBcc structure?

> even

Even is never necessary between code lines.
a2 must be even, though.

> return:
>         move.l a6,-(SP)

Store a6 back onto the stack.

> rts
> 
> will work fine, only it immediately jumps to the rts stamtement and
> bypasses
>      move.l  a6,-(SP).
> 
> I can get around this by putting a buch of nops after the
>    return:
> label, but I would like to know why the assembler is not calculating jumps 
> correctly.


 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF Quote follows:

"I can explain it in Dog, but you only listen in Human."
        -- Gaspode the wonder dog
           (Terry Pratchett, Moving Pictures)

----- Original Message ----- 
From: Harry Tuttle <harrytuttle89@hotmail.com>
To: <assembly-89@lists.ticalc.org>
Sent: Saturday, November 27, 1999 9:54 AM
Subject: A89: help with assembly




References: