;======================================================================= ; ; ; H P R S X ; ; RSX Loader For HP ; Programmer's Integer RPN Calculator ; ; by ; Terry Hazen ; 21460 Bear Creek Road ; Los Gatos CA 95030 ; ; Voice.......... (408) 354-7188 ; Zee-Machine.... (408) 245-1420 ; Ladera Znode... (213) 670-9465 ; ;======================================================================= ; ; Revision History ; ---------------- ; ; 02/02/91 Bumped version to match HP. Completely rewritten to ; v1.4 use RSXLDR.REL module to do all generalized environment ; checking, loading and relocation functions. HP14.PRL, ; the RSX version linked with ZML, is now appended to ; HPRSX14.BIN with CON20 to produce final utility. See ; HP14.Z80 for more information on RSX PRL generation. ; - Terry Hazen ; ; 08/11/89 Bumped version to match HP. Added WRITE function to ; v1.2 RSX to write calculator display directly to host ; program. ; - Terry Hazen ; ; 07/20/89 Initial release. ; v1.0 - Terry Hazen ; ;======================================================================= ; ; This module calls RSXLDR, which does all the work required to load and ; relocate the appended HPxx.PRL RSX module. It contains all the HP- ; specific routines needed by RSXLDR. Assemble and link using ZMAC/ZML, ; and rename the resulting COM file to BIN, as it can't be run at this ; point: ; ZMAC HPRSX;ZML HPRSX;RENAMZ HPRSX.COM *.BIN ; ; Finally, use Joe Wright's CON20 to append the RSX module, HP.PRL (see ; HP14.Z80 for information on producing the RSX module HP14.PRL): ; ; CON20 HPRSX.COM=HPRSX.BIN,HP.PRL / ; ;======================================================================= ; ; Plu*Perfect standard RSX header: ; ;RSX JP RSXSTART ; Entry - BDOS intercept ; 00H ; JP RSXWB ; Warm boot Intercept ; +03H ; JP RSXREMOVE ; Remove-RSX Entry ; +06H ;RSXWBA DW 0 ; Original Addr at 0001,2 ; +09H ;RSXPRO DW RSX ; Lowest RSX address in module ; +0BH ;RSXID DW RSXNAME ; Address of RSX name string ; +0DH ;RSXNXT JP 0 ; Next warm boot or CCP Entry ; +0FH ;NEXT JP 0 ; Next RSX or BDOS ; +12H ;NXTWB DW 0 ; Original BIOS+4 address ; +15H ; ;======================================================================= ; ; Equates ; TAB EQU 09 LF EQU 10 CR EQU 13 ; ; Program version ; VERS EQU 14 MONTH EQU 02 DAY EQU 15 YEAR EQU 91 ;======================================================================= ; ; Entry points for module-specific addresses and routines required by ; the RSXLDR module: ; PUBLIC Z3EADR,NAME,MHELP,MINST,MLDMSG,MREMOV,MTWIN ; ; From RSXLDR get: ; .REQUEST RSXLDR EXT RSXLDR,PRINT$NAME,M$NAME,RSX,CBIOS,RSXHIGH EXT COUT,PRINT,PHL4HC,$MEMRY ;======================================================================= ; ENTER: JP RSXLDR ; RSXLDR does all the work DB 'Z3ENV' ; ZCPR3 Utility DB 1 ; Type 1 Z3EADR: DW 0 ; Z3ENV address provided by ZCPR33+ DW ENTER ; ZCPR34 pad bytes ; NAME: DB 'HPRSX' ; Default CFG filename DB VERS/10+'0',VERS MOD 10+'0' DB ' ' ; 8 characters total DB 0 ; Termination ;======================================================================= ; ; RSX Configuration area ; INITCHR:DB 0 ; Character used to initiate RSX ;======================================================================= ; ; HP-specific routines called by RSXLDR: ; ;======================================================================= ; ; MHELP displays the command line help screen after RSXLDR displays the ; banner. ; MHELP: CALL PRINT DB 'Installs and removes the RSX module for the' DB CR,LF,' ',0 CALL M$NAME DB ' programmer''s integer RPN calculator.' DB CR,LF,LF DB 'Syntax:' DB CR,LF,' ',0 ; CALL PRINT$NAME DB ' - Install ',0 CALL M$NAME DB ' RSX module' DB CR,LF,' ',0 ; CALL PRINT$NAME DB ' [/]R - Remove installed ',0 CALL M$NAME DB ' RSX module' DB CR,LF,LF ; DB ' When the ',0 CALL M$NAME DB ' calculator module is installed:',CR,LF,0 ; ; RSXLDR also displays MLDMSG after RSX load/exists messages to allow ; the display of RSX commands. ; MLDMSG: CALL PRINT DB ' ^',0 LD A,(INITCHR) ; Get init character ADD 40H ; Make it displayable CALL COUT CALL PRINT DB ' - To invoke the calculator' DB CR,LF, DB ' ^C - To exit the calculator' DB CR,LF,0 RET ;======================================================================= ; ; MINST - does all required special installation of the HP RSX module ; after the RSX module has been relocated into high memory. ; Entry: HL,IX=address of loaded RSX, IY=address of local RSX ; MINST: LD A,(INITCHR) ; Get init character LD (IX+17h),A ; Move it to RSX ; LD DE,18h ; Get past RSX header and initchr ADD HL,DE EX DE,HL LD HL,(CBIOS) ; Move partial jump table to RSX module PUSH HL ; Save BIOS wb jump pointer LD BC,12 ; Length of table fragment LDIR ; POP HL ; Point to BIOS wb jump LD DE,7 ; Offset to conin address ADD HL,DE ; HL points to address of BIOS conin jump LD A,(IX+1) ; Move address of RSX conin intercept LD (HL),A ; to BIOS conin jump INC HL LD A,(IX+2) LD (HL),A ; LD HL,(6) ; Get protected address LD (IX+1),L ; Save as BDOS intercept LD (IX+2),H RET ;======================================================================= ; ; MREMOV - does all required special removal of the HP RSX module. ; Entry: HL=address of RSX removal routine, which is called after this ; routine. ; MREMOV: RET ; Nothing special here ;======================================================================= ; ; MTWIN - does any special routine required if we try installing the RSX ; when a copy is already loaded. ; Entry: None ; Exit: Z if ok to load anyway, NZ if we should abort ; MTWIN: OR 0FFH ; Abort if we're already loaded RET ; Nothing special here ;=======================================================================