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-BW05.Z80 < prev    next >
Text File  |  2000-06-30  |  13KB  |  665 lines

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