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-MD05.Z80 < prev    next >
Text File  |  2000-06-30  |  14KB  |  702 lines

  1. ;  PROGRAM: ZMO-MD05.Z80
  2. ;  AUTHOR:  Ron Murray
  3. ;  VERSION: 1.5
  4. ;  DATE:  18 Sept, 1988
  5. ;-----------------------------------------------------------------------
  6. ;    This overlay is set up for a Morrow MD3 with a Freedom-100
  7. ;    terminal.
  8. ;-----------------------------------------------------------------------
  9. ; 89/04/12 - Modified to ZMP v1.5        - George Conover
  10. ; 89/03/15 - Removed the beginning remarks to make the file
  11. ;            smaller. If you need the remarks there are in the
  12. ;            file ZMP-BLNK.Z80             - George Conover
  13. ; 89/03/14 - Modified to ZMP v1.4        - George Conover
  14. ; 88/10/12 - Modified to ZMP v1.3        - Ron Murray
  15. ; 88/09/15 - Modified to ZMP v1.2        - Ron Murray
  16. ; 88/09/14 - First version of this file        - Ron Murray
  17. ;
  18. ;    Written by -
  19. ;      Ron Murray, c/o Z-Node 62, 061-9-450-0200, Perth, Western Australia.
  20. ;-----------------------------------------------------------------------
  21. ;
  22. NO    EQU    0
  23. YES    EQU    NOT NO
  24. ;
  25. ; User-set variables
  26. ;
  27. CLKSPD    EQU    4        ; Processor clock speed in MHz
  28. ;
  29. DEBUG    EQU    NO
  30. ;
  31. ;Set the following two equates to the drive and user area which will contain
  32. ;   ZMP's .OVR files, .CFG file, .FON file and .HLP file. Set both to zero
  33. ;   (null) to locate them on the drive from which ZMP was invoked.
  34.  
  35. OVERDRIVE    EQU    'A'    ; Drive to find overlay files on ('A'-'P')
  36. OVERUSER    EQU    0    ; User area to find files
  37.  
  38. ;------------------------------------------------------------------------------
  39. ;
  40. ; NOT user-set variables
  41. ;
  42. USERDEF    EQU    0145H        ; Origin of this overlay.  This address
  43. ;                ;   may change with subsequent revisions
  44. MSPEED    EQU    05CH        ; Location of current baud rate.
  45. OVSIZE    EQU    0400H        ; Max size of this overlay
  46. ;
  47.     .Z80            ; Use z80 code
  48.     ASEG            ; Absolute
  49. ;
  50.      IF    DEBUG
  51.     ORG    100H        ; So you can debug it with CEBUG, ZSID,
  52. ;                ;   etc.
  53.      ELSE
  54.     ORG    USERDEF
  55.      ENDIF            ; DEBUG
  56. ;
  57. ESC    EQU    1BH
  58. CTRLQ    EQU    11H
  59. CR    EQU    0DH
  60. LF    EQU    0AH
  61. BDOS    EQU    5
  62. ;
  63. ; My MD3 has a mod which feeds 4Mhz to the UARTs in lieu of 2Mhz.
  64. ; (recommended!)
  65. ;
  66. MODIFIED EQU    NO        ; Set to 'NO' for non-modified boards
  67. ;
  68. ; Morrow specific equates
  69. ;
  70. ; UART equates
  71. ;
  72. MDATA    EQU    0FEH        ; Base address of the 8251 UART
  73. MSTAT    EQU    0FFH
  74. RDA    EQU    1
  75. TBE    EQU    0
  76. ONHOOK    EQU    35H        ; !DTR
  77. ONLINE    EQU    37H        ; DTR
  78. ERROR    EQU    38H
  79. BREAK    EQU    3FH
  80. RESET    EQU    40H
  81. ;
  82. ; CTC equates
  83. ;
  84. CTC    EQU    0F0H        ; Base address of the 8253 CTC
  85. MODE    EQU    0BEH
  86. ;
  87. ;-----------------------------------------------------------------------
  88. ;
  89. ; Main code starts here
  90. ;
  91. CODEBGN    EQU    $
  92. ;
  93. ; Jump table for the overlay: do NOT change this
  94. ;
  95. JUMPTAB:
  96.     JP    SCRNPR        ; Screen print
  97.     JP    MRD        ; Modem read with timeout
  98.     JP    MCHIN        ; Get a character from modem
  99.     JP    MCHOUT        ; Send a character to the modem
  100.     JP    MORDY        ; Test for tx buffer empty
  101.     JP    MIRDY        ; Test for character received
  102.     JP    SNDBRK        ; Send break
  103.     JP    CURSADD        ; Cursor addressing
  104.     JP    CLS        ; Clear screen
  105.     JP    INVON        ; Inverse video on
  106.     JP    INVOFF        ; Inverse video off
  107.     JP    HIDE        ; Hide cursor
  108.     JP    SHOW        ; Show cursor
  109.     JP    SAVECU        ; Save cursor position
  110.     JP    RESCU        ; Restore cursor position
  111.     JP    MINT        ; Service modem interrupt
  112.     JP    INVEC        ; Initialise interrupt vectors
  113.     JP    DINVEC        ; De-initialise interrupt vectors
  114.     JP    MDMERR        ; Test uart flags for error
  115.     JP    DTRON        ; Turn DTR on
  116.     JP    DTROFF        ; Turn DTR OFF
  117.     JP    INIT        ; Initialise uart
  118.     JP    WAIT        ; Wait seconds
  119.     JP    MSWAIT        ; Wait milliseconds
  120.     JP    USERIN        ; User-defined entry routine
  121.     JP    USEROUT        ; User-defined exit routine
  122.     JP    GETVARS        ; get system variables
  123.       JP    SETPORT        ; Set port (0 or 1)
  124. ;
  125. ; Spare jumps for compatibility with future versions
  126. ;
  127.     JP    SPARE        ; Spares for later use
  128.     JP    SPARE        ; Spares for later use
  129.     JP    SPARE        ; Spares for later use
  130.     JP    SPARE        ; Spares for later use
  131.     JP    SPARE        ; Spares for later use
  132.     JP    SPARE        ; Spares for later use
  133. ;
  134. SPARE:    RET
  135. ;
  136. ;-----------------------------------------------------------------------
  137. ;
  138. ; Screen print function
  139. ;
  140. SCRNPR:    DS    0
  141. ;
  142. ; <== Insert your own code here
  143. ;
  144.     CALL    PRINT
  145.     DB    'This function not supported.',CR,LF,0
  146. ;
  147. ; <== End of your own code
  148. ;
  149.     RET
  150. ;
  151. ;-----------------------------------------------------------------------
  152. ;
  153. ; Get a character from the modem: return in HL
  154. ;
  155. MCHIN:    PUSH    BC
  156. ;
  157. ; <== Insert your own code here
  158. ;
  159. MCHIN2:    IN    A,(MSTAT)    ; Check for char waiting
  160.     BIT    RDA,A
  161.     JR    Z,MCHIN2
  162.     IN    A,(MDATA)    ; Read the char
  163. ;
  164. ; <== End of your own code
  165. ;
  166.     LD    L,A        ; Put in HL
  167.     LD    H,0
  168.     OR    A        ; Set/clear Z
  169.     POP    BC
  170.     RET
  171. ;
  172. ;-----------------------------------------------------------------------
  173. ;
  174. ; Send a character to the modem
  175. ;
  176. MCHOUT:    LD    HL,2        ; Get the character
  177.     ADD    HL,SP
  178.     LD    A,(HL)
  179. ;
  180. ; <== Insert your own code here
  181. ;
  182.     PUSH    BC
  183.     LD    B,A        ; Save the char
  184. ;
  185. MCHOUT2:IN    A,(MSTAT)    ; Check for uart ready
  186.     BIT    TBE,A
  187.     JR    Z,MCHOUT2
  188.     LD    A,B        ; Char in a
  189.     OUT    (MDATA),A    ; Send it
  190.     POP    BC
  191. ;
  192. ; <== End of your own code
  193. ;
  194.     RET            ; Done
  195. ;
  196. ;-----------------------------------------------------------------------
  197. ;
  198. ; Test for output ready: return YES (1) in HL if ok
  199. ;
  200. MORDY:    DS    0
  201. ;
  202. ; <== Insert your own code here
  203. ;
  204.     LD    HL,0
  205.     IN    A,(MSTAT)
  206.     BIT    TBE,A        ; Transmit buffer empty
  207.     JR    Z,MORDY1
  208.     INC    HL
  209. ;
  210. MORDY1:    DS    0
  211. ;
  212. ; <== End of your own code
  213. ;
  214.     LD    A,L        ; Set/clear Z
  215.     OR    A
  216.     RET
  217. ;
  218. ;-----------------------------------------------------------------------
  219. ;
  220. ; Test for character at modem: return TRUE (1) in HL if so
  221. ;
  222. MIRDY:    DS    0
  223. ;
  224. ; <== Insert your own code here
  225. ;
  226.     LD    HL,0
  227.     IN    A,(MSTAT)
  228.     BIT    RDA,A        ; Received data available
  229.     JR    Z,MIRDY1
  230.     INC    HL
  231. ;
  232. MIRDY1:    DS    0
  233. ;
  234. ; <== End of your own code
  235. ;
  236.     LD    A,L        ; Set/clear Z
  237.     OR    A
  238.     RET
  239. ;
  240. ;-----------------------------------------------------------------------
  241. ;
  242. ; Send a break to the modem: leave empty if your system can't do it
  243. ;
  244. SNDBRK:    DS    0
  245. ;
  246. ; <== Insert your own code here
  247. ;
  248.     LD    A,BREAK        ; 3Fh
  249.     OUT    (MSTAT),A
  250.     LD    HL,300        ; A 300 mS break
  251.     CALL    WAITHLMS
  252.     LD    A,ONLINE    ; 37h
  253.     OUT    (MSTAT),A
  254. ;
  255. ; <== End of your own code
  256. ;
  257.     RET
  258. ;
  259. ;-----------------------------------------------------------------------
  260. ;
  261. ;Test UART flags for error: return YES (1) in HL if error.
  262. ;
  263. MDMERR:    DS    0
  264. ;
  265. ; <== Insert your own code here
  266. ;
  267.     LD    HL,0
  268.     IN    A,(MSTAT)
  269.     AND    A,ERROR        ; 38h
  270.     JR    Z,MDMER2
  271.     INC    HL
  272. ;
  273. MDMER2:    DS    0
  274. ;
  275. ; <== End of your own code
  276. ;
  277.     LD    A,L        ; Set/clear Z
  278.     OR    A
  279.     RET
  280. ;
  281. ; <== Put your own code here
  282. ;
  283.     CALL    PRINT
  284.     DB    'This function not supported.',CR,LF,0
  285. ;
  286. ; <== End of your own code
  287. ;
  288.     RET
  289. ;
  290. ;-----------------------------------------------------------------------
  291. ;
  292. ;Turn DTR ON
  293. ;
  294. DTRON:    DS    0
  295. ;
  296. ; <== Insert your own code here
  297. ;
  298.     LD    A,ONLINE
  299.     OUT    (MSTAT),A
  300. ;
  301. ; <== End of your own code
  302. ;
  303.     RET
  304. ;
  305. ;-----------------------------------------------------------------------
  306. ;
  307. ; Turn DTR OFF
  308. ;
  309. DTROFF:    DS    0
  310. ;
  311. ; <== Insert your own code here
  312. ;
  313.     LD    A,ONHOOK
  314.     OUT    (MSTAT),A
  315. ;
  316. ; <== End of your own code
  317. ;
  318.     RET
  319. ;
  320. ;-----------------------------------------------------------------------
  321. ;
  322. ; Initialise the UART +++
  323. ; The 8251 is set up in three steps:
  324. ;    1)  Hit with a reset
  325. ;    2)  Hit with the byte for stop bits, parity, data bits and clock
  326. ;    3)  Hit with the byte for dtr, rts, error reset, Rxen and TxEn
  327. ;
  328. INIT:    LD    HL,2        ; Get parameters
  329.     ADD    HL,SP
  330.     EX    DE,HL
  331.     CALL    GETPARM        ; In HL
  332.     LD    (BRATE),HL    ; Baud rate
  333.     CALL    GETPARM
  334.     LD    (PARITY),HL    ; Parity
  335.     CALL    GETPARM
  336.     LD    (DATA),HL    ; Data bits
  337.     CALL    GETPARM
  338.     LD    (STOP),HL    ; Stop bits
  339. ;
  340. ; <== Insert your own code here, using values below
  341. ;
  342.     PUSH    BC        ; Don't clobber this register pair
  343.     LD    A,RESET
  344.     OUT    (MSTAT),A    ; Master reset            *** step 1
  345.     LD    E,4EH        ; Assume 8,N,1, x16
  346.     LD    A,(STOP)    ; Set stop bits
  347.     CP    2        ; Set 2 if required
  348.     JR    NZ,SETPAR
  349.     SET    7,E
  350. ;
  351. SETPAR:    LD    A,(PARITY)    ; Set parity bits
  352.     CP    'O'
  353.     JR    NZ,SETPA2
  354.     SET    4,E
  355.     JR    SETBITS
  356. ;
  357. SETPA2:    CP    'E'
  358.     JR    NZ,SETBITS    ; Default to 'N'
  359.     SET    4,E
  360.     SET    5,E
  361. ;
  362. SETBITS:LD    A,(DATA)
  363.     CP    7        ; Not an ascii '7'
  364.     JR    NZ,SETBI2
  365.     RES    2,E
  366. ;
  367. SETBI2:    LD    A,E
  368.     OUT    (MSTAT),A    ; Action
  369.     NOP            ; Small delay
  370.     NOP
  371.     LD    A,ONLINE
  372.     OUT    (MSTAT),A    ; *** step 3
  373. ;
  374. SETBRATE:
  375.     PUSH    IX
  376.     LD    DE,(BRATE)    ; Get baud rate value (0-10)
  377.     LD    HL,BRVAL
  378.     ADD    HL,DE
  379.     ADD    HL,DE        ; Hl now points to the divisor dw
  380.     PUSH    HL        ; Look at it
  381.     POP    IX
  382.     LD    A,(IX)
  383.     OR    (IX+1)        ; Not valid if zero
  384.     JR    Z,SETBRX
  385.     LD    C,CTC+3        ; (0F3h) : ok
  386.     LD    A,MODE        ; 0BEh
  387.     OUT    (C),A        ; Select the correct timer and 8253 mode
  388.     DEC    C
  389.     OUTI            ; Low byte
  390.     OUTI            ; High byte
  391.     LD    A,(BRATE)    ; Tell ZMP it's ok
  392.     LD    (MSPEED),A
  393. ;
  394. SETBRX:    POP    IX
  395.     POP    BC
  396. ;
  397. ; <== End of your own code
  398. ;
  399.     RET
  400. ;
  401. ;-----------------------------------------------------------------------
  402. ;
  403. STOP:    DW    1        ; Stop bits
  404. PARITY:    DW    'N'        ; Parity
  405. DATA:    DW    8        ; Data bits
  406. BRATE:    DW    7        ; Baud rate:
  407. ;
  408. ; Values for 8253 control reg for each baud rate
  409. ;
  410. BRVAL:    DS    0
  411. ;
  412.      IF    MODIFIED
  413.     DW    2273        ; 110         0
  414.     DW    833        ; 300         1
  415.     DW    555        ; 450         2
  416.     DW    417        ; 600         3
  417.     DW    352        ; 710         4
  418.     DW    208        ; 1200         5
  419.     DW    104        ; 2400         6
  420.     DW    52        ; 4800         7
  421.     DW    26        ; 9600         8
  422.     DW    13        ; 19200      9
  423.     DW    0        ; 38400     10
  424.     DW    0        ; 57600     11
  425.     DW    0        ; 76800     12
  426.     DW    0        ; 115200    13
  427. ;
  428.      ELSE
  429.     DW    4546        ; 110         0
  430.     DW    1667        ; 300         1
  431.     DW    1110        ; 450         2
  432.     DW    833        ; 600         3
  433.     DW    177        ; 710         4
  434.     DW    104        ; 1200         5
  435.     DW    52        ; 2400         6
  436.     DW    26        ; 4800         7
  437.     DW    13        ; 9600         8
  438.     DW    0        ; 19200      9
  439.     DW    0        ; 38400     10
  440.     DW    0        ; 57600     11
  441.     DW    0        ; 76800     12
  442.     DW    0        ; 115200    13
  443.      ENDIF
  444. ;
  445. ;-----------------------------------------------------------------------
  446. ;
  447. ; Some systems need a BIOS call to access the UART.  If yours doesn't,
  448. ; you don't need anything here.  Otherwise write your own.
  449. ;
  450. CALMOD:    RET            ; Not required for most computers
  451. ;
  452. ;-----------------------------------------------------------------------
  453. ;
  454. ; Set the port. ZMP supplies either 0 or 1 as a parameter.
  455. ;
  456. setport:
  457.     ld    hl,2        ; get port number
  458.     add    hl,sp
  459.     ex    de,hl
  460.     call    getparm        ; in HL (values are 0 and 1)
  461.  
  462.                 ; <== Insert your own code here
  463.  
  464.                 ; <== End of your own code
  465.     ret
  466. ;
  467. ; Video terminal sequences: these are for ADM-3A: Modify as you wish
  468. ;
  469. ; Cursor addressing
  470. ;
  471. CURSADD:LD    HL,2        ; Get parameters
  472.     ADD    HL,SP
  473.     EX    DE,HL
  474.     CALL    GETPARM        ; In HL
  475.     LD    (ROW),HL    ; Row
  476.     CALL    GETPARM
  477.     LD    (COL),HL    ; Column
  478. ;
  479. ; <== Insert your own code here, using values in row and column
  480. ;
  481.     CALL    PRINT
  482.     DB    ESC,'=',0    ; ADM-3A leadin
  483.     LD    A,(ROW)        ; Row first
  484.     ADD    A,' '        ; Add offset
  485.     CALL    COUT
  486.     LD    A,(COL)        ; Sane for column
  487.     ADD    A,' '
  488.     CALL    COUT
  489. ;
  490. ; <== end of your own code
  491. ;
  492.     RET
  493. ;
  494. ROW:    DS    2        ; Row
  495. COL:    DS    2        ; Column
  496. ;
  497. ; Screen attributes below are set up for a Liberty Freedom 100 terminal.
  498. ;
  499. ; Clear screen
  500. ;
  501. CLS:    CALL    PRINT
  502.     DB    ESC,'*',0
  503.     RET
  504. ;
  505. ; Inverse video on
  506. ;
  507. INVON:    CALL    PRINT
  508.     DB    ESC,'GD',0
  509.     RET
  510. ;
  511. ; Inverse video off
  512. ;
  513. INVOFF:    CALL    PRINT
  514.     DB    ESC,'G0',0
  515.     RET
  516. ;
  517. ; Turn off cursor
  518. ;
  519. HIDE:    CALL    PRINT
  520.     DB    ESC,'.1',0
  521.     RET
  522. ;
  523. ; Turn on cursor
  524. ;
  525. SHOW:    CALL    PRINT
  526.     DB    ESC,'.3',0
  527.     RET
  528. ;
  529. ; Save cursor position
  530. ;
  531. SAVECU:    RET
  532. ;
  533. ; Restore cursor position
  534. ;
  535. RESCU:    RET
  536. ;
  537. ; Service modem interrupt
  538. ;
  539. MINT:    RET            ; My system doesn't need this
  540. ;
  541. ; Initialise interrupt vectors
  542. ;
  543. INVEC:    RET            ; Ditto
  544. ;
  545. ; De-initialise interrupt vectors
  546. ;
  547. DINVEC:    RET            ; Ditto
  548. ;
  549. ; User-defined entry routine: leave empty if not used
  550. ;
  551. USERIN:    RET
  552. ;
  553. ; User-defined exit routine: leave empty if not used
  554. ;
  555. USEROUT:RET
  556. ;
  557. ;------------------- End of user-defined code --------------------------
  558. ;         Do not change anything below here
  559. ;
  560. ; Modem character test for 100 ms
  561. ;
  562. MRD:    PUSH    BC        ; Save BC
  563.     LD    BC,100        ; Set limit
  564. ;
  565. MRD1:    CALL    MIRDY        ; Char at modem?
  566.     JR    NZ,MRD2        ; Yes, exit
  567.     LD    HL,1        ; Else wait 1 ms
  568.     CALL    WAITHLMS
  569.     DEC    BC        ; Loop till done
  570.     LD    A,B
  571.     OR    C
  572.     JR    NZ,MRD1
  573.     LD    HL,0        ; None there, result=0
  574.     XOR    A
  575. ;
  576. MRD2:    POP    BC
  577.     RET
  578. ;
  579. ; Inline print routine: destroys A and HL
  580. ;
  581. PRINT:    EX    (SP),HL        ; Get address of string
  582. ;
  583. PLOOP:    LD    A,(HL)        ; Get next
  584.     INC    HL        ; Bump pointer
  585.     OR    A        ; Done if zero
  586.     JR    Z,PDONE
  587.     CALL    COUT        ; Else print
  588.     JR    PLOOP        ; And loop
  589. ;
  590. PDONE:    EX    (SP),HL        ; Restore return address
  591.     RET            ; And quit
  592. ;
  593. ; Output a character in A to the console
  594. ;
  595. COUT:    PUSH    BC        ; Save registers
  596.     PUSH    DE
  597.     PUSH    HL
  598.     LD    E,A        ; Character to E
  599.     LD    C,2
  600.     CALL    BDOS        ; Print it
  601.     POP    HL
  602.     POP    DE
  603.     POP    BC
  604.     RET
  605. ;
  606. ; Wait(seconds)
  607. ;
  608. WAIT:    LD    HL,2
  609.     ADD    HL,SP
  610.     EX    DE,HL        ; Get delay size
  611.     CALL    GETPARM
  612. ;                ; Fall thru to...
  613. ; Wait seconds in HL
  614. ;
  615. WAITHLS:PUSH    BC        ; Save BC
  616.     PUSH    DE        ; DE
  617.     PUSH    IX        ; And IX
  618.     LD    IX,0        ; Then point IX to 0
  619. ;                ;   so we don't upset memory-mapped I/O
  620. ;
  621. ; Calculate values for loop constants. Need to have two loops to avoid
  622. ; 16-bit overflow with clock speeds above 9 MHz.
  623. ;
  624. OUTERVAL EQU    (CLKSPD    / 10) +    1
  625. ;
  626. INNERVAL EQU    (6667 /    OUTERVAL) * CLKSPD
  627. ;
  628. WAIT10:    LD    B,OUTERVAL
  629. ;
  630. WAIT11:    LD    DE,INNERVAL
  631. ;
  632. WAIT12:    BIT    0,(IX)        ; Time-wasters
  633.     BIT    0,(IX)
  634.     BIT    0,(IX)        ; 20 T-states each
  635.     BIT    0,(IX)
  636.     BIT    0,(IX)
  637.     BIT    0,(IX)
  638.     DEC    DE
  639.     LD    A,E
  640.     LD    A,D
  641.     OR    E
  642.     JR    NZ,WAIT12    ; 150 T-states per inner loop
  643.     DJNZ    WAIT11        ; Decrement outer loop
  644.     DEC    HL        ; Ok, decrement count in HL
  645.     LD    A,H
  646.     OR    L
  647.     JR    NZ,WAIT10
  648.     POP    IX        ; Done -- restore IX
  649.     POP    DE        ; DE
  650.     POP    BC        ; And BC
  651.     RET
  652. ;
  653. ; Wait milliseconds
  654. ;
  655. MSWAIT:    LD    HL,2
  656.     ADD    HL,SP
  657.     EX    DE,HL        ; Get delay size
  658.     CALL    GETPARM
  659. ;
  660. ; Wait milliseconds in HL
  661. ;
  662. WAITHLMS:
  663.     PUSH    DE
  664. ;
  665. W1MS0:    LD    DE,39 *    CLKSPD
  666. ;
  667. W1MS1:    DEC    DE
  668.     LD    A,D
  669.     OR    E
  670.     JR    NZ,W1MS1
  671.     DEC    HL
  672.     LD    A,H
  673.     OR    L
  674.     JR    NZ,W1MS0
  675.     POP    DE
  676.     RET
  677. ;
  678. ; Get next parameter from (DE) into HL
  679. ;
  680. GETPARM:EX    DE,HL        ; Get address into HL
  681.     LD    E,(HL)        ; Get low
  682.     INC    HL
  683.     LD    D,(HL)        ; Then hihi
  684.     INC    HL        ; Bump for next
  685.     EX    DE,HL        ; Result in HL, address still in DE
  686.     RET
  687. ;
  688. ;Get address of user-defined variables
  689. ;
  690. GETVARS:
  691.     LD    HL,USERVARS
  692.     RET
  693. USERVARS:
  694.     DW    OVERDRIVE    ; .OVR etc. drive/user
  695.     DW    OVERUSER
  696. ;
  697.      IF    ($ - CODEBGN) GT OVSIZE
  698. TOOBIG:    JP    ERRVAL        ; Overlay is too large
  699.      ENDIF
  700. ;
  701.     END
  702.