Author: HP Subj: Supported Ram Entry Access Date: 07 Oct 1993 1. Purpose The purpose of this document is to explain how to get the RAM address of some of the formerly supported HP48S/SX RAM entry points in a way that will work for any version of the HP48S/SX/G/GX. It assumes you already know how to properly and safely use the entries. Some entries are accessible only in assembly language, some only in system RPL, and some in both. This material is transferred free of charge, as is. Hewlett-Packard makes no warranty, expressed or implied as to its performance. Hewlett-Packard specifically disclaims the implied warranties of merchantability and fitness for any particular purpose. Hewlett-Packard shall not be liable for any direct, indirect, special, incidental or consequential damages, whether based on contract, tort, or any other legal theory. Hewlett-Packard specifically will not offer any support concerning this material and grants no exclusivity for its use. Hewlett-Packard specifically does not offer this material as a product and does not commit to make this material available in the future as such. 2. Display Entries VDISP2 A 5 nibble pointer to the menu grob. System RPL: Use HARDBUFF2 which requires no input and returns a pointer to VDISP2 to the stack. Assembly: Read the new supported ROM location (addrVDISP2)+2 to get the RAM address. Example: D1=(5) (=addrVDISP2)+2 A=DAT1 A D1=A D1 -> VDISP2 VDISP A 5 nibble updateable pointer to the grob currently being displayed. System RPL: Use HARDBUFF which requires no input and returns a pointer to the stack. Assembly: Read the new supported ROM location (addrVDISP)+2 to get the RAM address. Example: D1=(5) (=addrVDISP)+2 C=DAT1 A D1=C D1 -> VDISP ADISP A 5 nibble pointer to the "stack" grob. System RPL: use ABUFF which requires no input and returns a pointer to the stack. Assembly: Read the ROM location (addrADISP)+2 to get the RAM address. Example: D1=(5) (=addrADISP)+2 C=DAT1 A D1=C D1 -> ADISP 3. Keyboard Entries DISABLE_KBD A 1 nibble location which disables keys when non-zero. Assembly: Read the new supported ROM location (adrDISABLE_K)+2 to get the RAM address. Example: D0=(5) (=adrDISABLE_K)+2 C=DAT0 A D0=C D0 -> DISABLE_KBD KEYBUFFER A 34 nibble RAM location, used to buffer keycodes. System RPL: Use GETTOUCH or REPKEY? to get key information. Assembly: Read new supported ROM location (adrKEYBUFFER)+2 to get RAM address. Example: D1=(5) (=adrKEYBUFFER)+2 A=DAT1 A D1=A D1 -> KEYBUFFER KEYSTATE A 13 nibble location holding the keyboard state. Assembly: Read the new supported ROM location (addrKEYSTATE)+2 to get the low 4 nibbles of the RAM address. Follow the example below to get all 5 nibbles: D1=(5) (=addrKEYSTATE)+2 A=DAT1 A D1=(5) (=IRAM@)-4 C=DAT1 A D1=C Set the high nibble of D1 D1=AS D1 -> KEYSTATE LINECOUNTg A 2 nibble location holding a copy of the last value written to the hardware LINECOUNT register. Assembly: Read new supported ROM location (addrLINECNTg)+2 to get RAM address. Example: D0=(5) (=addrLINECNTg)+2 A=DAT0 A D0=A D0 -> LINECOUNTg ORghost A 3 nibble location to keep a copy of the last value written to the hardware OR register. Assembly: Read new supported ROM location (addrORghost)+2 to get the RAM address. Example: D0=(5) (=addrORghost)+2 C=DAT0 A D0=C D0 -> ORghost 4. Flag Entries SystemFlags Only RPL access of system flags will work across all versions. Use SetSysFlag, ClrSysFlag, and TestSysFlag. UserFlags Only RPL access of system flags will work across all versions. Use SetUserFlag, ClrUserFlag, and TestUserFlag. 5. Miscellaneous Entries ATTNFLG A 5 nibble location holding the ATTN flag. System RPL: Use ATTNFLGCLR, ATTNFLG@, ATTN? Assembly: Read the new supported ROM location (addrATTNFLG)+2 to get the RAM address. Example: D0=(5) (=addrATTNFLG)+2 A=DAT0 A D0=A D0 -> ATTNFLG ClkOnNib A 1 nibble location. Nonzero contents ==> ticking clock. Assembly: Read new supported ROM location (addrClkOnNib)+2 to get the RAM address. Example: D1=(5) (=addrClkOnNib)+2 C=DAT1 A D1=C D1 -> ClkOnNib GraphPrtHook An 11 nibble location for a graphics print driver hook. Assembly: Read the supported ROM location (adrGraphPrtH)+2 to get the address of GraphPrtHook. Example: D1=(5) (=adrGraphPrtH)+2 A=DAT1 A A[A] -> GraphPrtHook D1=A D1 -> GraphPrtHook DSKTOP A 5 nibble updateable pointer to the top pointer on the data stack. Assembly: Use the supported routines D1=DSKTOP and D0=DSKTOP. TEMPENV A 5 nibble updateable pointer to temporary environments. Assembly: Read the new supported ROM location (addrTEMPENV)+2 to get the RAM address. Example: D0=(5) (=addrTEMPENV)+2 C=DAT0 A D0=C D0 -> TEMPENV TEMPTOP A 5 nibble updateable pointer to the top of TEMPOB. Assembly: Read the new supported ROM location (addrTEMPTOP)+2 to get the RAM address. Example: D1=(5) (=addrTEMPTOP)+2 C=DAT1 A D1=C D1 -> TEMPTOP TIMEOUTCLK A 1 nibble location which enables timeout when clear. Assembly: Read ROM location (adrTIMEOUTCLK)+2 to get the RAM address. Example: D1=(5) (=adrTIMEOUTCLK)+2 A=DAT1 A D1=A D1 -> TIMEOUTCLK uart_handshk A 1 nibble location holding XON/XOFF handshaking information. Assembly: Read new supported ROM location (adr_uart_hand)+2 to get RAM address. Example: D0=(5) (=adr_uart_hand)+2 A=DAT0 A D0=A D0 -> uart_handshk 6. Actual Addresses addrADISP 1265A addrATTNFLG 4226A addrClkOnNib 0E7D3 addrKEYSTATE 00D48 addrLINECNTg 136AC addrORghost 0188D addrTEMPENV 04E66 addrTEMPTOP 179E8 addrVDISP 1263A addrVDISP2 1264A adrDISABLE_K 047CF adrGraphPrtH 32CB6 adrKEYBUFFER 047DD adrTIMEOUTCL 42284 adr_uart_han 312DA ----- Note from Mika Heiskanen: Note that all the entries listed are addresses of the data loading commands, not the addresses of the data itself. All but addrKEYSTATE are loaded either with Dn=(5) or LC(5) so the entries should be used like: Dn=(5) (addrFUBAR)+2 r=DATn A [The command at addrKEYSTATE is D1=(4) =KEYSTATE] ---> Mika Heiskanen, mheiskan@delta.hut.fi ----- Another note from Mika: TestSysFlag etc all use a common ml subroutine that fetches the location of the flag and the mask to operate with. The subroutine is at the same address in revs E and M, but I don't have a chance to check other revs. For example the following could be used: =GetFlagA EQU #537BE * Input: A[A] = flag number Output: D0 = ->flag_nibble ST0 = UserFlag? C.XS = flag_nibble A.XS = mask R0[A] = saved D0 To set a user flag: | To clear.. | To test.. ------------------|---------------------|------------------ ST=1 0 | ST=1 0 | ST=1 0 GOSBVL =GetFlagA | GOSBVL =GetFlagA | GOSBVL =GetFlagA C=C!A XS | A=-A-1 XS | C=C&A XS DAT0=C XS | C=C&A XS | ?C#0 XS | DAT0=C XS | GOYES tstok | tstok [...] And if above is not somehow feasible then there's the following code that also is fixed in rev E and rev M. 1C637 =RCLSYSF 1C637 C36C1 CON(5) (*)+5 1C63C 8FB9760 GOSBVL =SAVPTR 1C643 1B5C607 D0=(5) =SystemFlags * addrSystemFlags ? 1C64A 6610 GOTO L_1C661 1C64E =RCLUSERF 1C64E 356C1 CON(5) (*)+5 1C653 8FB9760 GOSBVL =SAVPTR 1C65A 1B5D607 D0=(5) =UserFlags * addrUserFlags ? 1C661 L_1C661 1C661 1527 A=DAT0 W 1C665 2F P= 15 1C667 8FC2245 GOSBVL =PUSHhxs 1C66E 142 A=DAT0 A 1C671 164 D0=D0+ 5 1C674 808C PC=(A) ---> Mika Heiskanen, mheiskan@delta.hut.fi