From comp.sys.hp48 Wed Aug 5 22:16:58 1992 Path: seq!rock!stanford.edu!ames!sun-barr!cs.utexas.edu!rutgers!modus!gear!wolf!p10.f800.n33.z2.fidonet.org!Simone.Rapisarda From: Simone.Rapisarda@p10.f800.n33.z2.fidonet.org (Simone Rapisarda) Newsgroups: comp.sys.hp48 Subject: Some new ROM Entry Points to play with Message-ID: <69010.2A4663FD@wolf.sublink.org> Date: 22 Jun 92 20:53:55 GMT Sender: ufgate@wolf.sublink.org (newsout1.26) Organization: FidoNet node 2:33/800.10 - Italy UUCP Gate, Italy Lines: 248 The following is a list of the interesting ROM entry points (sorted by increasing address) I encountered on my HP48 rev E during my hackings. All of them should work on all the five ROM revisions. Maybe some of them are already documented but many definitions are better than none... As you can see there's not a great continuity in the following list, this is easely explained by the fact that these are all the entry points that were not documented and that I needed for developing my sys-RPL software. When it was possible I've named and documented them using the style of the similar already-documented entry points. Some of them are PMCs, sorry but I've forgotten to evidence them. The discovering of the not correctly documented ROM entry points is left as an exercise to the reader ;). I hope you won't have any problem trying to understand what I've written. ****************************DISCLAIMER************************************ If while using these ROM entry points your HP48 turns into a Sharp or CASIO calculator, or worst, into a Texas Instruments one, please consider that everyone should have the calculator that himself deserves ;-). ************************************************************************** RAP P.S. I would like to know if this list can be useful to someone. If so I will be happy to continue to post this kind of things. ============================================================================= 0172B ??? rescan Alarms ??? ( ) -> ( ) (PMC) 0426A DoWarning: Invalid Card Data 04546 WarnSTATUS ( --> # ) (0OK 1Alarm 2LowBat(S) 4LowBat(P1) 8LowBat(P2)) 04577 #>Warn$22 (0=Blank 1=Alarm 2=LowBat(S) 4=LowBat(P1) 8=LowBat(P2)) 047C7 if empbuf then keypr? else drop,F (1:SB)->(1:T/F) (2nib: a1E l23 r28) 06DDE ??? newob ??? (PMC) 077C2 SRRP? (1:SB) (is that library attached to homedir?) 081D9 GetBckpId (1:Backup) -> (2:Global, 1:True)/(1:False) (PMC) 081EE GetLib# (1:Library) -> (2:Syst Bin, 1:True)/(1:False) 08E73 Right Name/Number? (2:GlbNm/LclNm/SystBin, 1:Backup/Library)->(T/F) 08F86 PORTSto (3:Lib/Backup, 2:SystBin/GlobalName, 1:SystBin(Port#:1,2)) 09269 PORT0STO (2:Lib/Backup, 1:SystBin/GlobalName) 09287 if PORTSTATUS is ok then PORT@ (2:GlbNm/LclNm/SB(Lib#),1:SB(Port#)) 092E1 PORT0@ (1:GlobalNm/LocalNm/SB(Lib#))->(2:Backup/Lib,1:True)/(1:False) 09318 OVERPLIB@ (2:GlbNm/LcNm/SB(Lib#),1:SB(Prt#:0,1,2))->(2:Lib,1:T)/(1:F) 093D1 PORT@ (2:GlbNm/LclNm/SB(Lib#),1:SB(PortAddr))->(2:Bckp/Lib,1:T)/(1:F) 09408 PORTPu (2:GlobalName/LocalName/SystBin(Lib#), 1:SystBin(Port#:1,2)) 0948E BACKUP> (1:Backup) -> (1:Any(Content)) (PMC) 09453 PORT0Pu (1:GlobalName/LocalName/SystBin(Lib#)) (purge backup or lib) 0AB82 PORTRcl (1:SB(Addr))->(3:Backup/Lib,2:SB(nextAddr),1:True)or(1:False) 0BD54 OVEREQUALcase (PMC) 0D169 TICKS>%REP Ticks -> Alarm Repeat (1:Bin Int) -> (1:Real) 0DEAC put alarm in alarmlist (2:List-alarms, 1:List-alarm) -> (2:SB,1:List) 0DECF STOAlarms (1:List) 0E461 put alarm in alarmlist (3:list-alarms, 2:List-alarm, 1:SB-alarm#) 0E475 { M N } (list of Local Names) 0E58E internal STOALARM (3:Real-date,2:Real-time,1:Any-action) 0E5EF internal STOALARM (4:Real-date,3:Real-time,2:Any-act,1:Real-rept) 0E6D4 ABS, IP and assert TOS is a valid repeat factor (1:Real) 0E6ED STOALARM (4:Real-date,3:Real-time,2:Any-act,1:Real-rept) 0E76F DELALARM (1:Syst Bin) 0E78D PuAlarms 0EABE get alarm numb (2:List-alarm,1:List-alarms) -> (1:Syst Bin) 0EBA8 if copy TOS > AlarmsListSIZE then DROP & %0 else UNCOERCE (1:SystBin) 0EBD5 FINDALARM (1:BI(Ticks)) -> (1:SB(Alrm#:_AlarmsListSIZE+1_ifnotfound)) 0EC07 FindAlarm (2:AlarmsList, 1:BinInt(startTicks)) -> (1:SystBin) 0EE26 Add timetick to datetick (2:BI-datetick, 1:BI-timetick) 0EED0 alarm repeat -> Binary Integer (1:Real) 0EEDF deep int alarm repeat -> Binary Integer (2:BinInt0(lenghtAh), 1:Real) 0EF45 do intalarm (4:Any-act,3:Real-date,2:Real-time,1:Real-rept)->(1:List) 0EF72 add alarm repeat to datetimetick (3:BI0(len18h),2:Real,1:BI-dttick) 113F2 # of the first line of the cmdline displayed -> (1:Syst Bin \>= 1) 11402 add one to the command-line lines counter 11412 subtract one from the command-line lines counter 130CA RSZABUFF (Resize ABUFF to the standard size: 131 wide by 56 high) 13695 REDISPABUFF (redisplay ABUFF so that #0#0 is the upper-left pixel) 13F47 position (line) of the cursor in the command-line -> (1:SystBin >= 1) 15B13 ->STR (1:Any(if GlobalName/LocalName then cut away name delimiters)) 18536 DUP@_HERE (1:Global Name) 19350 DUPInRAM? (1:Any) -> (2:Any1, 1:True/False) 1A20B BYTES (1:Any) -> (2:#0h, 1:2.5) ;-) 1A23D BYTES (1:Any(RAMobject)) -> (2:Binary Integer, 1:Real) 1CA0D DROP%1 (drop and push %1) (1:Any) -> (1:1) 1CDB1 XEQTYPEARRY 1CDD4 TYPESEC ( 8, 18, or 19 ) 1D8A2 deep Internal GET (2:List,1:Real/List) 1F960 { ''num' } (List of one Local Name) 21176 TMENU (1:List/Global_Name/Local_Name) 215A1 PORTSTO (3:Lib/Bckp/Any,2:SB/GlbNm,1:SB(Port#:0,1,2)) 215D9 DUPGetPobjId (1:Backup/Lib) -> (2:Backup/Lib,1:GlobalName/SystBin) 215E8 GetLIB# (1:Library) -> (1:Syst Bin) 21624 >BACKUPT (2:GlobalName/LocalName, 1:Any) -> (2:Backup, 1:True) 21674 >BACKUP (2:GlobalName/LocalName, 1:Any) -> (1:Backup) 216D8 COMP>BACKUP (1:{ GlbNm/LclNm+2nib Any Any5nib }) -> (1:Backup) (PMC) 217A9 :: :: RSWAP 'R RDROP ; 'R :: RSWAP 'R DROP RSWAP ; COLA_EVAL ; 21C88 NSRRP?TOSRRP (1:SB) (if not yet attached then attach to homedir) 21D5E rcl info ($Name %Id #Addr) on libs attached (1: Directory) 21DB0 PORTStatus ( #Port --> #StartAddr #EndAddr Present_And_Not_Merged? ) 23879 { ''ioinprogress' } (List of one Local Name) 23903 { 'st' 'ofs' 'tok' } (List of three Local Names) 2530E ZERO5UNROLL 25D3A Counted Binary Integer (Lenght=100h) (used by the string parser) 269BD ??? is TOS an XLIB with LID > #700h? (1:Any) -> (1:True/False) ??? 269E7 HARDROMP? (is TOS in built-in ROM?) (1:XLIB Name) -> (1:True/False) 26A2D DUPROM-FNCT? (is TOS a built-in Function?) (1:Any) -> (1:True/False) 2856C OVEREQUALcasedrop 28585 DROPCOLACOLA 2AFAC RND0 (1:Real) 386A1 Update All Display Areas now if no key is in the buffer 386D8 STATUSWarning (Display a Warning if Alarm or Lowbat) 386EC FOURTEEN#AND 39072 SetDA3Temp 39086 if CmdLine then Setbit 2@7068A else Setbit 4@7068D (FREEZEstack) 390CC ClrDA1OK 390E5 ClrDA2Bad 39117 ClrDA2OK 391B2 SetDA23NoCh 391C6 SetDA13NoCh 3919E SetDA12NoCh 391EE SetDAsNoCh 39207 SetDA2Temp 39283 SetDA1ValidF 393D3 SetDA1NoCh 393E1 ClrDA1Ch 3940B ClrDA2aCh 39435 ClrDA2bCh 3945F ClrDA3Ch 3959C KEYINBUFF?DA1! (Update Status Area now if no key is in the buffer) 395BA DispStatus 39B85 KEYINBUFF?DA2! (Update Stack Area now if no key is in the buffer) 39BAD DispStack 3A1CA KEYINBUFF?DA3! (Update Menu Area now if no key is in the buffer) 3A7D5 EDITMENU (show edit menu) 3A87A CURSOR>LEFT (move cursor in command line) 3A924 CURSOR>RIGHT (move cursor in command line) 3A974 CURSOR>UP (move cursor in command line) 3AF73 smart VISIT (as key assignment) 3AF7D SmartVISIT 3B036 set alpha mode 3B095 enter Program-Entry Mode and start command line 3B12B DumbVISIT 3ECD0 build menulblgrb from next str add square if nextnext sysflag is clr 3ECEE build menulblgrb from next str add square if nextnext sysflag is set 3ED6B build dirlike-menulblgrb from next string 3EDA2 toggle system flag (1:Syst Bin) 3EE1A PRG?Keycase (If Prg-Entry Mode then DoNextKey&Ret else SkipNext&Cont) 3EE47 Ins in cmdln: LF nextnextitem SPC LF nextitem SPC, mv curs to last LF 3FE44 if <80h>, <40h> or then <1Eh>, <23h> or <28h> (1:SB(Key)) 3FF75 STDKeys? (are unassigned keys activated? -> True/False) 3FF86 SetSTDKeys (activate unassigned keys) 3FF97 ClrSTDKeys (deactivate unassigned keys) 40454 check TOS type and behave as TOS is assigned to a key/mnlbl (1:Any) 404A9 behave as TOS is assigned to a key/menulbl (1:String) 404BD behave as TOS is assigned to a key/menulbl (1:Unit) 404E5 behave as TOS is assigned to a key/menulbl (1:Program/Command) 4051C behave as TOS is assigned to a key/menulbl (1:XLIB Name) 4053F Funct? ins in cmdline w/ ALGsyntax else PRG?->EVALorINS (1:Cmd/Funct) 405BC behave as TOS is assigned to a key/menulbl (1:Algebraic) 405F3 behave as TOS is assigned to a key/menulbl (1:Any) 40625 >CmdLineSep (insert TOS in cmdline between two blanks (1:Any)) 407FB TakeOver' 4085A EQWTakeOver (:: :: ; ; a prog containing a null prog) 408C3 ->STR (1:Global name/Local name/Any) 40A6F StoExec1Name (store name of current prg (1:Cmd/Funct/GlbNm/XLIBNm)) 40A82 @Exec1Name (rcl name of current prg -> (1:Cmd/Funct/GlbNm/XLIBNm)) 40A9A ClrExec1Name (clear name of current program) 40AA8 Exec1Named? (Is the current program unnamed? -> (True/False)) 40BB5 ENTER (need command line) 40D4D ToggleUSER (toggle the user keyboard flag (-62)) 40D61 Set1USR (activate the user keyboard for one keypress) 40D93 NoCMDLINEcase (if no cmd-line then DoNext&Ret else SkipNext&Cont) 40DC0 InitMenu & SetDA12NoCh 40DD4 Insert next item (character) in cmdline 40DF7 Insert next item (string w/o LF) in cmdline, move cursor left one pos 41A14 RCL current dir 41DB5 ZEROSIX 41E00 #1+ROTDROP 41E78 ASN (3:Any, 2:Syst Bin, 1:Syst Bin) 41E8C DUP49{}N (DUP 48 times and 49 \->LIST (1:Any)) 41ECD DUP6{}N (DUP 5 times and 6 \->LIST (1:Any)) 41F13 0DELKEYS 42023 TRUE1PUTLAM (store True in last local(preexisting)) 420A0 keywait -> (2:Syst Bin,1:True)ifKey or (2:False,1:False)ifAlrm/AutOff 42159 keywait -> (2:Syst Bin,1:True)ifKey or (1:False)ifattn/Alrm/AutoOff 4256B CURSOR>LEFT (move cursor in command line) 426F1 CMDLINEBOTTOM? (is the cursor in the last line of the cmdline?) 4272D CMDLINETOP? (is the cursor in the first line of the cmdline?) 42AE4 behave as TOS is assigned to a key/menulbl (1:Character) 42BD4 behave as TOS is assgn. to a key/menulbl (DA1 Not Freezed) (1:String) 42BFC CKEditStr (if string contains char #0 then doerr #102h (1:String)) 42C5B DUP, #1, SB(firstLFpos(0ifnoLF), True(ifnoLF)/False(ifLF) (1:String) 42C74 2DUPNEWLINEPOS (2:String, 1:Syst Bin(LFoccurrence)) 42C92 behave as TOS is assgn. to a key/mnlbl (1:String w/ LF) 42CE2 behave as TOS is assgn. to a key/mnlbl (1:String w/o LF) 42D32 DumbEDIT 42D46 SmartEDIT 42D82 dumb EDIT (1:Any) -> (2:Any,1:True) if [ENTER] or (1:False) if [ATTN] 42DFF %DumbVISIT (1:Real) 42E13 %SmartVISIT (1:Real) 42E5E IDLAMDumbVISIT (1:Global Name/Local Name) 42E72 IDLAMSmartVISIT (1:Global Name/Local Name) 42E86 SAFE@_HERE, 'REVAL (this must exit with 1:T/F) and if True STO back 4365D IntSTACK (enter the Interactive Stack) 444C3 insert TOS in cmdline (1:String w/o LF) 44730 CMDLINELines (command-line lines counter -> (1:Syst Bin \>= 0)) 4488A NOCMDLINE? 44C31 MatrixWriter (enter the Matrix Writer with no matrix in it) 44FE7 >MatrixWriter (1:Array) -> (2:Array,1:T)if[ENTER] or (1:F)if[ATTN]) 53A4A CMDLINE? 53AD6 IgnoreAlm 5E4BD #1-get1 (<1h> - DUP <2h> + ROLL) 5F0CD TYPEIDLAMcase (if pop TOS=GlobalNm/LocalNm then do&ret else skip&cnt) 62A61 >ROMPTR (1:Any) 62A84 SAFEROMP@ (if XLIB resides in built-inROM(notHidden) then @ (1:Any)) 6381C ITEcase (if True then DoSkipRet else SkipDoRet) 63880 :: RSWAP 'R DROP RSWAP ; (pop next item in prevprev instr stream) 639DE :: RSWAP 'R 'R RSWAP ; (push next two items in prevprev instr stream) 639FC :: RSWAP 'R RDROP ; (push next item in PrevPrevInstrStream & kill it) 63AEC NOTcaseDROPFALSE (if false then drop, false & return else continue) 63DCB IMMcase (if Immediate Entry-Mode then DoNext&ret else SkipNext&cont) 68B7B EqWriter (enter the Equation Writer with no equation in it) 68BDA >EqWriter (1:Alg/Unit) -> (2:Alg/Unit,1:T)if[ENTER] or (1:F)if[ATTN] In the hidden ROM: 7FE06 XLIB 240 109 PORTPurge (2:GlbNm/LclNm/SB(Lib#),1:SB(Port#:-1,0,1,2)) The ROM address 7FE06 is valid only for ROM revision E 7FE48 XLIB 240 110 PORTPu (1:GlbNm/LclNm/SB(Lib#)) (look in every Port) The following two PMC should work on the Return Stack but I've not investigated: 14EA5 61897 ============================================================================= -- WolfNet BBS Pisa (Italy) Tel. +39-50-589050 300-14.4K Baud Matrix 2:332/602.0 Simone Rapisarda - via FidoNet node 2:33/800 UUCP: ...!gear!wolf!800.10!Simone.Rapisarda ARPA: Simone.Rapisarda@p10.f800.n33.z2.fidonet.org