TI-BASIC:Keyhooks In Assembly

From Learn @ Cemetech
Revision as of 18:20, 24 February 2016 by Maintenance script (talk | contribs) (Initial automated import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Keyhooks in Assembly

First of all its important to know that Texas Instruments does not support keyhooks, secondly notice that this is an advanced topic you can of course read this but in order to let it proof usefull to you it is best if you understand Assembly quite well or at least are knowledgable with its terms. with that said, let's dive into it! every piece of keyhooking code begins with this

add a, e             ;This byte is not being run but it ensures that the pointer is valid in order to prevent
                     ;it from randomly executing some code.

Hooks are controlled by flags, those flags are located in IY+33 and in IY+36, both of them have a RAM area consisting of four bytes. Each of those RAM areas contains the "little endian" (procces the low bits first and then the high bits) pointer to the hook, than a page number and last but not least a byte that can be used as safe RAM for that hook. An example of a hook is the GetKeyHook, this hook is enabled using

b_call $4F7B

and disabled using

b_call $4F7E

more information on Keyhooks can be found [*http://www.detachedsolutions.com/forum/index.php?t=msg&th=1319 here]