[A83] Re: Ambivalent Ion programs
[Prev][Next][Index][Thread]
[A83] Re: Ambivalent Ion programs
Actually ION sets A to zero before jumping to programstart+1 so this won’t
work.
The code bellow will always execute TI-OS part.
Still, the best way is to check whether the returning address is in ROM or
RAM as I wrote before and Dan E. improved.
>From: "Henk Poley" <HPoley@DDS.nl>
>
>Yes, but I've thought about something else, Ion calls to progstart+1, so it
>jumps over the potential RET or XOR A (!).
>The TIOS (hmm, realy ZASMLOAD on the Ti-83) jumps to progstart...
>So it would execute the RET or XOR A.
>
>Well, since it doesn't matter if you put a RET or an XOR A in your
>Ion-header (Ion will ALWAYS load the lib-vectors, if you don't believe me,
>look at the source...) you could just do a check for A = 0.
>
>To be sure you also check if the zero-flag is set, it could be that Ion has
>set A to zero before jumping to your code.
>
>So it would be:
> > .nolist
> > #include "ion.inc"
> > .list
> >
> > #ifdef TI83P
> > .org progstart-2
> > .db $BB,$6D
> > #else
> > .org progstart
> > #endif
> > xor a
> > jr nc,start
> > .db "ION vs. TI-OS",0
> > start:
> jr nz,_Ion_start
> or a
> jr z,_TIOS_start
>_Ion_start:
> > bcall(_clrlcdf)
> > bcall(_homeup)
> > ld hl,txt
> > bcall(_puts)
> > bcall(_getkey)
> > ret
> >
> > _TIOS_start:
> > bcall(_clrlcdf)
> > bcall(_homeup)
> > ld hl,txt2
> > bcall(_puts)
> > bcall(_newline)
> > ret
> > txt:
> > .db "OK..Ion is cool!",0
> > txt2:
> > .db "I hate TI-OS!",0
> >
> > .end
> > END
>
>Should work (I think)
>
> Henk Poley
>
>
>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.