home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / MODEMS / ZMODEM / ZMO-AL05.ZZ0 / ZMO-AL05.Z80
Text File  |  2000-06-30  |  17KB  |  710 lines

  1. ;
  2. ; Altos 8000/Series 5/model 580 overlay file for ZMP          Nov 24, 88
  3. ;
  4. ; ALTOS uses the Z80 SIO & 8430 CTC timer
  5. ;
  6. ;   The Altos Series 5 (or 580) running Cp/m 2.23s1 uses a bank-switched
  7. ;   bios that heavily uses the ix and iy registers. This creates a severe
  8. ;   conflict with the runtime package used by ZMP. The program will not
  9. ;   run unless the altos bios is patched to save the ix and iy registers
  10. ;   before any bank switch and restoring the registers after returning
  11. ;   from the switch. This cannot be done by pushing the registers onto
  12. ;   the stack.
  13. ;   A simple patch can be made that saves the ix and iy registers
  14. ;   to memory and restores them after bios calls. A sample code listing
  15. ;   is at the end of this file.
  16. ;
  17. ;-----------------------------------------------------------------------
  18. ;       Name:  ZMO-AL05.Z80
  19. ;
  20. ;       Dated Nov 22, 1988
  21. ;
  22. ;    Written by - Ron Murray, c/o Z-Node 62, 061-9-450-0200
  23. ;             Perth, Western Australia.
  24. ;
  25. ; 89/04/12 - Modified to ZMP v1.5        - George Conover
  26. ;       Modified to ZMP v1.4 standard Ken Reid    Nov 24, 88
  27. ;       Modified to ZMP v1.3 standard Ken Reid    Oct 17, 88
  28. ;    Modified to ZMP v1.2 standard Ron Murray Sept 15, 88
  29. ;
  30. ;-----------------------------------------------------------------------
  31. ;
  32. ;    System-dependent code overlay for ZMODEM
  33. ;
  34. ;   Insert your own code as  necessary    in  this  file.  Code  contained
  35. ; herein  has been written in Z80 code for use with M80 or SLR. Assemble
  36. ; as follows:
  37. ;
  38. ;    SLR ZMO-AL05/h
  39. ;    MLOAD ZMP.COM=ZMPX.COM,ZMO-AL05
  40. ;  or
  41. ;    M80 =ZMO-MH05.Z80
  42. ;    RELHEX ZMO-MH05
  43. ;    MLOAD ZMP.COM=ZMPX.COM,ZMO-AL05
  44. ;
  45. ;
  46. ; (Don't use L80 without changing the source  for  assembly  as  a  CSEG
  47. ; file.)
  48. ;
  49. ;-----------------------------------------------------------------------
  50. ;
  51. ; Notes on modifying this file:
  52. ;
  53. ;    C    requires  that functions do not change either index register (IX
  54. ; or IY). If your overlay requires either of these to be changed, ensure
  55. ; they are restored to the original values on return.
  56. ;
  57. ;    Since  collecting    parameters  from C functions can be tricky, only
  58. ; change the parts marked 'Insert your own code here'. Do NOT modify the
  59. ; jump table at the start. Do NOT modify the entry/exit sections of each
  60. ; function. Do NOT pass 'GO'. Do NOT collect $200.
  61. ;
  62. ;    Apart  from  defining  modem  functions,  this  file  also  defines
  63. ; terminal characteristics. Examples provided are for ADM-3A (with a few
  64. ; of my own additions). Modify to suit    your  own  terminal.  An  inline
  65. ; print routine is provided for printing strings in the usual way, usage
  66. ; is:
  67. ;
  68. ;              CALL    PRINT
  69. ;              DB    'required string',0
  70. ;
  71. ;-----------------------------------------------------------------------
  72. ;
  73. ;    Don't forget to set your clock speed at the clkspd variable.
  74. ;
  75. ;    If you find  your    overlay  exceeds  the  maximum    size  (currently
  76. ; 0500h),  you    will have to contact me for another version. If too many
  77. ; people need to do it, we haven't allowed enough room.
  78. ;
  79. ; Ron Murray Aug 15, 88
  80. ;
  81. ;-----------------------------------------------------------------------
  82. ;
  83. NO    EQU    0
  84. YES    EQU    NOT NO
  85. ;
  86. ; User-set variables
  87. ;
  88. CLKSPD    EQU    4        ; Processor clock speed in MHz
  89. DEBUG    EQU    NO
  90. ;
  91. ;Set the following two equates to the drive and user area which will contain
  92. ;   ZMP's .OVR files, .CFG file, .FON file and .HLP file. Set both to zero
  93. ;   (null) to locate them on the drive from which ZMP was invoked.
  94.  
  95. OVERDRIVE      EQU     'A'     ; Drive to find overlay files on ('A'-'P')
  96. OVERUSER       EQU     0       ; User area to find files
  97. ;
  98. USERDEF EQU     0145H           ; Origin of this overlay.  This address
  99. ;                ;   may change with subsequent revisions
  100. ; NOT user-set variables
  101. ;
  102. MSPEED  EQU     03CH            ; Location of current baud rate. 3C is normal
  103. OVSIZE    EQU    0400H        ; Max size of this overlay
  104. ;
  105.     .Z80            ; Use z80 code
  106.     ASEG            ; Absolute
  107. ;
  108.      IF    DEBUG
  109.     ORG    100H        ; So you can debug it with CEBUG, ZSID,
  110. ;                ;   etc.
  111.      ELSE
  112.     ORG    USERDEF
  113.      ENDIF            ; DEBUG
  114. ;
  115. ESC    EQU    1BH
  116. CTRLQ    EQU    11H
  117. CR    EQU    0DH
  118. LF    EQU    0AH
  119. BDOS    EQU    5
  120. ;
  121. ;
  122. ; Select one of the following two choices for your computer
  123. ;
  124. A8000   EQU     NO      ; Altos 8000 series
  125. SER5    EQU     YES     ; Altos series 5
  126. ;
  127. ;
  128.      IF    A8000
  129. PORT    EQU    28H    ; Your Z80 SIO base port (data or status)
  130. MDCTL1    EQU    PORT+1    ; Modem control port
  131. MDDATP    EQU    PORT    ; Modem data port
  132. MDRCV    EQU    01H    ; Modem receive ready
  133. MDSND    EQU    04H    ; Modem send ready bit
  134. MDTXE    EQU    01H    ; Modem send buffer empty, holding buffer empty
  135. ;
  136. BRPORT    EQU    32H    ; CTC port for baud rate
  137.      ENDIF        ; A8000
  138. ;
  139. ;
  140.      IF    SER5
  141. PORT    EQU    1EH    ; Your base port (data or status)
  142. MDCTL1    EQU    PORT+1    ; Modem control port
  143. MDDATP    EQU    PORT    ; Modem data port
  144. MDRCV    EQU    01H    ; Modem receive ready
  145. MDSND    EQU    04H    ; Modem send ready bit
  146. MDTXE    EQU    01H    ; Modem send buffer empty, holding buffer empty
  147. ;
  148. BRPORT    EQU    0EH    ; CTC port for baud rate
  149.      ENDIF        ; SER5
  150. ;
  151. ;
  152. ; Jump table for the overlay: do NOT change this
  153. ;
  154. CODEBGN    EQU    $
  155. ;
  156. JUMPTAB:JP    SCRNPR        ; Screen print
  157.     JP    MRD        ; Modem read with timeout
  158.     JP    MCHIN        ; Get a character from modem
  159.     JP    MCHOUT        ; Send a character to the modem
  160.     JP    MORDY        ; Test for tx buffer empty
  161.     JP    MIRDY        ; Test for character received
  162.     JP    SNDBRK        ; Send break
  163.     JP    CURSADD        ; Cursor addressing
  164.     JP    CLS        ; Clear screen
  165.     JP    INVON        ; Inverse video on
  166.     JP    INVOFF        ; Inverse video off
  167.     JP    HIDE        ; Hide cursor
  168.     JP    SHOW        ; Show cursor
  169.     JP    SAVECU        ; Save cursor position
  170.     JP    RESCU        ; Restore cursor position
  171.     JP    MINT        ; Service modem interrupt
  172.     JP    INVEC        ; Initialise interrupt vectors
  173.     JP    DINVEC        ; De-initialise interrupt vectors
  174.     JP    MDMERR        ; Test uart flags for error
  175.     JP    DTRON        ; Turn DTR on
  176.     JP    DTROFF        ; Turn DTR OFF
  177.     JP    INIT        ; Initialise uart
  178.     JP    WAIT        ; Wait seconds
  179.     JP    MSWAIT        ; Wait milliseconds
  180.     JP    USERIN        ; User-defined entry routine
  181.     JP    USEROUT        ; User-defined exit routine
  182.         JP      GETVARS         ; get system variables
  183.       JP    SETPORT        ; Set port (0 or 1)
  184.         JP      SPARE           ; Spare for later use
  185.         JP      SPARE           ; Spare for later use
  186.     JP    SPARE        ; Spare for later use
  187.     JP    SPARE        ; Spare for later use
  188.     JP    SPARE        ; Spare for later use
  189.     JP    SPARE        ; Spare for later use
  190. ;
  191. ; Screen print function
  192. ;
  193. SCRNPR:
  194. ;
  195.     CALL    PRINT
  196.     DB    'This function not supported.',CR,LF,0
  197. ;
  198. SPARE:    RET
  199. ;
  200. ; User-defined entry routine
  201. ;
  202. USERIN:    RET
  203. ;
  204. ; User-defined exit routine
  205. ;
  206. USEROUT:RET
  207. ;
  208. ; Get a character from the modem: return in HL
  209. ; It is not necessary to test for status
  210. ;
  211. MCHIN:    PUSH    BC
  212.     IN    A,(MDDATP)    ; Get the character in A
  213.     LD    L,A        ; Put in HL
  214.     LD    H,0
  215.     OR    A        ; Set/clear Z
  216.     POP    BC
  217.     RET
  218. ;
  219. ;Send a character to the modem
  220. ;
  221. MCHOUT:    LD    HL,2        ; Get the character
  222.     ADD    HL,SP
  223.     LD    A,(HL)        ; In A
  224. ;
  225.         PUSH    BC
  226.         LD      C,A
  227. MCHOUT1: IN     A,(MDCTL1)
  228.         AND     MDSND
  229.         JR      Z,MCHOUT1
  230.         LD      A,C
  231.         OUT     (MDDATP),A
  232.         POP     BC
  233.         RET                     ; Done
  234. ;
  235. ;Test for output ready: return TRUE (1) in HL if ok
  236. ;
  237. MORDY:
  238.     IN    A,(MDCTL1)
  239.     AND    MDTXE
  240.     JR    Z,MORDYX
  241.     LD    L,1
  242.     LD    H,0
  243. MORDYX:
  244.     LD    A,L        ; Set/clear Z
  245.     OR    A
  246.     RET
  247. ;
  248. ;Test for character at modem: return TRUE (1) in HL if so
  249. ;
  250. MIRDY:
  251.     IN    A,(MDCTL1)
  252.     AND    MDRCV
  253.     JR    Z,MIRDY1
  254.     LD    L,1
  255.     JR    MIRDYX
  256. MIRDY1:    LD    L,0
  257. ;
  258. MIRDYX:    LD    H,00H
  259.     LD    A,L        ; Set/clear Z
  260.     OR    A
  261.     RET
  262. ;
  263. ;Send a break to the modem: leave empty if your system can't do it
  264. ;
  265. SNDBRK:
  266.     LD    A,5
  267.     OUT    (MDCTL1),A    ; Send to the status port
  268.     LD    A,0F8H        ; DTR normal, send break tone
  269.     OUT    (MDCTL1),A
  270. ;
  271.         LD      HL,300
  272.     CALL    WAITHLMS    ; Wait 300 milliseconds
  273. ;
  274.     LD    A,5        ; Restore normal, 8 bits, DTR on, etc.
  275.     OUT    (MDCTL1),A
  276.         LD      A,0EAH
  277.     OUT    (MDCTL1),A
  278. ;
  279.     RET
  280. ;
  281. ; Test UART flags for error: return TRUE (1) in HL if error
  282. ;
  283. MDMERR:
  284.     LD    A,010H        ; Register 0, reset interrupts
  285.     OUT    (MDCTL1),A
  286.     IN    A,(MDCTL1)
  287. ;
  288.     LD    A,L        ; Set/clear Z
  289.     OR    A
  290.     RET
  291. ;
  292. ; Turn DTR (and optionally RTS) ON
  293. ;
  294. DTRON:
  295.     LD    A,05H
  296.     OUT    (MDCTL1),A
  297.         LD      A,0EAH
  298.     OUT    (MDCTL1),A
  299. ;
  300.     RET
  301. ;
  302. ; Turn DTR ( and RTS?) OFF
  303. ;
  304. DTROFF:
  305.     LD    A,05H
  306.     OUT    (MDCTL1),A
  307.     LD    A,078H
  308.     OUT    (MDCTL1),A
  309. ;
  310.     RET
  311. ;
  312. ;Initialise the UART
  313. ;
  314. INIT:    LD    HL,2        ; Get parameters
  315.     ADD    HL,SP
  316.     EX    DE,HL
  317.     CALL    GETPARM        ; In HL
  318.     LD    (BRATE),HL    ; Baud rate
  319.     CALL    GETPARM
  320.     LD    (PARITY),HL    ; Parity
  321.     CALL    GETPARM
  322.     LD    (DATA),HL    ; Data bits
  323.     CALL    GETPARM
  324.     LD    (STOP),HL    ; Stop bits
  325. ;
  326. ; <== Insert your own code here
  327. ;
  328.         PUSH    BC
  329.         LD      A,0             ; Select register
  330.     OUT    (MDCTL1),A
  331.     LD    A,018H        ; Throw out of mode
  332.     OUT    (MDCTL1),A
  333.     LD    A,04H        ; Select register
  334.     OUT    (MDCTL1),A
  335.         LD      A,044H          ; Set ASCII parameters (44=1, 4C=2 stop)
  336.         OUT     (MDCTL1),A
  337.         LD      A,03H           ; Select register
  338.     OUT    (MDCTL1),A
  339.     LD    A,0C1H        ; Enable receive
  340.     OUT    (MDCTL1),A
  341.     LD    A,05H        ; Select register
  342.     OUT    (MDCTL1),A
  343.         LD      A,0EAH          ; Enable send, 'DTR', RTS'- E8h = RTS OFF
  344.     OUT    (MDCTL1),A
  345. ;
  346.         LD      A,(BRATE)       ; Get the selected value
  347.     CP    1        ; 300 bps
  348.     JP    Z,OK300
  349.     CP    5        ; 1200 bps
  350.     JP    Z,OK1200
  351.     CP    6        ; 2400 bps
  352.     JP    Z,OK2400
  353.     CP    8        ; 9600 bps
  354.     JP    Z,OK9600
  355.         JR      SETBRX          ; Altos can't select over 9600 baud
  356. ;
  357. OK300:  LD      A,07H           ; set CTC mode
  358.         OUT     (BRPORT),A
  359.         LD      A,1             ; MSPEED 300 bps value
  360.         LD      B,BD300
  361.         JP      LOADBD
  362. ;
  363. OK1200: LD      A,47H           ; set CTC mode
  364.         OUT     (BRPORT),A
  365.         LD      A,5
  366.         LD      B,BD1200
  367.         JP      LOADBD
  368. ;
  369. OK2400: LD      A,47H           ; set CTC mode
  370.         OUT     (BRPORT),A
  371.         LD      A,6
  372.         LD      B,BD2400
  373.         JP      LOADBD
  374. ;
  375. OK9600: LD      A,47H
  376.         OUT     (BRPORT),A
  377.         LD      A,8
  378.         LD      B,BD9600
  379. ;
  380. LOADBD:
  381.         LD      (MSPEED),A      ; set baud in low memory
  382.         LD      A,B
  383.         OUT     (BRPORT),A
  384.         POP     BC
  385.         RET
  386. ;
  387. SETBRX: POP     BC
  388.         XOR      A              ; clear it
  389.         LD      (MSPEED),A      ; not a valid baud rate
  390.         RET
  391. ;
  392. ; Baudrate table
  393. ;
  394. BD300    EQU    52        ; 38400/300  converted to hex value
  395. BD1200    EQU    104        ; 124800/1200 converted to hex value
  396. BD2400    EQU    52        ; 124800/2400 converted to hex value
  397. BD9600    EQU    13        ; 124800/9600 converted to hex value
  398. ;
  399. ; <== End of your own code
  400. ;
  401.     RET
  402. ;
  403. BRATE:  DW      6               ; Baud rate:
  404.                 ; 0 = 110 baud    1 = 300 baud    2 = 450 baud
  405.                 ; 3 = 600 baud    4 = 710 baud    5 = 1200 baud
  406.                 ; 6 = 2400 baud 7 = 4800 baud    8 = 9600 baud
  407.                 ; 9 = 19200 baud
  408. PARITY: DW      'N'             ; Parity (will be 'N', 'E' or 'O')
  409. DATA:   DW      8               ; Data bits (will be 7 or 8)
  410. STOP:   DW      1               ; Stop bits (will be 1 or 2)
  411. ;
  412. ; Set the port. ZMP supplies either 0 or 1 as a parameter.
  413. ;
  414. setport:
  415.     ld    hl,2        ; get port number
  416.     add    hl,sp
  417.     ex    de,hl
  418.     call    getparm        ; in HL (values are 0 and 1)
  419.  
  420.                 ; <== Insert your own code here
  421.  
  422.                 ; <== End of your own code
  423.     ret
  424. ;
  425. ;-----------------------------------------------------------------------
  426. ;
  427. ; Video terminal sequences: these are for Adds-Viewpoint: Modify as you wish
  428. ;
  429. ; Cursor addressing
  430. ;
  431. CURSADD:LD    HL,2        ; Get parameters
  432.     ADD    HL,SP
  433.     EX    DE,HL
  434.     CALL    GETPARM        ; In HL
  435.     LD    (ROW),HL    ; Row
  436.     CALL    GETPARM
  437.     LD    (COL),HL    ; Column
  438. ;
  439. ; <== Insert your own code here, using values in row and column
  440. ;
  441.     CALL    PRINT
  442.         DB      ESC,'Y',0       ; ADDS-Viewpoint leadin
  443.     LD    A,(ROW)        ; Row first
  444.     ADD    A,' '        ; Add offset
  445.     CALL    COUT
  446.     LD    A,(COL)        ; Sane for column
  447.     ADD    A,' '
  448.     CALL    COUT
  449. ;
  450. ; <== end of your own code
  451. ;
  452.     RET
  453. ;
  454. ROW:    DS    2        ; Row
  455. COL:    DS    2        ; Column
  456. ;
  457. ;Clear screen
  458. ;
  459. CLS:    CALL    PRINT
  460.         DB      0CH,0
  461.     RET
  462. ;
  463. ; Inverse video on
  464. ;
  465. INVON:    CALL    PRINT
  466.         DB      0EH,0
  467.     RET
  468. ;
  469. ; Inverse video off
  470. ;
  471. INVOFF:    CALL    PRINT
  472.         DB      0FH,0
  473.     RET
  474. ;
  475. ; Turn off cursor
  476. ;
  477. HIDE:
  478.     RET
  479. ;
  480. ; Turn on cursor
  481. ;
  482. SHOW:
  483.     RET
  484. ;
  485. ; Save cursor position
  486. ;
  487. SAVECU:    RET
  488. ;
  489. ; Restore cursor position
  490. ;
  491. RESCU:    RET
  492. ;
  493. ;-----------------------------------------------------------------------
  494. ;
  495. ; Service modem interrupt
  496. ;
  497. MINT:    RET            ; My system doesn't need this
  498. ;
  499. ; Initialise interrupt vectors
  500. ;
  501. INVEC:    RET            ; Ditto
  502. ;
  503. ; De-initialise interrupt vectors
  504. ;
  505. DINVEC:    RET            ; Ditto
  506. ;
  507. ;------------------- End of user-defined code --------------------------
  508. ;         Do not change anything below here
  509. ;
  510. ; Modem character test for 100 ms
  511. ;
  512. MRD:    PUSH    BC        ; Save BC
  513.     LD    BC,100        ; Set limit
  514. ;
  515. MRD1:    CALL    MIRDY        ; Char at modem?
  516.     JR    NZ,MRD2        ; Yes, exit
  517.     LD    HL,1        ; Else wait 1 ms
  518.     CALL    WAITHLMS
  519.     DEC    BC        ; Loop till done
  520.     LD    A,B
  521.     OR    C
  522.     JR    NZ,MRD1
  523.     LD    HL,0        ; None there, result=0
  524.     XOR    A
  525. ;
  526. MRD2:    POP    BC
  527.     RET
  528. ;
  529. ; Inline print routine: destroys A and HL
  530. ;
  531. PRINT:    EX    (SP),HL        ; Get address of string
  532. ;
  533. PLOOP:    LD    A,(HL)        ; Get next
  534.     INC    HL        ; Bump pointer
  535.     OR    A        ; Done if zero
  536.     JR    Z,PDONE
  537.     CALL    COUT        ; Else print
  538.     JR    PLOOP        ; And loop
  539. ;
  540. PDONE:    EX    (SP),HL        ; Restore return address
  541.     RET            ; And quit
  542. ;
  543. ; Output a character in A to the console
  544. ;
  545. COUT:    PUSH    BC        ; Save registers
  546.     PUSH    DE
  547.     PUSH    HL
  548.     LD    E,A        ; Character to E
  549.     LD    C,2
  550.     CALL    BDOS        ; Print it
  551.     POP    HL
  552.     POP    DE
  553.     POP    BC
  554.     RET
  555. ;
  556. ; Wait(seconds)
  557. ;
  558. WAIT:    LD    HL,2
  559.     ADD    HL,SP
  560.     EX    DE,HL        ; Get delay size
  561.     CALL    GETPARM
  562. ;                ; Fall thru to...
  563. ; Wait seconds in HL
  564. ;
  565. WAITHLS:PUSH    BC        ; Save BC
  566.     PUSH    DE        ; DE
  567.     PUSH    IX        ; And IX
  568.     LD    IX,0        ; Then point IX to 0
  569. ;                ;   so we don't upset memory-mapped I/O
  570. ;
  571. ; Calculate values for loop constants. Need to have two loops to avoid
  572. ; 16-bit overflow with clock speeds above 9 MHz.
  573. ;
  574. OUTERVAL EQU    (CLKSPD    / 10) +    1
  575. ;
  576. INNERVAL EQU    (6667 /    OUTERVAL) * CLKSPD
  577. ;
  578. WAIT10:    LD    B,OUTERVAL
  579. ;
  580. WAIT11:    LD    DE,INNERVAL
  581. ;
  582. WAIT12:    BIT    0,(IX)        ; Time-wasters
  583.     BIT    0,(IX)
  584.     BIT    0,(IX)        ; 20 T-states each
  585.     BIT    0,(IX)
  586.     BIT    0,(IX)
  587.     BIT    0,(IX)
  588.     DEC    DE
  589.     LD    A,E
  590.     LD    A,D
  591.     OR    E
  592.     JR    NZ,WAIT12    ; 150 T-states per inner loop
  593.     DJNZ    WAIT11        ; Decrement outer loop
  594.     DEC    HL        ; Ok, decrement count in HL
  595.     LD    A,H
  596.     OR    L
  597.     JR    NZ,WAIT10
  598.     POP    IX        ; Done -- restore IX
  599.     POP    DE        ; DE
  600.     POP    BC        ; And BC
  601.     RET
  602. ;
  603. ; Wait milliseconds
  604. ;
  605. MSWAIT:    LD    HL,2
  606.     ADD    HL,SP
  607.     EX    DE,HL        ; Get delay size
  608.     CALL    GETPARM
  609. ;
  610. ; Wait milliseconds in HL
  611. ;
  612. WAITHLMS:
  613.     PUSH    DE
  614. ;
  615. W1MS0:    LD    DE,39 *    CLKSPD
  616. ;
  617. W1MS1:    DEC    DE
  618.     LD    A,D
  619.     OR    E
  620.     JR    NZ,W1MS1
  621.     DEC    HL
  622.     LD    A,H
  623.     OR    L
  624.     JR    NZ,W1MS0
  625.     POP    DE
  626.     RET
  627. ;
  628. ; Get next parameter from (DE) into HL
  629. ;
  630. GETPARM:EX    DE,HL        ; Get address into HL
  631.     LD    E,(HL)        ; Get low
  632.     INC    HL
  633.     LD    D,(HL)        ; Then hihi
  634.     INC    HL        ; Bump for next
  635.     EX    DE,HL        ; Result in HL, address still in DE
  636.     RET
  637. ;
  638. ;Get address of user-defined variables
  639.  
  640. getvars:
  641.        ld      hl,uservars
  642.        ret
  643.  
  644. uservars:
  645.        dw      overdrive       ; .OVR etc. drive/user
  646.        dw      overuser
  647.  
  648.  
  649.          IF     ($ - CODEBGN) GT OVSIZE
  650. TOOBIG:    JP    ERRVAL        ; Overlay is too large
  651.      ENDIF
  652. ;
  653.     END
  654.  
  655. ;--------------------------------------------------------------
  656. ;
  657. ;
  658. ; The bios jump table starts at 5700h in the cbios64.com file loaded at boot.
  659. ; Listed are the addresses used when patching this file.
  660. ; this code winds up at F6B0 after boot up.
  661. ; original code here, if yours doesnt look like this, then don't try this.
  662. ;
  663. ;57B0   LD      SP,(F757)
  664. ;57B4   LD      B,A
  665. ;57B5   LD      A,(F759)
  666. ;
  667. ; change next instruction
  668. ;
  669. ;57B8   OUT    9,A        change to   JP  0F644
  670. ;57BA   LD     B,A
  671. ;57BB   RET
  672. ;
  673. ;57BC   POP     HL
  674. ;57BD   LD      (F757),SP
  675. ;57C1   IN      A,9
  676. ;57C3   LD      (F759),A
  677. ;57C6   LD      A,18
  678. ;57C8   OUT     9,A
  679. ;
  680. ; change next instruction
  681. ;
  682. ;57CA   LD      SP,C000    change to  JP  0F650
  683. ;57CD   JP      (HL)
  684. ;
  685. ;57CE   LD  A,18
  686. ;57D0   OUT 9,A
  687. ;
  688. ;
  689. ;  add at 5744h , this area should be empty originally
  690. ;
  691. ;5744    LD      IX,(0F670)
  692. ;5748    LD      IY,(0F672)
  693. ;574C    OUT     9,A
  694. ;574E    LD      A,B
  695. ;574F    RET
  696. ;5750    LD      (0F670),IX
  697. ;5754    LD      (0F672),IY
  698. ;5758    LD      SP,0C000
  699. ;575B    JP      (HL)
  700. ;
  701. ; save changes as CBIOS64.new and make sure files are the same length
  702. ; then rename cbios64.old=cbios64.com and cbios64.com=cbios64.new and reboot
  703. ; and try it out.
  704. ;
  705. ; I take no responsiblity for whatever results from attempting this.
  706. ; make sure you have backups always.
  707. ; if your bios looks like this, then this will allow you to run
  708. ; ZMP, RZMP, QL40, and other programs that may not have worked before.
  709.  
  710.