Difference between revisions of "83Plus:Hooks:9B80"

From WikiTI
Jump to: navigation, search
m (Comments)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category:83Plus:Hooks:By_Name|Library Hook]] [[Category:83Plus:Hooks:By_Address|9B80 - Library Hook]]
 
== Synopsis ==
 
== Synopsis ==
 
'''Name:''' Library Hook
 
'''Name:''' Library Hook
Line 20: Line 21:
 
== Comments ==
 
== Comments ==
  
If you place the following at 4087:
+
If you place the following at $4087:
  
 
  <nowiki> .db 96h, 0E2h
 
  <nowiki> .db 96h, 0E2h

Latest revision as of 06:52, 17 November 2006

Synopsis

Name: Library Hook

Hook Pointer Block Address: 9B80

Hook Enable BCALL: 4F63

Hook Disable BCALL: 4F6C

Hook Call BCALL: 4F5A

Hook Active Flag: 1, (iy + 34h)

This hook is available for apps' internal use and to interface with BASIC programs using the OpenLib and ExecLib functions.

Using the Hook

This hook is never used by the 83+ OS. On the 84+, it is used to implement the OpenLib( / ExecLib functions.

Comments

If you place the following at $4087:

 .db 96h, 0E2h
 .dw 100h, LibHookInfo

and the following anywhere on the first page of your app:

LibHookInfo:
 .dw 1
 .db 2, 0
 .dw LibraryHook

a BASIC program (on the 84+) can then call your hook.

  • First, the BASIC program calls the OpenLib( function with the name of your app as argument.
  • Your app's hook is enabled and bit 4, (iy+3Eh) is set to indicate that ExecLib is enabled.
  • When the BASIC program calls ExecLib, your app's hook is called.

Note that OpenLib and ExecLib are only valid in programs, and not in the homescreen entry or in equations.

Credits and Contributions

  • Michael Vincent: Analyzing the OpenLib/ExecLib interface on OS 2.21 and above.