[A83] Re: Special ram areas?
[Prev][Next][Index][Thread]
[A83] Re: Special ram areas?
> Van: Ronald Teune <rtwolf@gmx.net>
>
> Henk Poley:
> >Since you probably just want to put a 'patch' of code there I would use
> >LDIR (or LDDR):
> >
> > ld hl,code_for_stack
> > ld de,$FE6F
> > ld bc,size
> > ldir ; Load (HL) to (DE), BC bytes, increments
> >
> >That should be it...
>
> for two bytes it's a bit crappy.
Loading a two bytes 'program' to the stack? Just a jr??? Well anyways, then
I'd do:
#define first_byte $00
#define second_byte $00
ld hl,$FE6F-2
ld (hl),first_byte
inc hl
ld (hl),second_byte
> >Moving the SP down (and putting your code at >$FFFF) is not a good idea,
> >the TIOS sometimes resets the system (and FP) stack. Don't know how
often
> >this happens. Plus at return from an asm program it restored the SP
(saved
> >by TIOS), you could off coarse 'manualy' change that value...
>
> I once checked that, but TI restores the stack pointer after exiting, so
it
> won't help much probably.
Then you just need to know where the TIOS stores the 'backup-stackpointer',
overwrite that with your value, et voilá.
Henk Poley <><
Follow-Ups: