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 / BEEHIVE / UTILITYS / INITP6.ARC / INITP6.ASM next >
Assembly Source File  |  1990-07-21  |  19KB  |  693 lines

  1. ;            _______________________________________
  2. ;           I                                       I
  3. ;           I     NEC-P6 PRINTER INITIALISATION     I
  4. ;           I                                       I
  5. ;           I    Probably works equally well for    I
  6. ;           I    sundry other 24-pin dot matrix     I
  7. ;           I    printers (e.g. Epson LQ1500 ??)    I
  8. ;           I    but I haven't had access to the    I
  9. ;           I    printer manuals to be able to      I
  10. ;           I    check this.                        I
  11. ;           I                                       I
  12. ;           I     Steve Filan, September 4th 1987   I
  13. ;           I_______________________________________I
  14.  
  15.  
  16. ;  Several elements have been adapted from:-
  17. ;     Barbier, K. (1983). CP/M Assembly Language 
  18. ;     Programming.  Englewood Cliffs.  Prentice Hall.
  19. ;  and/or from:-
  20. ;     Leventhal, L.A. (1978).  8080A/8085 Assembly 
  21. ;     Language Programming.  Berkeley. Osborne/
  22. ;     McGraw-Hill.
  23.  
  24.  
  25.  
  26.  
  27. ;            _______________________________________
  28. ;           I                                       I
  29. ;           I             Preliminaries             I
  30. ;           I_______________________________________I
  31.  
  32.     
  33. ;______ Set up symbols for codes for ASCII characters
  34.  
  35.  
  36.     CR        EQU   0DH ;Carriage return
  37.     LF        EQU   0AH ;Line feed
  38.     CTRLZ     EQU   1AH ;Osborne clear-screen code
  39.     ESC       EQU   1BH ;Escape
  40.     FS        EQU   1CH ;File separator
  41.     PAGE      EQU   0CH ;Form feed.
  42.  
  43.  
  44.  
  45. ;______ Set up codes for CP/M's CBIOS I/O functions
  46.  
  47.  
  48.     RCONF     EQU     1 ;Read from console to [A]
  49.     WCONF     EQU     2 ;Write [A] to console
  50.     WLISF     EQU     5 ;Write [A] to printer
  51.     RBUFF     EQU    10 ;Read a console line to buffer
  52.  
  53.  
  54.  
  55. ;______ Define addresses 
  56.  
  57.  
  58. ;       Addresses for:-    
  59.  
  60.     RBOOT     EQU     0 ;Re-boot of CP/M
  61.     BDOS      EQU     5 ;BDOS call vector
  62.     TPA       EQU 0100H ;Transient Program Area
  63.  
  64.  
  65.  
  66. ;             _______________________________________
  67. ;            I                                       I
  68. ;            I         START OF MAIN PROGRAM         I
  69. ;            I_______________________________________I
  70.  
  71.  
  72.  
  73.     ORG    TPA
  74. START:
  75.     LXI    SP,STAK      ;Set up user's stack
  76.  
  77. START1:
  78.     CALL   SPMSG        ;Clear screen
  79.     DB     CTRLZ,0
  80.     CALL   TWOCR        ;Skip a couple of lines, then
  81.     CALL   SPMSG        ;Give sign-on message.
  82.     DB     CR,LF,LF
  83.     DB     'Printer initialisation routine'
  84.     DB     ' by Steve Filan, September 4th 1987.'
  85.     DB     CR,LF,LF
  86.     DB     'This utility first resets the printer to'
  87.     DB     ' default (switch-on) status,'
  88.     DB     CR,LF
  89.     DB     'then offers menus for various options.'
  90.     DB     CR,LF,LF
  91.     DB    'Make sure that the printer is connected '
  92.     DB    'and switched on.'
  93.     DB    CR,LF
  94.     DB    'Are you ready to proceed?'
  95.     DB    CR,LF,0
  96.  
  97. ;       Check if ready.
  98.  
  99.     CALL   GETYN        ;Ready to go?
  100.     CPI    'Y'          ;If 'Y', proceed,
  101.     JNZ    RBOOT        ;  ... else, re-boot system.
  102.  
  103. ;       Reset NEC P6 defaults first.
  104.  
  105.     CALL   SPMSGL
  106.     DB       FS,'@',0
  107.  
  108. ;       Set A4 size (70 lines at default spacing).
  109.  
  110.     CALL   SPMSGL
  111.     DB     ESC,'C',70,0
  112.  
  113.  
  114.  
  115. ;______ OFFER PRINT-SIZE MENU _______________________
  116.  
  117.  
  118.     CALL   CLRSCR       ;Set up screen
  119.     CALL   SPMSG        ;Offer menu
  120.     DB     '       PRINT-SIZE MENU',CR,LF
  121.     DB     '       ===============',CR,LF,LF
  122.     DB     '  1  =  10-pitch',CR,LF
  123.     DB     '  2  =  12-pitch',CR,LF
  124.     DB     '  3  =  15-pitch',CR,LF
  125.     DB     '  4  =  17-pitch',CR,LF
  126.     DB     '  5  =  20-pitch',CR,LF,LF,0
  127.  
  128.  
  129.     CALL   GET15        ;Get a response, 1 to 5.
  130.  
  131.  
  132.     CPI    1            ;Did response = 1 ?
  133.     JNZ    M2
  134.     CALL   SPMSGL       ;   Yes, set 10 pitch.
  135.     DB     ESC,'P',0
  136.     CALL   SPMSG        ;Confirm
  137.     DB     CR,LF,'10 pitch set',CR,LF,0
  138.     JMP    MENU2        ;To next menu.
  139.  
  140.  
  141. M2: CPI    2            ;Did response = 2 ?
  142.     JNZ    M3
  143.     CALL   SPMSGL       ;   Yes, set 12-pitch.
  144.     DB     ESC,'M',0
  145.     CALL   SPMSG        ;Confirm
  146.     DB     CR,LF,'12 pitch set',CR,LF,0
  147.     JMP    MENU2        ;To next menu.
  148.  
  149.  
  150. M3: CPI    3            ;Did response = 3 ?
  151.     JNZ    M4 
  152.     CALL   SPMSGL       ;   Yes, set 15-pitch
  153.     DB     ESC,'g',0    ;
  154.     CALL   SPMSG        ;Confirm
  155.     DB     CR,LF,'15 pitch set',CR,LF,0
  156.     JMP    MENU2        ;To next menu,
  157.  
  158.  
  159. M4: CPI    4           ;Did response = 4 ?
  160.     JNZ    M5
  161.     CALL   SPMSGL      ;   Yes, set 17-pitch. 
  162.     DB     ESC,'P',ESC,15,0
  163.     CALL SPMSG         ;Confirm
  164.     DB     CR,LF,'17 pitch (condensed 10 pitch) '
  165.     DB     'set.',CR,LF,0
  166.     JMP    MENU2       ;To next menu
  167.  
  168.  
  169. M5:                    ;Response = 5.
  170.     CALL   SPMSGL      ;Set 20 pitch.
  171.     DB     ESC,'M',ESC,15,0
  172.     CALL   SPMSG       ;Confirm
  173.     DB     CR,LF,'20 pitch (condensed 12 pitch) set.'
  174.     DB     CR,LF,0
  175.  
  176.  
  177.  
  178.  
  179.  
  180. ;______ OFFER PRINT-MODE MENU _______________________
  181.  
  182.  
  183. MENU2:
  184.     CALL   CLRSCR      ;Set up new screen
  185.     CALL   SPMSG        ;Offer menu
  186.     DB     '       PRINT-MODE',CR,LF
  187.     DB     '       ===============',CR,LF,LF
  188.     DB     '  1  =  Draft quality',CR,LF
  189.     DB     '  2  =  Letter quality',CR,LF,0
  190.  
  191.  
  192.     CALL   GET12        ;Get a response, 1 or 2.
  193.  
  194.  
  195.     CPI    1            ;Did response = 1 ?
  196.     JNZ    M6
  197.     CALL   SPMSGL       ;   Yes, set draft quality.
  198.     DB     ESC,'x',0    ;   ESC-x-0 - careful with '0'
  199.     LDA    0            ;    .. send on its own.
  200.     CALL   LO
  201.     CALL   SPMSG        ;Confirm
  202.     DB     CR,LF,'Set for draft quality.',CR,LF,0
  203.     JMP    MENU3        ;To next menu.
  204.  
  205.  
  206. M6:                     ;Set letter quality.
  207.     CALL   SPMSGL
  208.     DB     ESC,'x',1,0
  209.     CALL   SPMSG        ;Confirm
  210.     DB     CR,LF,'Set for letter quality.',CR,LF,0
  211.  
  212.  
  213.  
  214.  
  215.  
  216. ; _____ OFFER PRINT-WEIGHT MENU _____________________
  217.  
  218.  
  219. MENU3:
  220.     CALL   TWOCR        ;Skip four lines
  221.     CALL   TWOCR
  222.     CALL   SPMSG        ;Ask if emphasis required.
  223.     DB     'Do you want emphasised or double-strike'
  224.     DB     'print ?  ',0
  225.     CALL   GETYN        ;Prompt for (Y/N) response
  226.     CPI    'Y'          ;If 'Y', proceed,
  227.     JNZ    MENU4        ;  else go to next menu.
  228.  
  229.     CALL   TWOCR        ;Skip a couple of lines
  230.     CALL   SPMSG        ;Offer menu.
  231.     DB     '  1  =  Emphasised only',CR,LF
  232.     DB     '  2  =  Both emphasised and '
  233.     DB              'double-strike.',CR,LF,LF,0
  234.  
  235.     CALL   GET12        ;Get response as 1 or 2.
  236.  
  237.     CPI    2            ;Response = 2 ?
  238.     JNZ    E1           ;No - want emphasised but 
  239.                         ;     not double
  240.     CALL   SPMSGL       ;Set double-strike on
  241.     DB     ESC,'G',0
  242.     CALL   SPMSG        ;Confirm
  243.     DB     'Double-strike set',CR,LF,0
  244.  
  245. E1:                     ;Set emphasised print on.
  246.     CALL   SPMSGL
  247.     DB     ESC,'E',0
  248.     CALL   SPMSG        ;Confirm
  249.     DB     'Emphasised print set',CR,LF,0
  250.  
  251.     
  252.  
  253.  
  254.  
  255. ;______ OFFER LINE-SPACING MENU _____________________
  256.  
  257.  
  258. MENU4:
  259.     CALL   CLRSCR       ;Set up new screen
  260.     CALL   SPMSG        ;Offer menu
  261.     DB     '       LINE-SPACING MENU',CR,LF
  262.     DB     '       =================',CR,LF,LF
  263.     DB     '  1  =  Normal 6 lines/inch',CR,LF
  264.     DB     '  2  =  Double-space, 3 lines/inch',CR,LF
  265.     DB     '  3  =  One-and-a-half space,'
  266.     DB             ' 4 lines/inch',CR,LF
  267.     DB     '  4  =  c. 6.67 lines/inch, gives about '
  268.     DB             '78 lines per page',CR,LF
  269.     DB     '        (OK with 15-, 17- 20- pitch).'
  270.     DB     CR,LF
  271.     DB     '  5  =  c. 7.33 lines/inch, gives about '
  272.     DB             '86 lines per page',CR,LF
  273.     DB     '        (Acceptable with 20 pitch).'
  274.     DB     CR,LF,LF,0
  275.  
  276.  
  277.     CALL   GET15        ;Get a response, 1 to 5.
  278.  
  279.  
  280.     CPI    1            ;Did response = 1 ?
  281.     JNZ    M7
  282.     CALL   SPMSGL       ;   Yes, set 6 lines/inch.
  283.     DB     ESC,'2',0
  284.     JMP    WINDUP       ;To end of job.
  285.  
  286.  
  287. M7: CPI    2            ;Did response = 2 ?
  288.     JNZ    M8
  289.     CALL   SPMSGL       ;   Yes, set double space
  290.     DB     ESC,'A',20,0
  291.     JMP    WINDUP       ;To end of job.
  292.  
  293.  
  294. M8: CPI    3            ;Did response = 3 ?
  295.     JNZ    M9 
  296.     CALL   SPMSGL       ;   Yes, set 1.5 space
  297.     DB     ESC,'A',15,0    ;
  298.     JMP    WINDUP       ;To end of job.
  299.  
  300.  
  301. M9: CPI    4           ;Did response = 4 ?
  302.     JNZ    M10
  303.     CALL   SPMSGL      ;   Yes, set 6.67 lines/inch
  304.     DB     FS,'3',54,0
  305.     JMP    WINDUP      ;To end of job.
  306.  
  307.  
  308. M10:                   ;Response = 5.
  309.     CALL   SPMSGL      ;Set 7.33 lines/inch
  310.     DB     FS,'3',49,0
  311.  
  312.  
  313.  
  314.  
  315.  
  316. ;______ WIND UP & RETURN TO SYSTEM __________________
  317.  
  318.  
  319. WINDUP:
  320.     CALL   CLRSCR      ;Set up new screen
  321.     CALL   SPMSG        ;Offer menu
  322.     DB     'Printer-initialisation complete.'
  323.     DB     CR,LF,LF
  324.     DB     'Check print-head is at head-of-form '
  325.     DB     'before doing any printing!'
  326.     DB     CR,LF,LF,LF,0
  327.     JMP    RBOOT        ;All finished ... re-boot.
  328.  
  329.  
  330. ;_____  End of main program  ________________________
  331.  
  332.  
  333.  
  334.  
  335.  
  336. ;   ________________________________________________
  337. ;  I                                                I
  338. ;  I              Subroutine CLRSCR                 I
  339. ;  I                                                I
  340. ;  I    Delay, then open a screen for a new menu.   I
  341. ;  I________________________________________________I
  342.  
  343.  
  344. CLRSCR:
  345.     CALL   DELAY        ;Delay for quarter-second
  346.     CALL   SPMSG        ;Clear screen
  347.     DB     CTRLZ,0
  348.     CALL   TWOCR        ;Skip a couple of lines
  349.     RET                 ;Return
  350.  
  351.  
  352.  
  353.  
  354.  
  355. ;   ________________________________________________
  356. ;  I                                                I
  357. ;  I               Subroutine DELAY                 I
  358. ;  I                                                I
  359. ;  I       Loop for delay of approximately          I
  360. ;  I       255 ms (assuming 4MHz 8080 processor).   I
  361. ;  I       Beware -- timing is hardware-sensitive   I
  362. ;  I       For commentary, see Leventhal (1978)     I
  363. ;  I       Chapter 11.                              I
  364. ;  I________________________________________________I
  365.  
  366.  
  367.  
  368.  
  369. DELAY:                    ;Delay 255 ms at each call.
  370.     MVI    A,255
  371.  
  372. DELAY1:                    ;Set loop counter
  373.     MVI    B,255
  374.  
  375. DELAY2:    
  376.     DCR    B            ;Counter = Counter - 1
  377.     JNZ    DELAY2       ;  Continue till Counter = 0
  378.     DCR    A            ;Number of ms = no. of ms - 1
  379.     JNZ    DELAY1       ;Continue
  380.     RET
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. ;   ________________________________________________
  395. ;  I                                                I
  396. ;  I   I N P U T / O U T P U T   R O U T I N E S    I
  397. ;  I                                                I
  398. ;  I   Mostly adapted from code in Barbier (1983)   I
  399. ;  I________________________________________________I
  400.  
  401.  
  402.  
  403.  
  404. ;______ Subroutine "CI" _____________________________
  405.  
  406. ;  Accept a character from the console keyboard; mask
  407. ;  to 7 bits to hide possible parity bit; then store
  408. ;  in Accumulator, register A.
  409.  
  410. CI:
  411.     PUSH   B            ;Save registers on stack
  412.     PUSH   D
  413.     PUSH   H
  414.     MVI    C,RCONF      ;Put read-function code in C
  415.     CALL   BDOS         ;Have read function performed
  416.     ANI    7FH          ;Mask to 7 bits
  417.     POP    H            ;Recover registers from stack
  418.     POP    D
  419.     POP    B
  420.     RET                 ;Return to main routine
  421.  
  422.  
  423.  
  424.  
  425. ;______ Subroutine "CO" _____________________________
  426. ;       Display the character in Accumulator 
  427. ;       (register [A]) at the console.
  428.  
  429.  
  430.  
  431. CO:
  432.     PUSH   B            ;Save registers on stack
  433.     PUSH   D
  434.     PUSH   H
  435.     MVI    C,WCONF      ;Code for write function to C
  436.     MOV    E,A          ;Character moved from A to E
  437.     CALL   BDOS         ;Perform write-console 
  438.     POP    H            ;Recover registers from stack
  439.     POP    D
  440.     POP    B
  441.     RET                 ;Return to main routine
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. ;______ Subroutine "LO" _____________________________
  451. ;       Display the character in Accumulator 
  452. ;       (register A) at the printer.
  453.  
  454.  
  455.  
  456. LO:
  457.     PUSH   B            ;Save registers on stack
  458.     PUSH   D
  459.     PUSH   H
  460.     MVI    C,WLISF      ;Code for list function to C
  461.     MOV    E,A          ;Character moved from A to E
  462.     CALL   BDOS         ;Send character to printer.
  463.     POP    H            ;Recover registers from stack
  464.     POP    D
  465.     POP    B
  466.     RET                 ;Return to main routine
  467.  
  468.  
  469.  
  470.  
  471.  
  472. ; _____ Subroutines TWOCR and CCRLF _________________
  473. ;       Send either two or one carriage return/line 
  474. ;       feed sequences to console display.
  475.  
  476.  
  477. TWOCR:
  478.     CALL   CCRLF        ;Do twice if called as TWOCR
  479.  
  480. CCRLF:
  481.     MVI     A,CR        ;Store code for CR
  482.     CALL    CO          ;    ... display
  483.     MVI     A,LF        ;Ditto for line feed
  484.     JMP     CO          ;Indirect return via CO.
  485.  
  486.  
  487.  
  488.  
  489.  
  490. ; _____ Subroutine COMSG ____________________________
  491. ;       Display on the console a line of text that 
  492. ;       has previously been stored in buffer.
  493.  
  494.  
  495. COMSG:
  496.     MOV    A,M          ;Get a character from memory
  497.     ORA    A            ;Dummy "or" operation, to set
  498.     RZ                  ;   flag ... return if [A]=0.
  499.     CALL   CO           ;Output character
  500.     INX    H            ;Point to next character
  501.     JMP    COMSG        ;     and continue loop
  502.  
  503.  
  504.  
  505.  
  506.  
  507. ; _____ Subroutine LOMSG ____________________________
  508. ;       Display on the printer a line of text that 
  509. ;       has previously been stored in buffer.
  510.  
  511.  
  512. LOMSG:
  513.     MOV    A,M          ;Get a character from memory
  514.     ORA    A            ;Dummy "or" operation, to set
  515.     RZ                  ;   flag ... return if [A]=0.
  516.     CALL   LO           ;Output character
  517.     INX    H            ;Point to next character
  518.     JMP    LOMSG        ;      and continue loop.
  519.  
  520.  
  521.  
  522.  
  523.  
  524. ; _____ Subroutine CIMSG ____________________________
  525. ;       Subroutine which accepts a line of input from
  526. ;       the console, storing the text in a buffer.
  527.  
  528.  
  529. CIMSG:
  530.     PUSH   B            ;Store registers
  531.     PUSH   D
  532.     PUSH   H
  533.     LXI    H,INBUF+1    ;Zero character counter
  534.     MVI    M,0    
  535.     DCX    H            ;Set maximum line length
  536.     MVI    M,80         ;    as 80 (decimal).
  537.     XCHG                ;Reset pointer to DE register
  538.     MVI    C,RBUFF      ;Set code for read-buffer fn.
  539.     CALL   BDOS         ;   of BDOS, & call it.
  540.     LXI    H,INBUF+1    ;Get char. counter
  541.     MOV    E,M          ;  into LSB of DE register 
  542.     MVI    D,0          ;Zero MSB of DE register
  543.     DAD    D            ;Add length to start
  544.     INX    H            ;   plus 1 points to end
  545.     MVI    M,0          ;Insert terminator character.
  546.     POP    H            ;Restore all registers
  547.     POP    D
  548.     POP    B
  549.     RET
  550.  
  551.  
  552.  
  553.  
  554.  
  555. ; _____ Subroutine SPMSG ____________________________
  556. ;       Subroutine to display message "in-line" 
  557. ;       during program running.
  558. ;       (Use zero byte as end-of-buffer signal).
  559.     
  560.     
  561. SPMSG:
  562.     XTHL                ;Get return address to HL
  563.     XRA    A            ;Clear flags & accumulator
  564.     ADD    M            ;Get one message character
  565.     INX    H            ;Point to next
  566.     XTHL                ;Restore stack for
  567.     RZ                  ;           return if done
  568.     CALL   CO           ;Else, display character
  569.     JMP    SPMSG        ;    ... and do another.
  570.  
  571.  
  572.  
  573.  
  574.  
  575. ; _____ Subroutine SPMSGL ___________________________
  576. ;       Subroutine to send "in-line" message to 
  577. ;       printer.
  578. ;       (Use zero byte as end-of-buffer signal).
  579.  
  580.  
  581. SPMSGL:
  582.     XTHL                ;Get return address to HL
  583.     XRA       A         ;Clear flags & accumulator
  584.     ADD       M         ;Get one message character
  585.     INX       H         ;Point to next
  586.     XTHL                ;Restore stack for
  587.     RZ                  ;    return if done
  588.     CALL      LO        ;Else, send a character
  589.     JMP       SPMSGL    ;   ... and do another.
  590.  
  591.  
  592.  
  593.  
  594.  
  595. ; _____ Subroutine GETYN ____________________________
  596. ;       Get (upper- OR lower- case) Y for yes or 
  597. ;       N for no, from console.
  598.  
  599.  
  600. GETYN:
  601.     CALL   SPMSG        ;Prompt for input
  602.     DB     CR,LF,' (Y/N)?: ',0
  603.     CALL   CI           ;Get character at console
  604.     ANI    01011111B    ;Convert to upper-case
  605.     CPI    'Y'          ;Return with zero = Yes
  606.     RZ
  607.     CPI    'N'          ;Non-zero = NO
  608.     JNZ    GETYN        ;    ... else, try again ...
  609.     CPI    0            ;Reset zero flag
  610.     RET                 ;All done.
  611.  
  612.  
  613.  
  614.  
  615.  
  616. ;______ Subroutine GET12 ____________________________
  617. ;       Get an integer (1 or 2) from the console.
  618. ;       See Leventhal (1978) pp. 7-6 to 7-8.
  619.  
  620.  
  621. GET12:
  622.     CALL   SPMSG        ;Prompt for input
  623.     DB     'Enter a digit 1 or 2:  ',0
  624.     CALL   CI           ;Get input character, masked
  625.                         ; to 7 bits, store in [A]
  626.     SUI    '0'          ;Subtract ASCII '0' to 
  627.                         ; convert ASCII to integer.
  628.     JC     GET12        ;  Try again .. outside range.
  629.     CPI    3            ;Check upper limit
  630.     JNC    GET12        ;  Try again .. too big!
  631.     RET                 ;Integer 1 or 2 found OK.
  632.  
  633.  
  634.  
  635.  
  636.  
  637. ;______ Subroutine GET15 ____________________________
  638. ;       Get an integer (1..5) from the console.
  639. ;       See Leventhal (1978) pp. 7-6 to 7-8.
  640.  
  641.  
  642. GET15:
  643.     CALL   SPMSG        ;Prompt for input
  644.     DB     'Enter a digit 1..5:  ',0
  645.     CALL   CI           ;Get input character, masked
  646.                         ; to 7 bits, store in [A].
  647.     SUI    '0'          ;Subtract ASCII '0' to
  648.                         ; convert ASCII to integer
  649.     JC     GET15        ;  Try again .. outside range.
  650.     CPI    6            ;Check upper limit
  651.     JNC    GET15        ;  Try again .. too big!
  652.     RET                 ;Integer 1..5 found OK.
  653.  
  654.  
  655.  
  656.  
  657.  
  658. ;            _______________________________________
  659. ;           I                                       I
  660. ;           I  Set up storage space for memory      I
  661. ;           I  variables and input/output buffer.   I
  662. ;           I_______________________________________I
  663.  
  664.  
  665. INBUF:  
  666.     DS     83           ;Line input buffer
  667.     
  668. NEXT:
  669.     DS     2            ; Next DMA address
  670.  
  671.  
  672.     DS     64           ;Reserve space for stack.
  673.  
  674. STAK:
  675.     DB     0            ;Set pointer to top of stack
  676.  
  677.  
  678. BUFFR:                  ;Remainder of memory, to CCP, 
  679.                         ;       is free buffer space.
  680.  
  681.  
  682. ; _____ End of code _________________________________
  683.  
  684.  
  685.     END
  686.                         ;       is free buffer space.
  687.  
  688.  
  689. ; _____ End of code _________________________________
  690.  
  691.  
  692.