Re: A89: what can possibly be wrong?


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

Re: A89: what can possibly be wrong?




>This is my keylib.asm library:
>
>     include "doorsos.h"
>     xdef    _ti89
>     xdef    _ti92plus
>     xdef    _library
>     xdef    keylib@0000
>keylib@0000:
>     tst.w   (doorsos::kb_vars+$1C)      ; has a key been pressed?
>     beq \put_zero           ; if not, go to put_zero
>     move.w  (doorsos::MaxHandles+$1E),d0    ; puts the value of the 
>keypress
>into d0
>     clr.w   (doorsos::kb_vars+$1C)      ; clear key buffer
>     bra \done               ; exits out
>\put_zero
>         move.w  #0,d0
>\done
>     rts
>     end
>
>However, when l try to call this library from an program, l either get the
>message "function did not return a value" or "Illegal instruction" appears 
>on
>the status line and the program exits.  lt seems to me that whether or not 
>a
>key is pressed that a value is moved into d0, but yet the messages say no.
>What is happening?
>The C program is calling the library, and in doing so it stores whatever
>keylib@0000 returns in d0 into another variable.
>
>--TurboSoft
>

Well, sometimes shit happens: To get the key value into d0, make sure you 
replace 'doorsos::MaxHandles' with 'doorsos::kb_vars'

i.e.:

        move.w     (doorsos::kb_vars+$1E),d0

I believe this should work!

See ya,

Michael

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com