×   Main Menu ALL The 8BS News Manuals (New menu) Links Worth a Look Tools Disc and Basic Webring Site Map 8BS Guestbook Old Guest Book Me The Barnsley Rovers   
8-Bit Software

The BBC and Master Computer Public Domain Library

8075 Lookup Subroutine Name in FN/PROC Variable Lookup Table

Submitted by Steve Fewell

Description:

Store Y (a pointer to the end of the Subroutine Name) in &39.
Load the first character of the subroutine call (from (&37-&38) offset 1).
If the character is 'PROC-token' then jump to &808D with Y = #&F6.
If the character is 'FN-token' then jump to &808D with Y = #&F8.
The PROCedure lookup table is located at &04F6-&04F7 & the FuNction lookup table is located at &04F8-&04F9.

Routine &808D will return with the address (in &2A-&2B) of the variable (at &37-&38) where Y
points to the lookup table offset.

If A contains zero after the &808D routine has finished, then the subroutine name was not found.


Disassembly for the Lookup Subroutine Name in FN/PROC Variable Lookup Table routine

8075 9 132 057 84 39 STY &39
8077   160 001 A0 01 LDY#&01
8079 7 177 055 B1 37 LDA (&37),Y
807B   160 246 A0 F6 LDY#&F6
807D   201 242 C9 F2 CMP#&F2
807F   240 012 F0 0C BEQ 12 --> &808D Get address of Variable (where Y points to the page &4 lookup table offset)
8081   160 248 A0 F8 LDY#&F8
8083   128 008 80 08 BRA 8 --> &808D Get address of Variable (where Y points to the page &4 lookup table offset)

 


 Back to 8BS
Or