> how-to's > memory / tsr
>> how to program a "TSR"
i can't say TSR, but a lot of people know this word, so I'll use this. first
of all, look at the following graphic, it shows you, how the TI92 memory is
to create a TSR routine, you have to copy your routine to this "Fixed
memory area". So, now we have to find the fixed memory area. At the moment
I don't know where the fixed memory area starts, but when you search the first
space from the top, then it works (see MXMLib).
The top depends from the memory size. The top at 128Kb calculators is at 0x1ffff
and on 256Kb at 0x3ffff. To find out, how much memory the calculator has, you
have to check the bit 0 from the I/O port 0x600001. After this, the routine has
to find the first empty space, because there could be some stuff (Fargo kernel
The second difficulty is that the TSR routine won't be reallocated, so you have
to use relative branches and a pointer to the variables. You'll see an example
; Input d0 Size of the TSR routine
; Output a0 Pointer to the area
btst.b #0,($600001) ; How much memory?
\FindArea: ; Overread some stuff
Now, I'll show you a TSR routine (relative branches, variables, ...)
; Variables for the TSR routine
TSR_STUFF_LONG dc.l 0
TSR_STUFF_WORD dc.w 0
; Installing of a TSR
; Install the TSR (hook the interrupt!)
I hope this will help you!